Skip to content

Commit f803a8e

Browse files
committed
fix(db): the code-migration runner skips test files
The conversation migration ships with a test beside it, and the runner treated every numbered .ts file in the folder as a migration, so migrate:deploy failed on the test. Test files are skipped now.
1 parent 16b3000 commit f803a8e

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎packages/db/src/code-migrations/migrate.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ export async function runCodeMigrations(env: CodeMigrationEnv) {
2222
.readdirSync(MIGRATIONS_DIR)
2323
.filter((file) => {
2424
const version = file.split('-')[0];
25+
// A migration's test sits beside it and must not run as a migration.
2526
return (
2627
!Number.isNaN(Number.parseInt(version ?? '', 10)) &&
27-
file.endsWith('.ts')
28+
file.endsWith('.ts') &&
29+
!file.endsWith('.test.ts')
2830
);
2931
})
3032
.sort((a, b) => {

0 commit comments

Comments
 (0)