chore: repo cleanup and prod sync tooling
- Remove stale deploy/docker-entrypoint.sh (Dockerfile copies root version) - Remove scripts/seed.ts (superseded by seed.mjs) - Add src/app/error.tsx and global-error.tsx (untracked error boundaries) - Gitignore deploy/.prod/ for synced production configs - Add scripts/sync-prod.ps1 to pull compose/env/Caddyfile from valhalla - Add scripts/apply-compose.ps1 to push compose changes and restart services
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
import postgres from "postgres";
|
||||
import { drizzle } from "drizzle-orm/postgres-js";
|
||||
import { households } from "@/modules/_core/schema";
|
||||
import { ensureDefaultCalendars } from "@/modules/calendar/server/defaults";
|
||||
import { ensureDefaultLists } from "@/modules/lists/server/defaults";
|
||||
|
||||
const client = postgres(process.env["DATABASE_URL"]!);
|
||||
const db = drizzle(client);
|
||||
|
||||
async function seed() {
|
||||
const [existing] = await db.select().from(households).limit(1);
|
||||
if (existing) {
|
||||
console.log(`Household already exists ("${existing.name}"), skipping.`);
|
||||
} else {
|
||||
await db.insert(households).values({ name: "Home" });
|
||||
console.log('Seeded household "Home".');
|
||||
}
|
||||
|
||||
await ensureDefaultCalendars();
|
||||
console.log("Ensured default calendars.");
|
||||
await ensureDefaultLists();
|
||||
console.log("Ensured default lists.");
|
||||
await client.end();
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
seed().catch((err) => {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user