fix(dameng): preserve cloned column comments

This commit is contained in:
zipg authored and GitHub committed 2026-07-27 14:53:13 +08:00
1 parent d5e0cde7e2
commit 0b4b1f956f
4 files changed
+146 -31

No files matched your search

+9 -1
View File
@@ -1,4 +1,4 @@
import type { DatabaseObjectType, DatabaseType } from "@/types/database";
import type { ColumnInfo, DatabaseObjectType, DatabaseType } from "@/types/database";
import * as api from "@/lib/backend/api";
export interface DropObjectSqlOptions {
@@ -55,6 +55,14 @@ export interface DuplicateTableStructureSqlOptions {
schema?: string | null;
sourceName: string;
targetName: string;
columnComments?: Array<{ name: string; comment: string }>;
}
export function collectDuplicateTableColumnComments(columns: readonly Pick<ColumnInfo, "name" | "comment">[]): Array<{ name: string; comment: string }> {
return columns.flatMap((column) => {
const comment = column.comment;
return comment?.trim() ? [{ name: column.name, comment }] : [];
});
}
export interface CopyTableDataSqlOptions {