This commit is contained in:
2026-08-18 21:40:19 +02:00
parent 3d1579eed9
commit 8b5da35341
2 changed files with 9 additions and 3 deletions

View File

@@ -913,7 +913,8 @@ CREATE TABLE public.items (
width integer, width integer,
height integer, height integer,
visibility smallint DEFAULT 0 NOT NULL, visibility smallint DEFAULT 0 NOT NULL,
slug character varying(16) slug character varying(16),
expires_at bigint DEFAULT NULL
); );

View File

@@ -474,13 +474,18 @@ process.on('uncaughtException', err => {
await updateHallsCache(); await updateHallsCache();
} }
// Auto-migrate schema: ensure user_options banner columns exist // Auto-migrate schema: ensure user_options & items columns exist
try { try {
await db`ALTER TABLE user_options ADD COLUMN IF NOT EXISTS banner_file character varying(255) DEFAULT NULL`; await db`ALTER TABLE user_options ADD COLUMN IF NOT EXISTS banner_file character varying(255) DEFAULT NULL`;
await db`ALTER TABLE user_options ADD COLUMN IF NOT EXISTS banner_position character varying(50) DEFAULT 'center'`; await db`ALTER TABLE user_options ADD COLUMN IF NOT EXISTS banner_position character varying(50) DEFAULT 'center'`;
await db`ALTER TABLE user_options ADD COLUMN IF NOT EXISTS banner_size character varying(50) DEFAULT 'cover'`; await db`ALTER TABLE user_options ADD COLUMN IF NOT EXISTS banner_size character varying(50) DEFAULT 'cover'`;
await db`ALTER TABLE items ADD COLUMN IF NOT EXISTS expires_at bigint DEFAULT NULL`;
await db`ALTER TABLE items ADD COLUMN IF NOT EXISTS width integer DEFAULT NULL`;
await db`ALTER TABLE items ADD COLUMN IF NOT EXISTS height integer DEFAULT NULL`;
await db`ALTER TABLE items ADD COLUMN IF NOT EXISTS original_filename text DEFAULT NULL`;
await db`ALTER TABLE items ADD COLUMN IF NOT EXISTS title text DEFAULT NULL`;
} catch (e) { } catch (e) {
console.error('[BOOT] Schema migration error (banner columns):', e.message); console.error('[BOOT] Schema migration error:', e.message);
} }
// Log feature flags // Log feature flags