Open source CapCut alternative.
TypeScript
add migrations
David Le32ae67c7967b
diff --git a/site/prisma/migrations/20260621125852/migration.sql b/site/prisma/migrations/20260621125852/migration.sqlnew file mode 100644index 00000000..187b99f3--- /dev/null+++ b/site/prisma/migrations/20260621125852/migration.sql@@ -0,0 +1,23 @@+-- CreateTable+CREATE TABLE "credit_auto_reload" (+ "id" TEXT NOT NULL,+ "userId" TEXT NOT NULL,+ "enabled" BOOLEAN NOT NULL DEFAULT false,+ "thresholdMicros" BIGINT NOT NULL DEFAULT 0,+ "amountMicros" BIGINT NOT NULL DEFAULT 0,+ "stripeCustomerId" TEXT,+ "stripePaymentMethodId" TEXT,+ "status" TEXT NOT NULL DEFAULT 'idle',+ "lastChargeAt" TIMESTAMP(3),+ "lastError" TEXT,+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" TIMESTAMP(3) NOT NULL,++ CONSTRAINT "credit_auto_reload_pkey" PRIMARY KEY ("id")+);++-- CreateIndex+CREATE UNIQUE INDEX "credit_auto_reload_userId_key" ON "credit_auto_reload"("userId");++-- AddForeignKey+ALTER TABLE "credit_auto_reload" ADD CONSTRAINT "credit_auto_reload_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE;diff --git a/site/prisma/migrations/20260621132105/migration.sql b/site/prisma/migrations/20260621132105/migration.sqlnew file mode 100644index 00000000..428cf019--- /dev/null+++ b/site/prisma/migrations/20260621132105/migration.sql@@ -0,0 +1,26 @@+-- CreateTable+CREATE TABLE "pro_subscription" (+ "id" TEXT NOT NULL,+ "userId" TEXT NOT NULL,+ "stripeCustomerId" TEXT,+ "stripeSubscriptionId" TEXT,+ "status" TEXT NOT NULL DEFAULT 'incomplete',+ "planKey" TEXT NOT NULL DEFAULT 'pro',+ "monthlyAllowanceMicros" BIGINT NOT NULL DEFAULT 0,+ "currentPeriodStart" TIMESTAMP(3),+ "currentPeriodEnd" TIMESTAMP(3),+ "cancelAtPeriodEnd" BOOLEAN NOT NULL DEFAULT false,+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,+ "updatedAt" TIMESTAMP(3) NOT NULL,++ CONSTRAINT "pro_subscription_pkey" PRIMARY KEY ("id")+);++-- CreateIndex+CREATE UNIQUE INDEX "pro_subscription_userId_key" ON "pro_subscription"("userId");++-- CreateIndex+CREATE UNIQUE INDEX "pro_subscription_stripeSubscriptionId_key" ON "pro_subscription"("stripeSubscriptionId");++-- AddForeignKey+ALTER TABLE "pro_subscription" ADD CONSTRAINT "pro_subscription_userId_fkey" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE CASCADE;diff --git a/site/prisma/migrations/20260621143906_es/migration.sql b/site/prisma/migrations/20260621143906_es/migration.sqlnew file mode 100644index 00000000..46c25a59--- /dev/null+++ b/site/prisma/migrations/20260621143906_es/migration.sql@@ -0,0 +1,14 @@+/*+ Warnings:++ - A unique constraint covering the columns `[stripeCustomerId]` on the table `user` will be added. If there are existing duplicate values, this will fail.++*/+-- AlterTable+ALTER TABLE "credit_auto_reload" ADD COLUMN "chargingPaymentIntentId" TEXT;++-- AlterTable+ALTER TABLE "user" ADD COLUMN "stripeCustomerId" TEXT;++-- CreateIndex+CREATE UNIQUE INDEX "user_stripeCustomerId_key" ON "user"("stripeCustomerId");