Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions scripts/seed-sudan-cities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,23 @@
* see fallback below).
*/

import { config } from "dotenv";
config();
// CRITICAL ORDER: load .env via the side-effect entry point BEFORE any
// other module (especially @/lib/db) is imported. ES module imports are
// hoisted and execute in source order; if @/lib/db is imported first,
// its module-level `createPrismaClient()` runs against an empty
// process.env and the adapter can't find DATABASE_URL.
import "dotenv/config";

import {
PrismaClient,
PropertyType,
Amenity,
Highlight,
CancellationPolicy,
} from "@prisma/client";
import bcrypt from "bcryptjs";

const prisma = new PrismaClient();
// Reuse the app's PrismaClient so we get the same Neon/PG adapter
// selection and connection pool config the running app uses.
import { db as prisma } from "@/lib/db";

const DEMO_PASSWORD = "123456";

Expand Down
Loading