File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ datasource db {
66
66
commented-out PostgreSQL ` DATABASE_URL ` there already. Depending on
67
67
your setup, you may need to modify the URL.
68
68
3 . Update ` .env.test.local ` as well to use PostgreSQL in your test runs.
69
+ (It has to point to different database than your ` .env.local ` )
69
70
4 . Delete the ` db/migrations ` folder
70
71
5 . Run ` blitz prisma migrate dev ` . This command will create the database
71
72
(if it does not already exist) and tables based on your schema.
Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ services:
55
55
ports :
56
56
- " 5432:5432"
57
57
58
+ db-test :
59
+ image : postgres:latest
60
+ env_file : ./.env.test.local
61
+ ports :
62
+ - 5433:5432
63
+
58
64
volumes :
59
65
data :
60
66
` ` `
@@ -71,6 +77,10 @@ POSTGRES_DB=your_database_name
71
77
Given these values, update `DATABASE_URL` in `.env.local` to something
72
78
similar like
73
79
` postgresql://your_user:your_password@localhost:5432/your_database_name`
80
+ and in `.env.test.local` to
81
+ ` postgresql://your_user:your_password@localhost:5433/your_database_name`
82
+
83
+ Please note that test database is using port `5433` instead of `5432`
74
84
75
85
3. Modify your `package.json` to start the database before Blitz
76
86
You can’t perform that action at this time.
0 commit comments