diff --git a/package.json b/package.json index 97a68b18..7df38bf1 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/prisma/migrations/20241029112455_scout_path/migration.sql b/src/prisma/migrations/20241029112455_scout_path/migration.sql new file mode 100644 index 00000000..5fa83d4e --- /dev/null +++ b/src/prisma/migrations/20241029112455_scout_path/migration.sql @@ -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"); diff --git a/src/prisma/schema.prisma b/src/prisma/schema.prisma index 0d8f433d..7b480177 100644 --- a/src/prisma/schema.prisma +++ b/src/prisma/schema.prisma @@ -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]) @@ -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 @@ -2819,7 +2820,7 @@ model Scout { PendingNftTransaction PendingNftTransaction[] builderCardActivities BuilderCardActivity[] - @@index([username]) + @@index([path]) @@index([farcasterId]) @@index([walletAddress]) }