-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Setup" (
    "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    "name" TEXT NOT NULL,
    "twilioAccountSid" TEXT NOT NULL,
    "twilioAuthTokenEnc" TEXT NOT NULL,
    "status" TEXT NOT NULL DEFAULT 'active',
    "pricingMode" TEXT NOT NULL DEFAULT 'realtime',
    "lumpsumRatePerMinute" REAL,
    "adminEmail" TEXT NOT NULL,
    "adminPasswordHash" TEXT NOT NULL,
    "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" DATETIME NOT NULL
);
INSERT INTO "new_Setup" ("adminEmail", "adminPasswordHash", "createdAt", "id", "name", "status", "twilioAccountSid", "twilioAuthTokenEnc", "updatedAt") SELECT "adminEmail", "adminPasswordHash", "createdAt", "id", "name", "status", "twilioAccountSid", "twilioAuthTokenEnc", "updatedAt" FROM "Setup";
DROP TABLE "Setup";
ALTER TABLE "new_Setup" RENAME TO "Setup";
CREATE UNIQUE INDEX "Setup_adminEmail_key" ON "Setup"("adminEmail");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;
