prevent startup if migrating not possible

This commit is contained in:
Niki Wix Skaarup 2025-04-06 02:29:01 +02:00
parent f66fdc34f1
commit 24d34597ff
Signed by: nikiskaarup
GPG key ID: FC2F1B116F6E788C
3 changed files with 3 additions and 3 deletions

View file

@ -35,4 +35,4 @@ COPY --from=install /temp/prod/node_modules node_modules
COPY --from=prerelease /app/ . COPY --from=prerelease /app/ .
# run the app # run the app
ENTRYPOINT [ "bun", "run", "start" ] ENTRYPOINT [ "bun", "start" ]

View file

@ -9,7 +9,7 @@
"generate": "bunx --bun drizzle-kit generate --config=./drizzle.config.ts", "generate": "bunx --bun drizzle-kit generate --config=./drizzle.config.ts",
"studio": "bunx --bun drizzle-kit studio --config=./drizzle.config.ts", "studio": "bunx --bun drizzle-kit studio --config=./drizzle.config.ts",
"up": "drizzle-kit up --config=./drizzle.config.ts", "up": "drizzle-kit up --config=./drizzle.config.ts",
"start": "bun run src/server.ts", "start": "bun migrate && bun src/server.ts",
"dev": "bun run --watch src/server.ts", "dev": "bun run --watch src/server.ts",
"lint": "oxlint .", "lint": "oxlint .",
"format": "prettier --write ." "format": "prettier --write ."

View file

@ -5,7 +5,7 @@ import { drizzle } from 'drizzle-orm/bun-sqlite';
import { createWrappedTimer } from '../wrapped-timer'; import { createWrappedTimer } from '../wrapped-timer';
function initDb() { function initDb() {
global.db.exec('PRAGMA journal_mode = delete'); // global.db.exec('PRAGMA journal_mode = delete');
global.db.exec('PRAGMA journal_mode = WAL'); global.db.exec('PRAGMA journal_mode = WAL');
global.db.exec('PRAGMA synchronous = NORMAL'); global.db.exec('PRAGMA synchronous = NORMAL');
global.db.exec('PRAGMA auto_vacuum = INCREMENTAL'); global.db.exec('PRAGMA auto_vacuum = INCREMENTAL');