Skip to content

Commit 330024a

Browse files
committed
Added a RuntimeEnvironment organizationId index
1 parent 8ee22f0 commit 330024a

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

internal-packages/database/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pnpm run docker
2323
### How to add a new index on a large table
2424

2525
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`
2727
3. Modify the SQL file: add IF NOT EXISTS to it and CONCURRENTLY:
2828

2929
```sql
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-- CreateIndex
2+
CREATE INDEX CONCURRENTLY IF NOT EXISTS "RuntimeEnvironment_organizationId_idx" ON "RuntimeEnvironment" ("organizationId");

internal-packages/database/prisma/schema.prisma

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ model RuntimeEnvironment {
300300
@@unique([projectId, shortcode])
301301
@@index([parentEnvironmentId])
302302
@@index([projectId])
303+
@@index([organizationId])
303304
}
304305

305306
enum RuntimeEnvironmentType {

0 commit comments

Comments
 (0)