mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Refactor backup management and enhance database schema
- Updated the ShowBackups component to improve layout and user experience by adding a minimum height and centering content when no backups are available. - Removed the outdated SQL file `0089_dazzling_marrow.sql` and replaced it with a new schema file `0089_eminent_winter_soldier.sql` that introduces new columns and types for the `backup` table, enhancing data structure. - Updated the journal and snapshot metadata to reflect the new schema changes and maintain consistency in the database structure. - Adjusted the service component layout to accommodate new grid configurations for better responsiveness.
This commit is contained in:
parent
d85fc2e513
commit
50aeeb2fb8
@ -124,7 +124,7 @@ export const ShowBackups = ({
|
||||
</CardHeader>
|
||||
<CardContent className="flex flex-col gap-4">
|
||||
{data?.length === 0 ? (
|
||||
<div className="flex flex-col items-center gap-3">
|
||||
<div className="flex flex-col items-center gap-3 min-h-[35vh] justify-center">
|
||||
<DatabaseBackup className="size-8 text-muted-foreground" />
|
||||
<span className="text-base text-muted-foreground text-center">
|
||||
To create a backup it is required to set at least 1 provider.
|
||||
|
@ -1 +0,0 @@
|
||||
ALTER TABLE "backup" ADD COLUMN "metadata" jsonb;
|
@ -2,4 +2,5 @@ CREATE TYPE "public"."backupType" AS ENUM('database', 'compose');--> statement-b
|
||||
ALTER TABLE "backup" ADD COLUMN "serviceName" text;--> statement-breakpoint
|
||||
ALTER TABLE "backup" ADD COLUMN "backupType" "backupType" DEFAULT 'database' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "backup" ADD COLUMN "composeId" text;--> statement-breakpoint
|
||||
ALTER TABLE "backup" ADD COLUMN "metadata" jsonb;--> statement-breakpoint
|
||||
ALTER TABLE "backup" ADD CONSTRAINT "backup_composeId_compose_composeId_fk" FOREIGN KEY ("composeId") REFERENCES "public"."compose"("composeId") ON DELETE cascade ON UPDATE no action;
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"id": "83185289-c593-420c-b8da-a90143aebf8b",
|
||||
"prevId": "7fea81ef-e2a7-4a8b-b755-e98903a08b57",
|
||||
"id": "12ebb86a-87e3-4023-a64d-0c5df96507fb",
|
||||
"prevId": "c7eae4ce-5acc-439b-962f-bb2ef8922187",
|
||||
"version": "7",
|
||||
"dialect": "postgresql",
|
||||
"tables": {
|
||||
@ -2107,11 +2107,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": {},
|
||||
@ -2167,6 +2185,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": {},
|
||||
@ -5261,6 +5292,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": {
|
||||
@ -5439,6 +5631,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": {},
|
||||
|
@ -624,6 +624,13 @@
|
||||
"when": 1746256928101,
|
||||
"tag": "0088_illegal_ma_gnuci",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 89,
|
||||
"version": "7",
|
||||
"when": 1746287354535,
|
||||
"tag": "0089_eminent_winter_soldier",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
@ -219,10 +219,10 @@ const Service = (
|
||||
className={cn(
|
||||
"lg:grid lg:w-fit max-md:overflow-y-scroll justify-start",
|
||||
isCloud && data?.serverId
|
||||
? "lg:grid-cols-8"
|
||||
? "lg:grid-cols-9"
|
||||
: data?.serverId
|
||||
? "lg:grid-cols-7"
|
||||
: "lg:grid-cols-8",
|
||||
? "lg:grid-cols-8"
|
||||
: "lg:grid-cols-9",
|
||||
)}
|
||||
>
|
||||
<TabsTrigger value="general">General</TabsTrigger>
|
||||
@ -230,8 +230,8 @@ const Service = (
|
||||
<TabsTrigger value="domains">Domains</TabsTrigger>
|
||||
<TabsTrigger value="deployments">Deployments</TabsTrigger>
|
||||
<TabsTrigger value="backups">Backups</TabsTrigger>
|
||||
<TabsTrigger value="logs">Logs</TabsTrigger>
|
||||
<TabsTrigger value="schedules">Schedules</TabsTrigger>
|
||||
<TabsTrigger value="logs">Logs</TabsTrigger>
|
||||
{((data?.serverId && isCloud) || !data?.server) && (
|
||||
<TabsTrigger value="monitoring">Monitoring</TabsTrigger>
|
||||
)}
|
||||
|
@ -1,32 +1,21 @@
|
||||
{
|
||||
"name": "@dokploy/server",
|
||||
"version": "1.0.0",
|
||||
"main": "./dist/index.js",
|
||||
"main": "./src/index.ts",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs.js"
|
||||
},
|
||||
".": "./src/index.ts",
|
||||
"./db": {
|
||||
"import": "./dist/db/index.js",
|
||||
"import": "./src/db/index.ts",
|
||||
"require": "./dist/db/index.cjs.js"
|
||||
},
|
||||
"./*": {
|
||||
"import": "./dist/*",
|
||||
"require": "./dist/*.cjs"
|
||||
"./setup/*": {
|
||||
"import": "./src/setup/*.ts",
|
||||
"require": "./dist/setup/index.cjs.js"
|
||||
},
|
||||
"./dist": {
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.cjs.js"
|
||||
},
|
||||
"./dist/db": {
|
||||
"import": "./dist/db/index.js",
|
||||
"require": "./dist/db/index.cjs.js"
|
||||
},
|
||||
"./dist/db/schema": {
|
||||
"import": "./dist/db/schema/index.js",
|
||||
"require": "./dist/db/schema/index.cjs.js"
|
||||
"./constants": {
|
||||
"import": "./src/constants/index.ts",
|
||||
"require": "./dist/constants.cjs.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
|
Loading…
Reference in New Issue
Block a user