* 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
22 lines
700 B
SQL
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;
|