Create a Database
Just create a database with your preferred tool. Then, generate the connection string with the following format:
code
Or, with this bash script by copying and pasting the following code into your terminal:
bash
Note. Make sure you have psql
installed and have permission to create databases in your terminal.
Then, run the bash script: (change mydb
with your preferred database name)
bash
Set Variables
Add the connection string to your .env
file:
.env
Run Migrations
After setting up the environment variables, run the following command to deploy the migration:
bash
If you want to create or update the database schema at prisma/schema.prisma
, run the following command to generate the migration:
bash