mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-06 04:02:16 +00:00
feat(database): add volume_backup table and update deployment schema
- Introduced a new "volume_backup" table to manage volume backup configurations, including fields for various database IDs and backup settings. - Updated the "deployment" table to include a foreign key reference to the new "volume_backup" table. - Added foreign key constraints to ensure data integrity across related tables. - Updated journal and snapshot files to reflect these changes, enhancing the database schema for better backup management.
This commit is contained in:
@@ -0,0 +1,33 @@
|
|||||||
|
CREATE TABLE "volume_backup" (
|
||||||
|
"volumeBackupId" text PRIMARY KEY NOT NULL,
|
||||||
|
"name" text NOT NULL,
|
||||||
|
"volumeName" text NOT NULL,
|
||||||
|
"prefix" text NOT NULL,
|
||||||
|
"serviceType" "serviceType" DEFAULT 'application' NOT NULL,
|
||||||
|
"appName" text NOT NULL,
|
||||||
|
"serviceName" text,
|
||||||
|
"turnOff" boolean DEFAULT false NOT NULL,
|
||||||
|
"cronExpression" text NOT NULL,
|
||||||
|
"keepLatestCount" integer,
|
||||||
|
"enabled" boolean,
|
||||||
|
"applicationId" text,
|
||||||
|
"postgresId" text,
|
||||||
|
"mariadbId" text,
|
||||||
|
"mongoId" text,
|
||||||
|
"mysqlId" text,
|
||||||
|
"redisId" text,
|
||||||
|
"composeId" text,
|
||||||
|
"createdAt" text NOT NULL,
|
||||||
|
"destinationId" text NOT NULL
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
ALTER TABLE "deployment" ADD COLUMN "volumeBackupId" text;--> statement-breakpoint
|
||||||
|
ALTER TABLE "volume_backup" ADD CONSTRAINT "volume_backup_applicationId_application_applicationId_fk" FOREIGN KEY ("applicationId") REFERENCES "public"."application"("applicationId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||||
|
ALTER TABLE "volume_backup" ADD CONSTRAINT "volume_backup_postgresId_postgres_postgresId_fk" FOREIGN KEY ("postgresId") REFERENCES "public"."postgres"("postgresId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||||
|
ALTER TABLE "volume_backup" ADD CONSTRAINT "volume_backup_mariadbId_mariadb_mariadbId_fk" FOREIGN KEY ("mariadbId") REFERENCES "public"."mariadb"("mariadbId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||||
|
ALTER TABLE "volume_backup" ADD CONSTRAINT "volume_backup_mongoId_mongo_mongoId_fk" FOREIGN KEY ("mongoId") REFERENCES "public"."mongo"("mongoId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||||
|
ALTER TABLE "volume_backup" ADD CONSTRAINT "volume_backup_mysqlId_mysql_mysqlId_fk" FOREIGN KEY ("mysqlId") REFERENCES "public"."mysql"("mysqlId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||||
|
ALTER TABLE "volume_backup" ADD CONSTRAINT "volume_backup_redisId_redis_redisId_fk" FOREIGN KEY ("redisId") REFERENCES "public"."redis"("redisId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||||
|
ALTER TABLE "volume_backup" ADD CONSTRAINT "volume_backup_composeId_compose_composeId_fk" FOREIGN KEY ("composeId") REFERENCES "public"."compose"("composeId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||||
|
ALTER TABLE "volume_backup" ADD CONSTRAINT "volume_backup_destinationId_destination_destinationId_fk" FOREIGN KEY ("destinationId") REFERENCES "public"."destination"("destinationId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||||
|
ALTER TABLE "deployment" ADD CONSTRAINT "deployment_volumeBackupId_volume_backup_volumeBackupId_fk" FOREIGN KEY ("volumeBackupId") REFERENCES "public"."volume_backup"("volumeBackupId") ON DELETE cascade ON UPDATE no action;
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -708,6 +708,13 @@
|
|||||||
"when": 1751741736144,
|
"when": 1751741736144,
|
||||||
"tag": "0100_purple_rogue",
|
"tag": "0100_purple_rogue",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 101,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1751751631943,
|
||||||
|
"tag": "0101_moaning_blazing_skull",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user