fix(postgres): preserve copied table comments safely

This commit is contained in:
zipg authored and GitHub committed 2026-07-31 19:33:43 +08:00
1 parent 00927ac435
commit ecac4800c4
10 files changed
+166 -19

No files matched your search

@@ -55,6 +55,7 @@ export interface DuplicateTableStructureSqlOptions {
schema?: string | null;
sourceName: string;
targetName: string;
tableComment?: string | null;
columnComments?: Array<{ name: string; comment: string }>;
}
@@ -153,6 +154,10 @@ export function buildDuplicateTableStructureSql(options: DuplicateTableStructure
return api.buildDuplicateTableStructureSql(options);
}
export function duplicateTableStructureRequiresScript(sql: string): boolean {
return /;\s*\n\s*COMMENT ON (?:TABLE|COLUMN)\b/i.test(sql);
}
export function buildCopyTableDataSql(options: CopyTableDataSqlOptions): Promise<string> {
return api.buildCopyTableDataSql(options);
}