Skip to content

Commit ade5fd6

Browse files
committed
chore: added sqlite prisma migration for add_record_credit_billing
1 parent 4b18b96 commit ade5fd6

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

  • src/aux-server/aux-backend/schemas/sqlite/migrations/20260604175842_add_record_credit_billing
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
-- RedefineTables
2+
PRAGMA defer_foreign_keys=ON;
3+
PRAGMA foreign_keys=OFF;
4+
CREATE TABLE "new_Record" (
5+
"name" TEXT NOT NULL PRIMARY KEY,
6+
"ownerId" TEXT,
7+
"studioId" TEXT,
8+
"creditAccountId" TEXT,
9+
"creditBillingEnabled" BOOLEAN NOT NULL DEFAULT false,
10+
"secretHashes" JSONB NOT NULL,
11+
"secretSalt" TEXT NOT NULL,
12+
"createdAt" DECIMAL NOT NULL,
13+
"updatedAt" DECIMAL NOT NULL,
14+
CONSTRAINT "Record_ownerId_fkey" FOREIGN KEY ("ownerId") REFERENCES "User" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
15+
CONSTRAINT "Record_studioId_fkey" FOREIGN KEY ("studioId") REFERENCES "Studio" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
16+
CONSTRAINT "Record_creditAccountId_fkey" FOREIGN KEY ("creditAccountId") REFERENCES "FinancialAccount" ("id") ON DELETE SET NULL ON UPDATE CASCADE
17+
);
18+
INSERT INTO "new_Record" ("createdAt", "name", "ownerId", "secretHashes", "secretSalt", "studioId", "updatedAt") SELECT "createdAt", "name", "ownerId", "secretHashes", "secretSalt", "studioId", "updatedAt" FROM "Record";
19+
DROP TABLE "Record";
20+
ALTER TABLE "new_Record" RENAME TO "Record";
21+
PRAGMA foreign_keys=ON;
22+
PRAGMA defer_foreign_keys=OFF;

0 commit comments

Comments
 (0)