fdsa
This commit is contained in:
@@ -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
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user