fix: harden launch server runtime and public config
This commit is contained in:
@@ -958,6 +958,7 @@ async function ensureSchema() {
|
||||
await runMigration("029_task_poll_heartbeat", migrateTaskPollHeartbeat);
|
||||
await runMigration("030_generation_tasks_user_status_index", migrateGenerationTasksUserStatusIndex);
|
||||
await runMigration("031_generation_tasks_billing_columns", migrateGenerationTasksBillingColumns);
|
||||
await runMigration("032_ecommerce_video_history", migrateEcommerceVideoHistorySchema);
|
||||
await ensureModelPriceSeed();
|
||||
}
|
||||
|
||||
@@ -1105,3 +1106,22 @@ module.exports = {
|
||||
hasColumn,
|
||||
addColumnIfMissing,
|
||||
};
|
||||
|
||||
async function migrateEcommerceVideoHistorySchema(client) {
|
||||
await client.query(`
|
||||
CREATE TABLE IF NOT EXISTS ecommerce_video_history (
|
||||
id SERIAL PRIMARY KEY,
|
||||
user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,
|
||||
title VARCHAR(200) NOT NULL DEFAULT '',
|
||||
config_json TEXT NOT NULL DEFAULT '{}',
|
||||
plan_json TEXT NOT NULL DEFAULT '{}',
|
||||
scenes_json TEXT NOT NULL DEFAULT '[]',
|
||||
source_image_urls TEXT NOT NULL DEFAULT '[]',
|
||||
status VARCHAR(32) NOT NULL DEFAULT 'completed',
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_ecommerce_video_history_user
|
||||
ON ecommerce_video_history(user_id, created_at DESC);
|
||||
`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user