import postgres from "postgres"; import { drizzle } from "drizzle-orm/postgres-js"; import { households } from "@/modules/_core/schema"; 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 client.end(); } seed().catch((err) => { console.error(err); process.exit(1); });