diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..84215f1 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +DATABASE_URL="postgresql://db_username:db_user_pwd@localhost:db_port/db?schema=db_schema" \ No newline at end of file diff --git a/README.md b/README.md index 9369d4e..ae713c3 100644 --- a/README.md +++ b/README.md @@ -42,3 +42,20 @@ To check for code issues using [ESLint](https://eslint.org/), run: ```bash npm run lint ``` + +To run run prisma, you have two steps: + +- First is to generate the schema in the database: + - To just generate the database and not create a migration: + ```bash + npx prisma db push + ``` + + - To generate the database and also create a migration: + ```bash + npx prisma migrate dev --name init + ``` +- Second is to generate the prisma client. This step is required also after every pull because prisma client is stored in the `node_modules` folder which is in the `.gitignore` +```bash +npx prisma generate +```