Skip to content

Commit 75a9eac

Browse files
committed
fix(db): exclude the one-off-script ledger from drizzle management
script_migrations is created and read by script-migrations/index.ts, not the schema. Dev's db:push saw it as an unknown table: it prompted 'created or renamed?' (no TTY in CI, job red since the revamp landed on dev) and on --force would have DROPPED the ledger, re-running every applied one-off script. tablesFilter tells drizzle the table is not its business. Claude-Session: https://claude.ai/code/session_01CgaxNAaeD3taGdghbXn17w
1 parent 09143e1 commit 75a9eac

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

packages/db/drizzle.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@ export default {
1515
dbCredentials: {
1616
url: process.env.DATABASE_URL!,
1717
},
18+
/* script_migrations is the one-off-script ledger (script-migrations/index.ts) —
19+
deliberately managed outside drizzle. Without this filter, dev's `db:push` sees an
20+
unknown table: it prompts "created or renamed?" (no TTY in CI → red) and would DROP
21+
the ledger, making every applied one-off script re-run. */
22+
tablesFilter: ['!script_migrations'],
1823
} satisfies Config

0 commit comments

Comments
 (0)