Prisma JS
hello everyone, recently I wanted migrate my back-end ORM (TypeORM) to primas js, but was dificult, why?...
because I was just learning
My back-end It is made in Nest js + TypeORM, the idea is learn for me
How Migrate?
Install Prisma
Terminal
npm install prisma --save-dev Terminal
npm install @prisma/client --saveFor
create folder prisma run the next command, after a few seconds you can see in the folder. Terminal
npx prisma initIn your folder root you can see in the folder prisma, inside create folder
migrations and file seed.tsSchema.prisma
automatically inside this file required enviroment
DATABASE_URL , add in your .env.default prisma look .env in your directory root
Packakge.json
add the next line in your
package.json and runPLAIN
"prisma:pull": "prisma db pull"in case of your enviroment file be in another path
PLAIN
"prisma:pull": "dotenv -e ./environment/.env.development -- prisma db pull",what does this line do?
this linea do introspect your database and create or update your
prisma.schema file. Terminal
npm run prisma:pullthe result in my case is this.
2.4k
Related Articles
Discussion
3 commentsShare your thoughts...

