- Initialize from template
npx prisma init --datasource-provider postgresql
- Setup
tsconfig.json
{
"compilerOptions" : {
"sourceMap" : true,
"outDir" : "dist",
"strict" : true,
"lib" : ["esnext"],
"esModuleInterop" : true
}
}
- In a
.env
, write your remote database URL
DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public"
- Setup a Prisma Schema
- Then, do a migration to update your database