fix(postgres): preserve copied table comments safely
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user