diff --git a/Dockerfile b/Dockerfile index 803e914..d615b1e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM oven/bun:1.3.13 AS build WORKDIR /app COPY package.json bun.lock ./ +COPY patches ./patches RUN bun install --frozen-lockfile COPY . . diff --git a/bin.ts b/bin.ts index 7d35551..67bb8bc 100644 --- a/bin.ts +++ b/bin.ts @@ -11,6 +11,7 @@ const main = defineCommand({ version, description: 'Fullstack server binary (default subcommand: serve)', }, + default: 'serve', subCommands: { serve: () => import('./src/cli/serve').then((m) => m.default), migrate: () => import('./src/cli/migrate').then((m) => m.default), diff --git a/drizzle/.gitkeep b/drizzle/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/cli/migrate.ts b/src/cli/migrate.ts index 9e38358..a79e870 100644 --- a/src/cli/migrate.ts +++ b/src/cli/migrate.ts @@ -2,6 +2,7 @@ import { existsSync } from 'node:fs' import { defineCommand } from 'citty' const MIGRATIONS_FOLDER = './drizzle' +const JOURNAL = `${MIGRATIONS_FOLDER}/meta/_journal.json` export default defineCommand({ meta: { @@ -9,8 +10,8 @@ export default defineCommand({ description: 'Apply pending database migrations from ./drizzle', }, async run() { - if (!existsSync(MIGRATIONS_FOLDER)) { - console.log(`No ${MIGRATIONS_FOLDER} directory; nothing to apply (use db:push in dev).`) + if (!existsSync(JOURNAL)) { + console.log(`No migrations found at ${MIGRATIONS_FOLDER} (run \`bun run db:generate\` to create some).`) return }