import { db } from "./index"; import { users } from "./schema"; import bcrypt from "bcryptjs"; import * as dotenv from "dotenv"; dotenv.config({ path: ".env.local" }); async function seed() { const hashedPassword = await bcrypt.hash("admin123", 10); await db.insert(users).values({ name: "Admin", email: "admin@admin.com", password: hashedPassword, role: "admin", }).onConflictDoNothing(); console.log("Admin user created."); process.exit(0); } seed().catch(err => { console.error(err); process.exit(1); });