You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -90,7 +90,7 @@ yarn dev:rollup
90
90
91
91
#### Database migrations
92
92
93
-
Database migrations are run automatically when the _production_ app starts. In _development_, you'll have to run them manually:
93
+
Database migrations are run automatically when a production build of the app starts. In _development_, you'll have to run them manually:
94
94
95
95
```sh
96
96
yarn db:migrate:dev
@@ -100,6 +100,18 @@ Migrations are located in `db-migrations/`. Write SQL or JS migrations and follo
100
100
101
101
For detailed instructions, please refer to the [postgres-migrations](https://github.com/thomwright/postgres-migrations) documentation.
102
102
103
+
⚠️ On Vercel environments like "preview" and "production", "production" build are started which means that database migrations are executed.
104
+
Since all environments are sharing the same database, it means that a database migration executing on 1 database could be disruptive to
105
+
other preview deployments. For example adding a column to the schema would be disruptive, since other preview deployments would try to
106
+
remove it (since the column is not yet in the schema). To prevent any problems on preview deployments, we have a second database that
107
+
is special for development and that must be used if you are working on a branch that brings in database changes. You can configure
108
+
this in the Vercel environment variables by copy-pasting the environment variables found in the [visualization-tool-postgres-dev][]
109
+
storage (see `.env.local` tab), and copy paste them as [environment variables](https://vercel.com/ixt/visualization-tool/settings/environment-variables)
110
+
in the visualisation-project. Take care of scoping the new environment variables to the preview branch you are working on.
111
+
After merging the branch, you can delete the environment variables scoped to the branch.
0 commit comments