Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scout model path #381

Merged
merged 4 commits into from
Oct 29, 2024
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
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