fix: stop drift migration from dropping tracking table

This commit is contained in:
mahmood
2026-09-15 22:40:00 +03:30
parent 1f734bedca
commit 2448627e1b
142 changed files with 221 additions and 1103 deletions
+4 -1
View File
@@ -93066,7 +93066,10 @@ var require_migrate = __commonJS({
const legacyName = LEGACY_NAME_ALIASES[file2.name];
if (appliedNames.has(file2.name) || legacyName && appliedNames.has(legacyName))
continue;
const statements = splitSqlStatements((0, fs_1.readFileSync)(file2.path, "utf8"));
const statements = splitSqlStatements((0, fs_1.readFileSync)(file2.path, "utf8")).filter((statement) => {
const normalized = statement.replace(/\s+/g, " ").trim().toLowerCase();
return !normalized.startsWith(`drop table "${TRACKING_TABLE.toLowerCase()}"`) && !normalized.startsWith(`drop table ${TRACKING_TABLE.toLowerCase()}`);
});
await prisma.$transaction(
async (tx) => {
for (const statement of statements) {