ReviewOS

also looking at this

stacks/bun-query-builder

fix(migrate)!: run the directories executeMigration was given

#1138
Merged glennmichael123 wants to merge fix/execute-migration-dirs into main
7 files +348 -49
packages/bun-query-builder/test/migrations.handwritten-lifecycle.test.tsmodified+3-3
Changes to packages/bun-query-builder/test/migrations.handwritten-lifecycle.test.ts
@@ -211,7 +211,7 @@ describe('the runner tells authored migrations from generated ones', () => {
211211 const authored = join(migrationsDir(), '9000000001-alter-farms-table.sql')
212212 writeFileSync(authored, 'ALTER TABLE farms ADD COLUMN steward TEXT;\n')
213213
214 await executeMigration(modelsDir)
214 await executeMigration()
215215
216216 expect(existsSync(authored)).toBe(true)
217217 expect(columnsOf('farms')).toContain('steward')
@@ -221,7 +221,7 @@ describe('the runner tells authored migrations from generated ones', () => {
221221 it('does not replay it on the next run, so it cannot fail as a duplicate', async () => {
222222 // Recorded means run-once. Replaying an ADD COLUMN is the `duplicate
223223 // column name` failure that takes a whole migrate run down with it.
224 await executeMigration(modelsDir)
224 await executeMigration()
225225
226226 expect(existsSync(join(migrationsDir(), '9000000001-alter-farms-table.sql'))).toBe(true)
227227 expect(columnsOf('farms')).toContain('steward')
@@ -234,7 +234,7 @@ describe('the runner tells authored migrations from generated ones', () => {
234234 const generated = join(migrationsDir(), '9000000002-alter-farms-table.sql')
235235 writeFileSync(generated, `${GENERATED_MARKER}\nALTER TABLE farms ADD COLUMN drainage TEXT;\n`)
236236
237 await executeMigration(modelsDir)
237 await executeMigration()
238238
239239 expect(existsSync(generated)).toBe(true)
240240 expect(columnsOf('farms')).toContain('drainage')