This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import type Database from 'better-sqlite3';
|
||||
const initialized = new WeakSet<Database.Database>();
|
||||
export function ensureAuthSchema(handle: Database.Database): void {
|
||||
if (initialized.has(handle)) return;
|
||||
export function migrateAuthSchema(handle: Database.Database): void {
|
||||
handle.exec(`
|
||||
CREATE TABLE IF NOT EXISTS auth_users (
|
||||
id TEXT PRIMARY KEY, username TEXT NOT NULL COLLATE NOCASE UNIQUE,
|
||||
@@ -24,5 +22,4 @@ export function ensureAuthSchema(handle: Database.Database): void {
|
||||
);
|
||||
CREATE INDEX IF NOT EXISTS auth_audit_created_at ON auth_audit(created_at);
|
||||
`);
|
||||
initialized.add(handle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user