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: CONTRIBUTING.md
+11-3Lines changed: 11 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -230,13 +230,21 @@ pnpm run db:studio
230
230
cd packages/database
231
231
```
232
232
233
-
3. Create and apply the migrations
233
+
3. Create a migration
234
234
235
235
```
236
-
pnpm run db:migrate:dev
236
+
pnpm run db:migrate:dev:create
237
237
```
238
238
239
-
This creates a migration file and executes the migrations against your database and applies changes to the database schema(s)
239
+
This creates a migration file. Check the migration file does only what you want. If you're adding any database indexes they must use `CONCURRENTLY`, otherwise they'll lock the table when executed.
240
+
241
+
4. Run the migration.
242
+
243
+
```
244
+
pnpm run db:migrate:deploy
245
+
pnpm run generate
246
+
```
247
+
This executes the migrations against your database and applies changes to the database schema(s), and then regenerates the Prisma client.
240
248
241
249
4. Commit generated migrations as well as changes to the schema.prisma file
242
250
5. If you're using VSCode you may need to restart the Typescript server in the webapp to get updated type inference. Open a TypeScript file, then open the Command Palette (View > Command Palette) and run `TypeScript: Restart TS server`.
0 commit comments