18 lines
435 B
JavaScript
18 lines
435 B
JavaScript
import db from "./src/lib/db.js";
|
|
|
|
console.log("Adding can_be_assigned column to users table...");
|
|
|
|
// Add the new column
|
|
db.prepare(`
|
|
ALTER TABLE users
|
|
ADD COLUMN can_be_assigned INTEGER DEFAULT 1
|
|
`).run();
|
|
|
|
// Set admin users to not be assignable by default
|
|
db.prepare(`
|
|
UPDATE users
|
|
SET can_be_assigned = 0
|
|
WHERE role = 'admin'
|
|
`).run();
|
|
|
|
console.log("Migration completed. Admin users are now not assignable by default."); |