feat(db): add migration to drop unused AI columns and dynamically resolve initial migration tag

This commit is contained in:
MythEclipse
2026-06-02 23:55:12 +07:00
parent 88acda4703
commit d81aaf2b4a
3 changed files with 62 additions and 5 deletions
@@ -0,0 +1,7 @@
-- Migration: 0004_drop_unused_ai_columns
-- Converts orphaned raw SQL from src/shared/database/migrations/001_drop_unused_ai_columns.sql
-- These column definitions were removed from the Drizzle schema but old databases
-- created before the refactor still have them. Drizzle never ran the raw SQL.
ALTER TABLE messages DROP COLUMN IF EXISTS ai_moderation_raw;
ALTER TABLE messages DROP COLUMN IF EXISTS ai_policy_version;
ALTER TABLE messages DROP COLUMN IF EXISTS ai_evidence;
@@ -29,6 +29,13 @@
"when": 1780418603164,
"tag": "0003_add_corrected_moderations",
"breakpoints": true
},
{
"idx": 4,
"version": "7",
"when": 1780418800000,
"tag": "0004_drop_unused_ai_columns",
"breakpoints": true
}
]
}