import { defineConfig } from 'drizzle-kit'; // Spike configuration (#216). Credentials come from the environment rather than // this file — the same rule the rest of the repo follows, and this one points at // a developer's local database, not a deployed one. // // DRIZZLE_DATABASE_URL=postgres://redefined_local:redefined_local@localhost:55500/redefined_local export default defineConfig({ dialect: 'postgresql', schema: './src/db-drizzle/schema.ts', // `drizzle-kit pull` writes its output here, so this points at the directory // the application actually imports from. The spike pulled into ./drizzle and // copied the file into src/ by hand, and that copy drifted exactly as // predicted — not because anyone re-pulled, but because #222 added // item_drafts and upload_links and the mirror was never refreshed. Nothing // noticed for a week. Pulling in place removes the copy step that made that // possible. See #217. // // If #219 ever chooses generated migrations, they also land in `out`, and // this will need splitting then. It is a queries-only mirror today. out: './src/db-drizzle', // pgmigrations is node-pg-migrate's own bookkeeping. It is not part of the // application's schema and has no business in a generated model of it. tablesFilter: ['!pgmigrations'], dbCredentials: { url: process.env.DRIZZLE_DATABASE_URL ?? '' } });