Skip to content

Commit

Permalink
Scout model path (#381)
Browse files Browse the repository at this point in the history
* Scout model path

* ci: version bump to 0.90.1-rc-feat-scout-path.0

* Removed unique and index for username

* ci: version bump to 0.90.1-rc-feat-scout-path.1

---------

Co-authored-by: Automated Version Bump <[email protected]>
  • Loading branch information
Devorein and Automated Version Bump authored Oct 29, 2024
1 parent 8688233 commit 57130c8
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 42 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@charmverse/core",
"version": "0.90.0",
"version": "0.90.1-rc-feat-scout-path.1",
"description": "Core API for Charmverse",
"type": "commonjs",
"types": "./dist/cjs/index.d.ts",
Expand Down
21 changes: 21 additions & 0 deletions src/prisma/migrations/20241029112455_scout_path/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Warnings:
- A unique constraint covering the columns `[path]` on the table `Scout` will be added. If there are existing duplicate values, this will fail.
*/
-- DropIndex
DROP INDEX "Scout_username_idx";

-- DropIndex
DROP INDEX "Scout_username_key";

-- AlterTable
ALTER TABLE "Scout" ADD COLUMN "path" TEXT,
ALTER COLUMN "username" DROP NOT NULL;

-- CreateIndex
CREATE UNIQUE INDEX "Scout_path_key" ON "Scout"("path");

-- CreateIndex
CREATE INDEX "Scout_path_idx" ON "Scout"("path");
83 changes: 42 additions & 41 deletions src/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -1356,46 +1356,46 @@ model ProposalEvaluationPermission {
}

model ProposalEvaluation {
id String @id @default(uuid()) @db.Uuid
index Int // tells us what order
title String
type ProposalEvaluationType
completedAt DateTime?
declinedAt DateTime? // Required to keep track of when the evaluation was declined for an appealable step
snapshotId String?
snapshotExpiry DateTime?
decidedBy String? @db.Uuid
decider User? @relation(fields: [decidedBy], references: [id], onDelete: SetNull, name: "decidedBy")
proposalId String @db.Uuid
proposal Proposal @relation(fields: [proposalId], references: [id], onDelete: Cascade)
voteSettings Json?
voteId String? @unique @db.Uuid
vote Vote? @relation(fields: [voteId], references: [id], onDelete: SetNull)
actionLabels Json?
notificationLabels Json?
requiredReviews Int @default(1)
finalStep Boolean?
appealRequiredReviews Int?
appealable Boolean? @default(false)
appealedAt DateTime?
appealedBy String? @db.Uuid
appealReason String?
appealer User? @relation(fields: [appealedBy], references: [id], onDelete: SetNull, name: "appealedBy")
shareReviews Boolean? @default(false)
dueDate DateTime?
id String @id @default(uuid()) @db.Uuid
index Int // tells us what order
title String
type ProposalEvaluationType
completedAt DateTime?
declinedAt DateTime? // Required to keep track of when the evaluation was declined for an appealable step
snapshotId String?
snapshotExpiry DateTime?
decidedBy String? @db.Uuid
decider User? @relation(fields: [decidedBy], references: [id], onDelete: SetNull, name: "decidedBy")
proposalId String @db.Uuid
proposal Proposal @relation(fields: [proposalId], references: [id], onDelete: Cascade)
voteSettings Json?
voteId String? @unique @db.Uuid
vote Vote? @relation(fields: [voteId], references: [id], onDelete: SetNull)
actionLabels Json?
notificationLabels Json?
requiredReviews Int @default(1)
finalStep Boolean?
appealRequiredReviews Int?
appealable Boolean? @default(false)
appealedAt DateTime?
appealedBy String? @db.Uuid
appealReason String?
appealer User? @relation(fields: [appealedBy], references: [id], onDelete: SetNull, name: "appealedBy")
shareReviews Boolean? @default(false)
dueDate DateTime?
showAuthorResultsOnRubricFail Boolean?
rubricCriteria ProposalRubricCriteria[]
rubricAnswers ProposalRubricCriteriaAnswer[]
draftRubricAnswers DraftProposalRubricCriteriaAnswer[]
result ProposalEvaluationResult?
reviewers ProposalReviewer[]
appealReviewers ProposalAppealReviewer[]
permissions ProposalEvaluationPermission[]
proposalNotification ProposalNotification[]
reviews ProposalEvaluationReview[]
appealReviews ProposalEvaluationAppealReview[]
documentsToSign DocumentToSign[]
evaluationApprovers ProposalEvaluationApprover[]
rubricCriteria ProposalRubricCriteria[]
rubricAnswers ProposalRubricCriteriaAnswer[]
draftRubricAnswers DraftProposalRubricCriteriaAnswer[]
result ProposalEvaluationResult?
reviewers ProposalReviewer[]
appealReviewers ProposalAppealReviewer[]
permissions ProposalEvaluationPermission[]
proposalNotification ProposalNotification[]
reviews ProposalEvaluationReview[]
appealReviews ProposalEvaluationAppealReview[]
documentsToSign DocumentToSign[]
evaluationApprovers ProposalEvaluationApprover[]
@@index([proposalId])
@@index([index])
Expand Down Expand Up @@ -2791,7 +2791,8 @@ model Scout {
createdAt DateTime @default(now())
id String @id @default(uuid()) @db.Uuid
email String?
username String @unique
username String?
path String? @unique
displayName String
farcasterId Int? @unique
farcasterName String? // every user only has one farcaster account
Expand Down Expand Up @@ -2819,7 +2820,7 @@ model Scout {
PendingNftTransaction PendingNftTransaction[]
builderCardActivities BuilderCardActivity[]
@@index([username])
@@index([path])
@@index([farcasterId])
@@index([walletAddress])
}
Expand Down

0 comments on commit 57130c8

Please sign in to comment.