Files
calendar/packages/prisma/migrations/20240425121424_platform_billing/migration.sql
T
ErikandGitHub 1cfd2f7053 feat: Billing Service (#14756)
* chore: Billing Service

* chore: others

* chore: don't type

* chore: typo

* chore: use proper wh secret

* chore: updates

* chore: lockfile

* chore: docs and comment out

* chore: updates and include plan

* chore: config

* chore: bring back alias

* chore: update lockfile

* chore: refactor

* chore: default none plan in db

* chore: read from env vars

* chore: feedback

* chore: remove json config

* chore: proper type
2024-04-30 20:02:04 +00:00

22 lines
700 B
SQL

-- CreateTable
CREATE TABLE "PlatformBilling" (
"id" INTEGER NOT NULL,
"customerId" TEXT NOT NULL,
"plan" TEXT NOT NULL DEFAULT 'none',
"subscriptionId" TEXT,
"billingCycleStart" INTEGER,
"billingCycleEnd" INTEGER,
"overdue" BOOLEAN DEFAULT false,
CONSTRAINT "PlatformBilling_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "PlatformBilling_id_key" ON "PlatformBilling"("id");
-- CreateIndex
CREATE UNIQUE INDEX "PlatformBilling_customerId_key" ON "PlatformBilling"("customerId");
-- AddForeignKey
ALTER TABLE "PlatformBilling" ADD CONSTRAINT "PlatformBilling_id_fkey" FOREIGN KEY ("id") REFERENCES "Team"("id") ON DELETE CASCADE ON UPDATE CASCADE;