fix: guard legacy conditional migration
Validate and deploy staging / validate (push) Successful in 21s
Validate and deploy production / validate (push) Successful in 27s
Validate and deploy staging / deploy (push) Successful in 22s
Validate and deploy production / deploy (push) Successful in 26s

This commit is contained in:
jb
2026-07-31 22:00:52 -04:00
parent f48cc878aa
commit 11406e3ec6
+4 -4
View File
@@ -753,10 +753,10 @@ if (conditionalRuleColumns.some((column) => column.name === 'trigger_id')) {
ON pool.id=clause.state_pool_id`);
}
const legacyTriggerTable = await (await database.prepare(
"SELECT 1 AS present FROM sqlite_master WHERE type='table' AND name='talent_triggers'"
)).get();
if (legacyTriggerTable) {
const legacyTriggerClauseColumns = await (await database.prepare(
"PRAGMA table_info('conditional_effect_clauses')"
)).all();
if (legacyTriggerClauseColumns.some((column) => column.name === 'trigger_id')) {
const nowForConditionalMigration = new Date().toISOString();
await (await database.prepare(`INSERT OR IGNORE INTO talent_triggers
(id,name,description,action_key,active,created_at,updated_at)