v3: added a roles/permissions system, added user management tab on user profile
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 42s
All checks were successful
Build and Publish Docker Image / build-and-push (push) Successful in 42s
This commit is contained in:
13
api/db/migrations/0005_drop_is_admin.ts
Normal file
13
api/db/migrations/0005_drop_is_admin.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { DatabaseSync } from "node:sqlite";
|
||||
|
||||
// Drops the legacy is_admin column now that `role` is the single source of
|
||||
// truth. Idempotent: skips when the column is already gone (fresh databases
|
||||
// created from schema.sql never had it). Must run after 0004 has backfilled.
|
||||
export function up(db: DatabaseSync): void {
|
||||
const userCols = db.prepare(`PRAGMA table_info(users);`).all() as {
|
||||
name: string;
|
||||
}[];
|
||||
if (userCols.some((c) => c.name === "is_admin")) {
|
||||
db.exec(`ALTER TABLE users DROP COLUMN is_admin;`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user