30 lines
931 B
SQL
30 lines
931 B
SQL
/*
|
|
Warnings:
|
|
|
|
- Added the required column `subscriptionId` to the `Account` table without a default value. This is not possible if the table is not empty.
|
|
|
|
*/
|
|
-- CreateEnum
|
|
CREATE TYPE "PType" AS ENUM ('FREE', 'STANDARD', 'PRO');
|
|
|
|
-- AlterTable
|
|
ALTER TABLE "Account" ADD COLUMN "isSubscribe" BOOLEAN NOT NULL DEFAULT false,
|
|
ADD COLUMN "subscriptionId" TEXT NOT NULL;
|
|
|
|
-- CreateTable
|
|
CREATE TABLE "Plan" (
|
|
"id" TEXT NOT NULL,
|
|
"planName" TEXT NOT NULL,
|
|
"price" INTEGER NOT NULL,
|
|
"planType" "PType" NOT NULL,
|
|
"planDesc" TEXT NOT NULL,
|
|
"planFeatures" JSONB NOT NULL,
|
|
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"updatedAt" TIMESTAMP(3) NOT NULL,
|
|
|
|
CONSTRAINT "Plan_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- AddForeignKey
|
|
ALTER TABLE "Account" ADD CONSTRAINT "Account_subscriptionId_fkey" FOREIGN KEY ("subscriptionId") REFERENCES "Plan"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|