File tree Expand file tree Collapse file tree 3 files changed +4
-1
lines changed
internal-packages/database
migrations/20250729155415_runtime_environment_add_organization_id_index Expand file tree Collapse file tree 3 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ pnpm run docker
23
23
### How to add a new index on a large table
24
24
25
25
1 . Modify the Prisma.schema with a single index change (no other changes, just one index at a time)
26
- 2 . Create a Prisma migration using ` cd internal-packages/database && pnpm run db:migrate:dev -- create-only `
26
+ 2 . Create a Prisma migration using ` cd internal-packages/database && pnpm run db:migrate:dev: create `
27
27
3 . Modify the SQL file: add IF NOT EXISTS to it and CONCURRENTLY:
28
28
29
29
``` sql
Original file line number Diff line number Diff line change
1
+ -- CreateIndex
2
+ CREATE INDEX CONCURRENTLY IF NOT EXISTS " RuntimeEnvironment_organizationId_idx" ON " RuntimeEnvironment" (" organizationId" );
Original file line number Diff line number Diff line change @@ -300,6 +300,7 @@ model RuntimeEnvironment {
300
300
@@unique ([projectId , shortcode ] )
301
301
@@index ([parentEnvironmentId ] )
302
302
@@index ([projectId ] )
303
+ @@index ([organizationId ] )
303
304
}
304
305
305
306
enum RuntimeEnvironmentType {
You can’t perform that action at this time.
0 commit comments