This commit is contained in:
2026-01-20 13:53:03 -05:00
parent 7532fd38cb
commit ae9ec078d3
69 changed files with 7031 additions and 409 deletions

View File

@@ -0,0 +1,34 @@
-- CreateTable
CREATE TABLE "S3Bucket" (
"id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"accountId" TEXT NOT NULL,
"region" TEXT NOT NULL,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateTable
CREATE TABLE "S3Object" (
"id" TEXT NOT NULL PRIMARY KEY,
"bucketId" TEXT NOT NULL,
"key" TEXT NOT NULL,
"versionId" TEXT,
"content" BLOB NOT NULL,
"contentType" TEXT NOT NULL DEFAULT 'application/octet-stream',
"size" INTEGER NOT NULL,
"etag" TEXT NOT NULL,
"metadata" TEXT NOT NULL DEFAULT '{}',
"storageClass" TEXT NOT NULL DEFAULT 'STANDARD',
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
CONSTRAINT "S3Object_bucketId_fkey" FOREIGN KEY ("bucketId") REFERENCES "S3Bucket" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
-- CreateIndex
CREATE UNIQUE INDEX "S3Bucket_accountId_region_name_key" ON "S3Bucket"("accountId", "region", "name");
-- CreateIndex
CREATE INDEX "S3Object_bucketId_idx" ON "S3Object"("bucketId");
-- CreateIndex
CREATE UNIQUE INDEX "S3Object_bucketId_key_key" ON "S3Object"("bucketId", "key");

View File

@@ -0,0 +1,21 @@
/*
Warnings:
- You are about to drop the column `accountId` on the `S3Bucket` table. All the data in the column will be lost.
- You are about to drop the column `region` on the `S3Bucket` table. All the data in the column will be lost.
*/
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_S3Bucket" (
"id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_S3Bucket" ("createdAt", "id", "name") SELECT "createdAt", "id", "name" FROM "S3Bucket";
DROP TABLE "S3Bucket";
ALTER TABLE "new_S3Bucket" RENAME TO "S3Bucket";
CREATE UNIQUE INDEX "S3Bucket_name_key" ON "S3Bucket"("name");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;

View File

@@ -0,0 +1,15 @@
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_S3Bucket" (
"id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"tags" TEXT NOT NULL DEFAULT '{}',
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_S3Bucket" ("createdAt", "id", "name") SELECT "createdAt", "id", "name" FROM "S3Bucket";
DROP TABLE "S3Bucket";
ALTER TABLE "new_S3Bucket" RENAME TO "S3Bucket";
CREATE UNIQUE INDEX "S3Bucket_name_key" ON "S3Bucket"("name");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;

View File

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "S3Bucket" ADD COLUMN "policy" TEXT;

View File

@@ -0,0 +1,32 @@
-- CreateTable
CREATE TABLE "IamRoleInlinePolicy" (
"id" TEXT NOT NULL PRIMARY KEY,
"roleName" TEXT NOT NULL,
"policyName" TEXT NOT NULL,
"policyDocument" TEXT NOT NULL,
"accountId" TEXT NOT NULL,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
CONSTRAINT "IamRoleInlinePolicy_accountId_roleName_fkey" FOREIGN KEY ("accountId", "roleName") REFERENCES "IamRole" ("accountId", "name") ON DELETE CASCADE ON UPDATE CASCADE
);
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_S3Bucket" (
"id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"tags" TEXT NOT NULL DEFAULT '{}',
"policy" TEXT,
"acl" TEXT NOT NULL DEFAULT '{"Owner":{"ID":"local-user","DisplayName":"local-user"},"Grants":[]}',
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);
INSERT INTO "new_S3Bucket" ("createdAt", "id", "name", "policy", "tags") SELECT "createdAt", "id", "name", "policy", "tags" FROM "S3Bucket";
DROP TABLE "S3Bucket";
ALTER TABLE "new_S3Bucket" RENAME TO "S3Bucket";
CREATE UNIQUE INDEX "S3Bucket_name_key" ON "S3Bucket"("name");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;
-- CreateIndex
CREATE UNIQUE INDEX "IamRoleInlinePolicy_accountId_roleName_policyName_key" ON "IamRoleInlinePolicy"("accountId", "roleName", "policyName");

View File

@@ -0,0 +1,20 @@
-- CreateTable
CREATE TABLE "ConsulKVEntry" (
"key" TEXT NOT NULL PRIMARY KEY,
"value" TEXT NOT NULL,
"flags" INTEGER NOT NULL DEFAULT 0,
"createIndex" INTEGER NOT NULL,
"modifyIndex" INTEGER NOT NULL,
"lockIndex" INTEGER NOT NULL DEFAULT 0,
"session" TEXT,
"datacenter" TEXT NOT NULL DEFAULT 'dc1',
"namespace" TEXT NOT NULL DEFAULT 'default',
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL
);
-- CreateIndex
CREATE INDEX "ConsulKVEntry_datacenter_idx" ON "ConsulKVEntry"("datacenter");
-- CreateIndex
CREATE INDEX "ConsulKVEntry_namespace_idx" ON "ConsulKVEntry"("namespace");

View File

@@ -0,0 +1,29 @@
/*
Warnings:
- You are about to alter the column `flags` on the `ConsulKVEntry` table. The data in that column could be lost. The data in that column will be cast from `Int` to `BigInt`.
*/
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_ConsulKVEntry" (
"key" TEXT NOT NULL PRIMARY KEY,
"value" TEXT NOT NULL,
"flags" BIGINT NOT NULL DEFAULT 0,
"createIndex" INTEGER NOT NULL,
"modifyIndex" INTEGER NOT NULL,
"lockIndex" INTEGER NOT NULL DEFAULT 0,
"session" TEXT,
"datacenter" TEXT NOT NULL DEFAULT 'dc1',
"namespace" TEXT NOT NULL DEFAULT 'default',
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL
);
INSERT INTO "new_ConsulKVEntry" ("createIndex", "createdAt", "datacenter", "flags", "key", "lockIndex", "modifyIndex", "namespace", "session", "updatedAt", "value") SELECT "createIndex", "createdAt", "datacenter", "flags", "key", "lockIndex", "modifyIndex", "namespace", "session", "updatedAt", "value" FROM "ConsulKVEntry";
DROP TABLE "ConsulKVEntry";
ALTER TABLE "new_ConsulKVEntry" RENAME TO "ConsulKVEntry";
CREATE INDEX "ConsulKVEntry_datacenter_idx" ON "ConsulKVEntry"("datacenter");
CREATE INDEX "ConsulKVEntry_namespace_idx" ON "ConsulKVEntry"("namespace");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;

