mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat: link field with application
This commit is contained in:
@@ -20,6 +20,7 @@ import { redirects } from "./redirects";
|
||||
import { registry } from "./registry";
|
||||
import { security } from "./security";
|
||||
import { applicationStatus } from "./shared";
|
||||
import { sshKeys } from "./ssh-key";
|
||||
import { generateAppName } from "./utils";
|
||||
|
||||
export const sourceType = pgEnum("sourceType", [
|
||||
@@ -132,7 +133,12 @@ export const applications = pgTable("application", {
|
||||
customGitUrl: text("customGitUrl"),
|
||||
customGitBranch: text("customGitBranch"),
|
||||
customGitBuildPath: text("customGitBuildPath"),
|
||||
customGitSSHKey: text("customGitSSHKey"),
|
||||
customGitSSHKeyId: text("customGitSSHKeyId").references(
|
||||
() => sshKeys.sshKeyId,
|
||||
{
|
||||
onDelete: "set null",
|
||||
},
|
||||
),
|
||||
dockerfile: text("dockerfile"),
|
||||
// Drop
|
||||
dropBuildPath: text("dropBuildPath"),
|
||||
@@ -170,6 +176,10 @@ export const applicationsRelations = relations(
|
||||
references: [projects.projectId],
|
||||
}),
|
||||
deployments: many(deployments),
|
||||
customGitSSHKey: one(sshKeys, {
|
||||
fields: [applications.customGitSSHKeyId],
|
||||
references: [sshKeys.sshKeyId],
|
||||
}),
|
||||
domains: many(domains),
|
||||
mounts: many(mounts),
|
||||
redirects: many(redirects),
|
||||
@@ -289,7 +299,7 @@ const createSchema = createInsertSchema(applications, {
|
||||
dockerImage: z.string().optional(),
|
||||
username: z.string().optional(),
|
||||
password: z.string().optional(),
|
||||
customGitSSHKey: z.string().optional(),
|
||||
customGitSSHKeyId: z.string().optional(),
|
||||
repository: z.string().optional(),
|
||||
dockerfile: z.string().optional(),
|
||||
branch: z.string().optional(),
|
||||
@@ -371,7 +381,12 @@ export const apiSaveGitProvider = createSchema
|
||||
customGitBuildPath: true,
|
||||
customGitUrl: true,
|
||||
})
|
||||
.required();
|
||||
.required()
|
||||
.merge(
|
||||
createSchema.pick({
|
||||
customGitSSHKeyId: true,
|
||||
}),
|
||||
);
|
||||
|
||||
export const apiSaveEnvironmentVariables = createSchema
|
||||
.pick({
|
||||
|
||||
Reference in New Issue
Block a user