Add API routes
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Proclamation" ADD COLUMN "subscriptionLevelId" INTEGER NOT NULL DEFAULT 1;
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "SubscriptionLevel" (
|
||||
"id" SERIAL NOT NULL,
|
||||
"name" TEXT NOT NULL,
|
||||
"description" TEXT,
|
||||
|
||||
CONSTRAINT "SubscriptionLevel_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE INDEX "Proclamation_subscriptionLevelId_idx" ON "Proclamation"("subscriptionLevelId");
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Proclamation" ADD CONSTRAINT "Proclamation_subscriptionLevelId_fkey" FOREIGN KEY ("subscriptionLevelId") REFERENCES "SubscriptionLevel"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
@@ -120,6 +120,10 @@ model Proclamation {
|
||||
category ProclamationCategory @relation(fields: [categoryId], references: [id])
|
||||
price Float @default(0.99)
|
||||
userProclamations UserProclamations[]
|
||||
subscriptionLevelId Int @default(1)
|
||||
subscriptionLevel SubscriptionLevel @relation(fields: [subscriptionLevelId], references: [id])
|
||||
|
||||
@@index(subscriptionLevelId)
|
||||
}
|
||||
|
||||
model UserProclamations {
|
||||
@@ -159,3 +163,10 @@ model LicenseKey {
|
||||
userId String
|
||||
user User @relation(fields: [userId], references: [id])
|
||||
}
|
||||
|
||||
model SubscriptionLevel {
|
||||
id Int @id @default(autoincrement())
|
||||
name String
|
||||
description String?
|
||||
proclamations Proclamation[]
|
||||
}
|
||||
Reference in New Issue
Block a user