-- CreateTable
CREATE TABLE "public"."subscription_plans" (
    "id" TEXT NOT NULL,
    "name" TEXT NOT NULL,
    "price" TEXT NOT NULL,
    "period" TEXT NOT NULL,
    "product_id" TEXT NOT NULL,
    "paypal_plan_id" TEXT NOT NULL,
    "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" TIMESTAMP(3) NOT NULL,
    "userId" TEXT NOT NULL,

    CONSTRAINT "subscription_plans_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE INDEX "subscription_plans_createdAt_idx" ON "public"."subscription_plans"("createdAt");

-- CreateIndex
CREATE INDEX "subscription_plans_name_idx" ON "public"."subscription_plans"("name");

-- CreateIndex
CREATE INDEX "subscription_plans_price_idx" ON "public"."subscription_plans"("price");

-- CreateIndex
CREATE INDEX "subscription_plans_period_idx" ON "public"."subscription_plans"("period");

-- CreateIndex
CREATE INDEX "subscription_plans_product_id_idx" ON "public"."subscription_plans"("product_id");

-- CreateIndex
CREATE INDEX "subscription_plans_paypal_plan_id_idx" ON "public"."subscription_plans"("paypal_plan_id");

-- AddForeignKey
ALTER TABLE "public"."subscription_plans" ADD CONSTRAINT "subscription_plans_userId_fkey" FOREIGN KEY ("userId") REFERENCES "public"."users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
