For prisma setup
-
Install dependency npm install
-
Check prisma CLI is working npx prisma or install new package prisma CLI : (Dev dependency) npm i prisma -D
-
Initialize prisma project npx prisma init
It will create the prisma folder in root level containing schema.prisma file We will create the db model in schema.prisma file to interact with db Also create the .env file for application entrainment DATABASE_URL
-
Go to VS code extension and add prisma extension for .prisma file
-
Write your db table schema into prisma/schema.prisma file
-
To migrate db
npx prisma migrate dev --name init
It will create migrations folder with sql .files
-
To view database npx prisma studio