Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions appStartUp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -eo pipefail

export DATABASE_URL=$(echo -e ${DATABASE_URL})

echo "Database - running migrations."
npx prisma migrate deploy

echo "Starting resource-api-v6."
npm start
3 changes: 2 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ RUN npm install -g pnpm@10.33.2
RUN pnpm install --frozen-lockfile
RUN pnpm lint
RUN pnpm lint:fix
RUN chmod +x appStartUp.sh

CMD pnpm start
CMD [ "./appStartUp.sh" ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- CreateIndex
CREATE INDEX idx_resource_created_at ON resources."Resource"("createdAt" DESC);
31 changes: 16 additions & 15 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ generator client {
}

generator externalClient {
provider = "prisma-client-js"
output = "../packages/resources-prisma-client"
provider = "prisma-client-js"
output = "../packages/resources-prisma-client"
binaryTargets = ["native", "debian-openssl-3.0.x"]
}

Expand All @@ -14,15 +14,15 @@ datasource db {
}

model ResourceRole {
id String @id @default(uuid())
id String @id @default(uuid())
name String
nameLower String
fullReadAccess Boolean
fullWriteAccess Boolean
isActive Boolean
selfObtainable Boolean
legacyId Int?
createdAt DateTime @default(now())
createdAt DateTime @default(now())
createdBy String
updatedAt DateTime? @updatedAt
updatedBy String?
Expand All @@ -37,17 +37,17 @@ model ResourceRole {
}

model Resource {
id String @id @default(uuid())
challengeId String
memberId String
memberHandle String
roleId String
legacyId Int?
phaseChangeNotifications Boolean? @default(true)
createdAt DateTime @default(now())
createdBy String
updatedAt DateTime? @updatedAt
updatedBy String?
id String @id @default(uuid())
challengeId String
memberId String
memberHandle String
roleId String
legacyId Int?
phaseChangeNotifications Boolean? @default(true)
createdAt DateTime @default(now())
createdBy String
updatedAt DateTime? @updatedAt
updatedBy String?

resourceRole ResourceRole @relation(fields: [roleId], references: [id])

Expand All @@ -57,6 +57,7 @@ model Resource {
@@index([roleId], map: "resource-roleId-index")
@@index([memberId, challengeId], map: "resource-memberIdChallengeId-index")
@@index([createdAt(sort: Desc), memberId], map: "idx_resource_created_member")
@@index([createdAt(sort: Desc)], map: "idx_resource_created_at")
}

model ResourceRolePhaseDependency {
Expand Down
Loading