-- DropIndex
DROP INDEX "subscription_addons_subscription_id_plan_addon_catalogo_id_key";

-- CreateTable
CREATE TABLE "trial_invitations" (
    "id" TEXT NOT NULL,
    "tenant_id" TEXT NOT NULL,
    "invited_by" TEXT NOT NULL,
    "plan" TEXT NOT NULL DEFAULT 'business_control',
    "duration_days" INTEGER NOT NULL,
    "status" TEXT NOT NULL DEFAULT 'pending',
    "token" TEXT NOT NULL,
    "email_sent_to" TEXT,
    "sent_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "expires_at" TIMESTAMP(3) NOT NULL,
    "accepted_at" TIMESTAMP(3),
    "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

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

-- CreateIndex
CREATE UNIQUE INDEX "trial_invitations_token_key" ON "trial_invitations"("token");

-- CreateIndex
CREATE INDEX "trial_invitations_tenant_id_idx" ON "trial_invitations"("tenant_id");

-- CreateIndex
CREATE INDEX "trial_invitations_token_idx" ON "trial_invitations"("token");

-- CreateIndex
CREATE INDEX "trial_invitations_status_idx" ON "trial_invitations"("status");
