pcbjam/web/apps/server/src/db/migrate.ts
Gergő Törcsvári 735e5aa8e9
feat(web): checkpoint web app init
- frontend (Vite/React) + server (Hono/Drizzle) scaffold under web/
- eeschema WASM embind kicadOpenFile hook + programmatic open-flow
- skip KiCad first-run setup wizard by seeding default config in preRun
- dev: auto-sync output/ WASM artifacts into tests/apps/kicad via link-wasm

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 20:32:19 +02:00

21 lines
596 B
TypeScript

import * as path from "node:path";
import { fileURLToPath } from "node:url";
import { migrate } from "drizzle-orm/node-postgres/migrator";
import { db, pool } from "./index.js";
import { seedDefaultOwner } from "./seed.js";
const here = path.dirname(fileURLToPath(import.meta.url));
async function main() {
await migrate(db, {
migrationsFolder: path.resolve(here, "../../drizzle"),
});
const ownerId = await seedDefaultOwner();
console.log(`migrations applied; default owner: ${ownerId}`);
await pool.end();
}
main().catch((err) => {
console.error(err);
process.exit(1);
});