Merge branch 'canary' into 187-backups-for-docker-compose

This commit is contained in:
Mauricio Siu
2025-05-03 09:48:24 -06:00
37 changed files with 2133 additions and 169 deletions

View File

@@ -0,0 +1,28 @@
CREATE TYPE "public"."scheduleType" AS ENUM('application', 'compose', 'server', 'dokploy-server');--> statement-breakpoint
CREATE TYPE "public"."shellType" AS ENUM('bash', 'sh');--> statement-breakpoint
CREATE TABLE "schedule" (
"scheduleId" text PRIMARY KEY NOT NULL,
"name" text NOT NULL,
"cronExpression" text NOT NULL,
"appName" text NOT NULL,
"serviceName" text,
"shellType" "shellType" DEFAULT 'bash' NOT NULL,
"scheduleType" "scheduleType" DEFAULT 'application' NOT NULL,
"command" text NOT NULL,
"script" text,
"applicationId" text,
"composeId" text,
"serverId" text,
"userId" text,
"enabled" boolean DEFAULT true NOT NULL,
"createdAt" text NOT NULL
);
--> statement-breakpoint
ALTER TABLE "deployment" ADD COLUMN "startedAt" text;--> statement-breakpoint
ALTER TABLE "deployment" ADD COLUMN "finishedAt" text;--> statement-breakpoint
ALTER TABLE "deployment" ADD COLUMN "scheduleId" text;--> statement-breakpoint
ALTER TABLE "schedule" ADD CONSTRAINT "schedule_applicationId_application_applicationId_fk" FOREIGN KEY ("applicationId") REFERENCES "public"."application"("applicationId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "schedule" ADD CONSTRAINT "schedule_composeId_compose_composeId_fk" FOREIGN KEY ("composeId") REFERENCES "public"."compose"("composeId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "schedule" ADD CONSTRAINT "schedule_serverId_server_serverId_fk" FOREIGN KEY ("serverId") REFERENCES "public"."server"("serverId") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "schedule" ADD CONSTRAINT "schedule_userId_user_temp_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."user_temp"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "deployment" ADD CONSTRAINT "deployment_scheduleId_schedule_scheduleId_fk" FOREIGN KEY ("scheduleId") REFERENCES "public"."schedule"("scheduleId") ON DELETE cascade ON UPDATE no action;

View File

@@ -1,5 +1,5 @@
{
"id": "7fea81ef-e2a7-4a8b-b755-e98903a08b57",
"id": "c7eae4ce-5acc-439b-962f-bb2ef8922187",
"prevId": "7fb3716c-3cc6-4b18-b8d1-762844da26be",
"version": "7",
"dialect": "postgresql",
@@ -1770,12 +1770,6 @@
"primaryKey": false,
"notNull": true
},
"serviceName": {
"name": "serviceName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"destinationId": {
"name": "destinationId",
"type": "text",
@@ -1788,14 +1782,6 @@
"primaryKey": false,
"notNull": false
},
"backupType": {
"name": "backupType",
"type": "backupType",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'database'"
},
"databaseType": {
"name": "databaseType",
"type": "databaseType",
@@ -1803,12 +1789,6 @@
"primaryKey": false,
"notNull": true
},
"composeId": {
"name": "composeId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"postgresId": {
"name": "postgresId",
"type": "text",
@@ -1855,19 +1835,6 @@
"onDelete": "cascade",
"onUpdate": "no action"
},
"backup_composeId_compose_composeId_fk": {
"name": "backup_composeId_compose_composeId_fk",
"tableFrom": "backup",
"tableTo": "compose",
"columnsFrom": [
"composeId"
],
"columnsTo": [
"composeId"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"backup_postgresId_postgres_postgresId_fk": {
"name": "backup_postgresId_postgres_postgresId_fk",
"tableFrom": "backup",
@@ -2101,11 +2068,29 @@
"primaryKey": false,
"notNull": true
},
"startedAt": {
"name": "startedAt",
"type": "text",
"primaryKey": false,
"notNull": false
},
"finishedAt": {
"name": "finishedAt",
"type": "text",
"primaryKey": false,
"notNull": false
},
"errorMessage": {
"name": "errorMessage",
"type": "text",
"primaryKey": false,
"notNull": false
},
"scheduleId": {
"name": "scheduleId",
"type": "text",
"primaryKey": false,
"notNull": false
}
},
"indexes": {},
@@ -2161,6 +2146,19 @@
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"deployment_scheduleId_schedule_scheduleId_fk": {
"name": "deployment_scheduleId_schedule_scheduleId_fk",
"tableFrom": "deployment",
"tableTo": "schedule",
"columnsFrom": [
"scheduleId"
],
"columnsTo": [
"scheduleId"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
@@ -5255,6 +5253,167 @@
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
},
"public.schedule": {
"name": "schedule",
"schema": "",
"columns": {
"scheduleId": {
"name": "scheduleId",
"type": "text",
"primaryKey": true,
"notNull": true
},
"name": {
"name": "name",
"type": "text",
"primaryKey": false,
"notNull": true
},
"cronExpression": {
"name": "cronExpression",
"type": "text",
"primaryKey": false,
"notNull": true
},
"appName": {
"name": "appName",
"type": "text",
"primaryKey": false,
"notNull": true
},
"serviceName": {
"name": "serviceName",
"type": "text",
"primaryKey": false,
"notNull": false
},
"shellType": {
"name": "shellType",
"type": "shellType",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'bash'"
},
"scheduleType": {
"name": "scheduleType",
"type": "scheduleType",
"typeSchema": "public",
"primaryKey": false,
"notNull": true,
"default": "'application'"
},
"command": {
"name": "command",
"type": "text",
"primaryKey": false,
"notNull": true
},
"script": {
"name": "script",
"type": "text",
"primaryKey": false,
"notNull": false
},
"applicationId": {
"name": "applicationId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"composeId": {
"name": "composeId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"serverId": {
"name": "serverId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"userId": {
"name": "userId",
"type": "text",
"primaryKey": false,
"notNull": false
},
"enabled": {
"name": "enabled",
"type": "boolean",
"primaryKey": false,
"notNull": true,
"default": true
},
"createdAt": {
"name": "createdAt",
"type": "text",
"primaryKey": false,
"notNull": true
}
},
"indexes": {},
"foreignKeys": {
"schedule_applicationId_application_applicationId_fk": {
"name": "schedule_applicationId_application_applicationId_fk",
"tableFrom": "schedule",
"tableTo": "application",
"columnsFrom": [
"applicationId"
],
"columnsTo": [
"applicationId"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"schedule_composeId_compose_composeId_fk": {
"name": "schedule_composeId_compose_composeId_fk",
"tableFrom": "schedule",
"tableTo": "compose",
"columnsFrom": [
"composeId"
],
"columnsTo": [
"composeId"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"schedule_serverId_server_serverId_fk": {
"name": "schedule_serverId_server_serverId_fk",
"tableFrom": "schedule",
"tableTo": "server",
"columnsFrom": [
"serverId"
],
"columnsTo": [
"serverId"
],
"onDelete": "cascade",
"onUpdate": "no action"
},
"schedule_userId_user_temp_id_fk": {
"name": "schedule_userId_user_temp_id_fk",
"tableFrom": "schedule",
"tableTo": "user_temp",
"columnsFrom": [
"userId"
],
"columnsTo": [
"id"
],
"onDelete": "cascade",
"onUpdate": "no action"
}
},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"policies": {},
"checkConstraints": {},
"isRLSEnabled": false
}
},
"enums": {
@@ -5292,14 +5451,6 @@
"preview"
]
},
"public.backupType": {
"name": "backupType",
"schema": "public",
"values": [
"database",
"compose"
]
},
"public.databaseType": {
"name": "databaseType",
"schema": "public",
@@ -5433,6 +5584,24 @@
"active",
"inactive"
]
},
"public.scheduleType": {
"name": "scheduleType",
"schema": "public",
"values": [
"application",
"compose",
"server",
"dokploy-server"
]
},
"public.shellType": {
"name": "shellType",
"schema": "public",
"values": [
"bash",
"sh"
]
}
},
"schemas": {},

View File

@@ -621,15 +621,8 @@
{
"idx": 88,
"version": "7",
"when": 1745801614194,
"tag": "0088_same_ezekiel",
"breakpoints": true
},
{
"idx": 89,
"version": "7",
"when": 1745812150155,
"tag": "0089_dazzling_marrow",
"when": 1746256928101,
"tag": "0088_illegal_ma_gnuci",
"breakpoints": true
}
]