feat: WP could have custom db

This commit is contained in:
Andras Bacsai
2022-05-10 10:12:13 +02:00
parent ede37d296b
commit ce52608f19
19 changed files with 480 additions and 258 deletions

View File

@@ -28,7 +28,7 @@ if (!dev) {
}
export const prisma = new PrismaClient({
errorFormat: 'pretty',
errorFormat: 'minimal',
rejectOnNotFound: false
});

View File

@@ -419,7 +419,9 @@ export async function updateWordpress({
name,
exposePort,
mysqlDatabase,
extraConfig
extraConfig,
mysqlHost,
mysqlPort
}: {
id: string;
fqdn: string;
@@ -427,10 +429,24 @@ export async function updateWordpress({
exposePort?: number;
mysqlDatabase: string;
extraConfig: string;
mysqlHost?: string;
mysqlPort?: number;
}): Promise<Service> {
return await prisma.service.update({
where: { id },
data: { fqdn, name, exposePort, wordpress: { update: { mysqlDatabase, extraConfig } } }
data: {
fqdn,
name,
exposePort,
wordpress: {
update: {
mysqlDatabase,
extraConfig,
mysqlHost,
mysqlPort
}
}
}
});
}