Add API routes

This commit is contained in:
NeilClack
2026-03-25 17:26:09 -05:00
parent 7d211ba6d8
commit e563a66dc7
12 changed files with 1646 additions and 13 deletions
@@ -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;
+11
View File
@@ -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[]
}