mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-17 18:21:28 +10:00
release: v4.1.0
This commit is contained in:
@ -0,0 +1,29 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- A unique constraint covering the columns `[userId,id]` on the table `Secrets` will be added. If there are existing duplicate values, this will fail.
|
||||
|
||||
*/
|
||||
-- CreateTable
|
||||
CREATE TABLE "Statistics" (
|
||||
"id" TEXT NOT NULL,
|
||||
"views" INTEGER NOT NULL DEFAULT 0,
|
||||
"downloads" INTEGER NOT NULL DEFAULT 0,
|
||||
"resumeId" TEXT NOT NULL,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "Statistics_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Statistics_resumeId_key" ON "Statistics"("resumeId");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Statistics_resumeId_id_key" ON "Statistics"("resumeId", "id");
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "Secrets_userId_id_key" ON "Secrets"("userId", "id");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Statistics" ADD CONSTRAINT "Statistics_resumeId_fkey" FOREIGN KEY ("resumeId") REFERENCES "Resume"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
@ -45,21 +45,36 @@ model Secrets {
|
||||
resetToken String? @unique
|
||||
userId String @unique
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@unique([userId, id])
|
||||
}
|
||||
|
||||
model Resume {
|
||||
id String @id @default(cuid())
|
||||
id String @id @default(cuid())
|
||||
title String
|
||||
slug String
|
||||
data Json @default("{}")
|
||||
visibility Visibility @default(private)
|
||||
locked Boolean @default(false)
|
||||
data Json @default("{}")
|
||||
visibility Visibility @default(private)
|
||||
locked Boolean @default(false)
|
||||
statistics Statistics?
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([userId, id])
|
||||
@@unique([userId, slug])
|
||||
@@index(fields: [userId])
|
||||
}
|
||||
|
||||
model Statistics {
|
||||
id String @id @default(cuid())
|
||||
views Int @default(0)
|
||||
downloads Int @default(0)
|
||||
resumeId String @unique
|
||||
resume Resume @relation(fields: [resumeId], references: [id], onDelete: Cascade)
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@unique([resumeId, id])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user