fix: rebuild migration history as baseline so migrate works on prod
Squash the 13 historical migrations into one generated baseline whose journal entry reuses the original 0000 timestamp: the migrator skips it on every existing database (prod journal stuck at 0006) and applies it only on fresh ones. Parity with the old chain verified via pg_dump diff plus fresh/existing/prod-simulated drizzle-kit migrate runs. Historical files move to drizzle-history/pre-squash-2026-08/ for integration tests that exercise legacy migration behavior. Also repair db tests that already failed before this change: - raw SQL targeted users, but the table has always been "user" - membership recheck mocked legacy getAsset.albums instead of searchPhotos - audit rollback assertion walks drizzle's wrapped error cause chain - keyset index probe pinned to NULLS LAST ordering, removing a planner cost tie-break that flipped with index creation order
This commit is contained in:
1 parent
2949149170
commit
0b65fbba16
40 files changed
+2389
-128
No files matched your search
@@ -9,7 +9,10 @@ import { createUsageService, createUsageServiceRepository } from "@/modules/usag
|
||||
import { requestFingerprint } from "@/modules/usages/types";
|
||||
import { startPostgres } from "./postgres";
|
||||
|
||||
const testDb = await startPostgres({ through: "0001_editorial_approval_notice.sql" });
|
||||
const testDb = await startPostgres({
|
||||
through: "0001_editorial_approval_notice.sql",
|
||||
migrationsDir: "drizzle-history/pre-squash-2026-08",
|
||||
});
|
||||
|
||||
afterAll(() => testDb.stop());
|
||||
|
||||
@@ -76,7 +79,7 @@ test("0002 preserves dirty rows and reconstructs only provable legacy intents",
|
||||
const userId = randomUUID();
|
||||
const editorialId = randomUUID();
|
||||
await testDb.pool.query(
|
||||
`insert into users (id, name, email, email_verified)
|
||||
`insert into "user" (id, name, email, email_verified)
|
||||
values ($1, 'Legacy Redaktion', $2, true)`,
|
||||
[userId, `${userId}@example.com`],
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user