Merge pull request #3048 from Bima42/fix/update-pg-data-path

fix: update pg data path for latest docker version
This commit is contained in:
Mauricio Siu
2025-11-26 01:22:12 -05:00
committed by GitHub
2 changed files with 18 additions and 1 deletions

View File

@@ -13,6 +13,18 @@ import { TRPCError } from "@trpc/server";
import { eq, getTableColumns } from "drizzle-orm";
import { validUniqueServerAppName } from "./project";
export function getMountPath(dockerImage: string): string {
const versionMatch = dockerImage.match(/postgres:(\d+)/);
if (versionMatch?.[1]) {
const version = Number.parseInt(versionMatch[1], 10);
if (version >= 18) {
return `/var/lib/postgresql/${version}/data`;
}
}
return "/var/lib/postgresql/data";
}
export type Postgres = typeof postgres.$inferSelect;
export const createPostgres = async (input: typeof apiCreatePostgres._type) => {