mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-18 10:41:56 +10:00
30 lines
968 B
SQL
30 lines
968 B
SQL
/*
|
|
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;
|