fix: harden launch server runtime and public config

This commit is contained in:
stringadmin
2026-06-04 18:58:45 +08:00
parent 1a5992845a
commit df5ea8c65e
14 changed files with 926 additions and 32 deletions
+20
View File
@@ -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);
`);
}