This commit is contained in:
jarek committed 2026-07-25 08:41:01 +02:00
1 parent 9f09d60a83
commit 64b6dcd744
177 files changed
+21182 -1042

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
CREATE TABLE IF NOT EXISTS "backup_destinations" (
"id" serial PRIMARY KEY NOT NULL,
"name" text NOT NULL,
"repository" text NOT NULL,
"password" text NOT NULL,
"env_vars" text,
"flags" text,
"host_path" text,
"policies" text,
"last_test_at" timestamp,
"last_test_status" text,
"last_test_error" text,
"created_at" timestamp DEFAULT now(),
"updated_at" timestamp DEFAULT now(),
CONSTRAINT "backup_destinations_name_unique" UNIQUE("name")
);
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "backup_configs" (
"id" serial PRIMARY KEY NOT NULL,
"type" text DEFAULT 'container' NOT NULL,
"target_name" text NOT NULL,
"environment_id" integer,
"destination_id" integer NOT NULL,
"enabled" boolean DEFAULT true,
"all_volumes" boolean DEFAULT true,
"selected_volumes" text,
"stop_before_backup" boolean DEFAULT false,
"schedule" text,
"retention" text,
"options" text,
"tags" text,
"last_backup_at" timestamp,
"last_backup_status" text,
"created_at" timestamp DEFAULT now(),
"updated_at" timestamp DEFAULT now()
);
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "backup_configs" ADD CONSTRAINT "backup_configs_environment_id_environments_id_fk" FOREIGN KEY ("environment_id") REFERENCES "public"."environments"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "backup_configs" ADD CONSTRAINT "backup_configs_destination_id_backup_destinations_id_fk" FOREIGN KEY ("destination_id") REFERENCES "public"."backup_destinations"("id") ON DELETE cascade ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
+7
View File
@@ -64,6 +64,13 @@
"when": 1781620381909,
"tag": "0008_add_template_sources",
"breakpoints": true
},
{
"idx": 9,
"version": "7",
"when": 1781620382909,
"tag": "0009_add_backup_tables",
"breakpoints": true
}
]
}