mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Refactor triggerType implementation: remove old SQL triggerType column definitions and replace with ENUM type in application and compose tables. Update shared schema to include triggerType enum.
This commit is contained in:
@@ -1,5 +0,0 @@
|
|||||||
-- Add triggerType column to application table
|
|
||||||
ALTER TABLE "application" ADD COLUMN IF NOT EXISTS "triggerType" text DEFAULT 'push';
|
|
||||||
|
|
||||||
-- Add triggerType column to compose table
|
|
||||||
ALTER TABLE "compose" ADD COLUMN IF NOT EXISTS "triggerType" text DEFAULT 'push';
|
|
||||||
3
apps/dokploy/drizzle/0087_lively_risque.sql
Normal file
3
apps/dokploy/drizzle/0087_lively_risque.sql
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
CREATE TYPE "public"."triggerType" AS ENUM('push', 'tag');--> statement-breakpoint
|
||||||
|
ALTER TABLE "application" ADD COLUMN "triggerType" "triggerType" DEFAULT 'push';--> statement-breakpoint
|
||||||
|
ALTER TABLE "compose" ADD COLUMN "triggerType" "triggerType" DEFAULT 'push';
|
||||||
5407
apps/dokploy/drizzle/meta/0087_snapshot.json
Normal file
5407
apps/dokploy/drizzle/meta/0087_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -610,6 +610,13 @@
|
|||||||
"when": 1745706676004,
|
"when": 1745706676004,
|
||||||
"tag": "0086_rainy_gertrude_yorkes",
|
"tag": "0086_rainy_gertrude_yorkes",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 87,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1745723563822,
|
||||||
|
"tag": "0087_lively_risque",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -24,7 +24,7 @@ import { redirects } from "./redirects";
|
|||||||
import { registry } from "./registry";
|
import { registry } from "./registry";
|
||||||
import { security } from "./security";
|
import { security } from "./security";
|
||||||
import { server } from "./server";
|
import { server } from "./server";
|
||||||
import { applicationStatus, certificateType } from "./shared";
|
import { applicationStatus, certificateType, triggerType } from "./shared";
|
||||||
import { sshKeys } from "./ssh-key";
|
import { sshKeys } from "./ssh-key";
|
||||||
import { generateAppName } from "./utils";
|
import { generateAppName } from "./utils";
|
||||||
|
|
||||||
@@ -149,7 +149,7 @@ export const applications = pgTable("application", {
|
|||||||
owner: text("owner"),
|
owner: text("owner"),
|
||||||
branch: text("branch"),
|
branch: text("branch"),
|
||||||
buildPath: text("buildPath").default("/"),
|
buildPath: text("buildPath").default("/"),
|
||||||
triggerType: text("triggerType").default("push"),
|
triggerType: triggerType("triggerType").default("push"),
|
||||||
autoDeploy: boolean("autoDeploy").$defaultFn(() => true),
|
autoDeploy: boolean("autoDeploy").$defaultFn(() => true),
|
||||||
// Gitlab
|
// Gitlab
|
||||||
gitlabProjectId: integer("gitlabProjectId"),
|
gitlabProjectId: integer("gitlabProjectId"),
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { gitlab } from "./gitlab";
|
|||||||
import { mounts } from "./mount";
|
import { mounts } from "./mount";
|
||||||
import { projects } from "./project";
|
import { projects } from "./project";
|
||||||
import { server } from "./server";
|
import { server } from "./server";
|
||||||
import { applicationStatus } from "./shared";
|
import { applicationStatus, triggerType } from "./shared";
|
||||||
import { sshKeys } from "./ssh-key";
|
import { sshKeys } from "./ssh-key";
|
||||||
import { generateAppName } from "./utils";
|
import { generateAppName } from "./utils";
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ export const compose = pgTable("compose", {
|
|||||||
suffix: text("suffix").notNull().default(""),
|
suffix: text("suffix").notNull().default(""),
|
||||||
randomize: boolean("randomize").notNull().default(false),
|
randomize: boolean("randomize").notNull().default(false),
|
||||||
isolatedDeployment: boolean("isolatedDeployment").notNull().default(false),
|
isolatedDeployment: boolean("isolatedDeployment").notNull().default(false),
|
||||||
triggerType: text("triggerType").default("push"),
|
triggerType: triggerType("triggerType").default("push"),
|
||||||
composeStatus: applicationStatus("composeStatus").notNull().default("idle"),
|
composeStatus: applicationStatus("composeStatus").notNull().default("idle"),
|
||||||
projectId: text("projectId")
|
projectId: text("projectId")
|
||||||
.notNull()
|
.notNull()
|
||||||
|
|||||||
@@ -12,3 +12,5 @@ export const certificateType = pgEnum("certificateType", [
|
|||||||
"none",
|
"none",
|
||||||
"custom",
|
"custom",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
export const triggerType = pgEnum("triggerType", ["push", "tag"]);
|
||||||
|
|||||||
Reference in New Issue
Block a user