NestJS, Prisma, Postgres
- set env
- env > DATABASE_URL="postgresql://:@:/<db_name>?schema=<schema_name>"
-
yarn start:dev | yarn start:prod
-
nest g module <module_name>
-
nest g service <service_name>
- Or generate resource (module, service, controller/resolver)
-
nest g resource <resource_name>
- make change schema.prisma
- dev/local :
-
npx prisma migrate dev
- prod :
-
npx prisma migrate deploy
- reset db dev and run seed
-
npx prisma migrate reset
- after make change schema.prisma
-
npx prisma generate
- output on "../ERD.png"
- gui table on browser
-
npx prisma studio