This commit is contained in:
talorr
2026-03-27 03:36:08 +03:00
parent 8a97ce6d54
commit cda36918e8
225 changed files with 35641 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
-- CreateEnum
CREATE TYPE "SubscriptionStatus" AS ENUM ('active', 'expired', 'canceled');
-- AlterTable
ALTER TABLE "UserBotAccess"
ADD COLUMN "status" "SubscriptionStatus" NOT NULL DEFAULT 'active',
ADD COLUMN "startsAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "expiresAt" TIMESTAMP(3),
ADD COLUMN "notes" TEXT;
-- Backfill
UPDATE "UserBotAccess"
SET "startsAt" = COALESCE("grantedAt", CURRENT_TIMESTAMP)
WHERE "startsAt" IS NULL;