Prisma Basics:

1️⃣ Migration: Prisma migration is relatable with database and sql query.
2️⃣ Generation: Prisma generation is relatable with prisma client.

Useful Commands:

migrate and generate commands:

npx prisma migrate dev
√ Are you sure you want create and apply this migration? ... yes
√ Enter a name for the new migration: ... enter_a_name

migrate so that previous duplicate migrations are deleted:

npx prisma migrate dev --name migration_name
✔ Do you want to continue? All data will be lost. (y/N) y

generate prisma client:

npx prisma generate

run the server:

npx ts-node file_name.ts

Browse prisma studio:

npx prisma studio

For team collaboration:

to pull the latest changes from the database schema:

npx prisma db pull

to push the latest changes to the database schema:

npx prisma db push