Skip to content

Commit 451a1ad

Browse files
t3dotggclaude
andcommitted
fix(server): migrate-dev-db re-checks for a live server right before the db swap
Co-Authored-By: Claude Fable 5 <[email protected]>
1 parent 0a7b297 commit 451a1ad

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎apps/server/scripts/migrate-dev-db.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,9 @@ export const runMigrateDevDb = Effect.fn("runMigrateDevDb")(function* (
464464
);
465465

466466
yield* Console.log(`Compacting into ${databasePath}...`);
467+
// Re-check right before the swap: a dev server started while the
468+
// snapshot was migrating and pruning must not lose its database.
469+
yield* ensureNotInUse(databasePath);
467470
yield* removeDatabaseFiles(databasePath);
468471
yield* Effect.gen(function* () {
469472
const sql = yield* SqlClient.SqlClient;

0 commit comments

Comments
 (0)