View File

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "ConsulKVEntry" ADD COLUMN "lockInfo" TEXT;

View File

@@ -0,0 +1,29 @@
/*
Warnings:
- You are about to drop the column `lockInfo` on the `ConsulKVEntry` table. All the data in the column will be lost.
*/
-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_ConsulKVEntry" (
"key" TEXT NOT NULL PRIMARY KEY,
"value" TEXT NOT NULL,
"flags" BIGINT NOT NULL DEFAULT 0,
"createIndex" INTEGER NOT NULL,
"modifyIndex" INTEGER NOT NULL,
"lockIndex" INTEGER NOT NULL DEFAULT 0,
"session" TEXT,
"datacenter" TEXT NOT NULL DEFAULT 'dc1',
"namespace" TEXT NOT NULL DEFAULT 'default',
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL
);
INSERT INTO "new_ConsulKVEntry" ("createIndex", "createdAt", "datacenter", "flags", "key", "lockIndex", "modifyIndex", "namespace", "session", "updatedAt", "value") SELECT "createIndex", "createdAt", "datacenter", "flags", "key", "lockIndex", "modifyIndex", "namespace", "session", "updatedAt", "value" FROM "ConsulKVEntry";
DROP TABLE "ConsulKVEntry";
ALTER TABLE "new_ConsulKVEntry" RENAME TO "ConsulKVEntry";
CREATE INDEX "ConsulKVEntry_datacenter_idx" ON "ConsulKVEntry"("datacenter");
CREATE INDEX "ConsulKVEntry_namespace_idx" ON "ConsulKVEntry"("namespace");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;