migration to postgres

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-26 17:42:59 +00:00
co-authored by Claude Opus 4.6
parent 7f04ecd644
commit 500a70910e
54 changed files with 4016 additions and 264 deletions
@@ -0,0 +1,24 @@
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
import { defineConfig } from 'drizzle-kit';
const envPath = resolve(__dirname, '../../../.env');
try {
const text = readFileSync(envPath, 'utf-8');
for (const line of text.split('\n')) {
const match = line.match(/^(\w+)=(.*)$/);
if (match) {
const [, key, val] = match;
if (!process.env[key!]) process.env[key!] = val!.replace(/^["']|["']$/g, '');
}
}
} catch {}
export default defineConfig({
schema: './src/schema/index.ts',
out: './migrations',
dialect: 'postgresql',
dbCredentials: {
url: process.env.POSTGRES_URL!,
},
});