The deploy pipeline was building the app image with only `dist/` inside and rsync'ing only `dist package*.json docker-compose.yml Dockerfile` to the server. The drizzle migrations folder never reached prod, so new schema changes (Wave 1 added `tier`, `boosty_verified_at`, and 5 tables) silently went missing. App requests then failed with "column does not exist" errors at runtime. Wave-1 CI step `npm run db:migrate` ran against the in-job postgres service, not against prod — so it never helped. Changes: - src/db/migrate.ts -> src/db/migrate.mjs: plain JS so the prod image can run it via `node` without devDependencies (no tsx needed). - Dockerfile: COPY drizzle and src/db/migrate.mjs into the image, prepend `node ./src/db/migrate.mjs &&` to the CMD. Container fails to start if migrations fail — better than serving with stale schema. - .github/workflows/deploy.yml: rsync now also sends `drizzle` and `src` so the build context on the server has what the Dockerfile COPYs reference. - package.json: `db:migrate` script switched to `node src/db/migrate.mjs`. - eslint.config.mjs: enable node globals for the migrator script. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
31 lines
676 B
JavaScript
31 lines
676 B
JavaScript
import js from "@eslint/js";
|
|
import tseslint from "typescript-eslint";
|
|
import astro from "eslint-plugin-astro";
|
|
import globals from "globals";
|
|
|
|
export default [
|
|
{ ignores: ["dist/**", ".astro/**", "node_modules/**", "src/env.d.ts", "debug-open5e.mjs"] },
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
...astro.configs.recommended,
|
|
{
|
|
files: ["public/sw.js"],
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.serviceworker,
|
|
},
|
|
},
|
|
rules: {
|
|
"@typescript-eslint/no-unused-vars": "off",
|
|
},
|
|
},
|
|
{
|
|
files: ["src/db/migrate.mjs"],
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node,
|
|
},
|
|
},
|
|
},
|
|
];
|