feat(cloud-storage): add cloud storage destination and backup tables

- Created new SQL tables for managing cloud storage destinations and backups, including necessary fields and constraints.
- Updated the journal and snapshot metadata to reflect the addition of these new tables for version 0098.
This commit is contained in:
Mauricio Siu 2025-06-22 00:01:21 -06:00
parent 65117ab0ed
commit f4579c44b8
3 changed files with 6068 additions and 0 deletions

View File

@ -0,0 +1,33 @@
CREATE TABLE "cloud_storage_destination" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"name" text NOT NULL,
"provider" text NOT NULL,
"username" text,
"password" text,
"host" text,
"port" text,
"config" text,
"organization_id" text NOT NULL,
"created_at" timestamp DEFAULT now(),
"updated_at" timestamp DEFAULT now()
);
--> statement-breakpoint
CREATE TABLE "cloud_storage_backup" (
"id" text PRIMARY KEY NOT NULL,
"organization_id" text NOT NULL,
"cloud_storage_destination_id" uuid NOT NULL,
"schedule" text NOT NULL,
"enabled" boolean DEFAULT true NOT NULL,
"database_type" text NOT NULL,
"prefix" text,
"database" text,
"postgres_id" text,
"mysql_id" text,
"mariadb_id" text,
"mongo_id" text,
"keep_latest_count" integer,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "cloud_storage_backup" ADD CONSTRAINT "cloud_storage_backup_cloud_storage_destination_id_cloud_storage_destination_id_fk" FOREIGN KEY ("cloud_storage_destination_id") REFERENCES "public"."cloud_storage_destination"("id") ON DELETE no action ON UPDATE no action;

File diff suppressed because it is too large Load Diff

View File

@ -687,6 +687,13 @@
"when": 1750567641441,
"tag": "0097_hard_lizard",
"breakpoints": true
},
{
"idx": 98,
"version": "7",
"when": 1750572067549,
"tag": "0098_majestic_white_queen",
"breakpoints": true
}
]
}