mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 06:06:01 +00:00
table editor WIP
This commit is contained in:
17
packages/tools/src/diffTools.ts
Normal file
17
packages/tools/src/diffTools.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { TableInfo } from 'dbgate-types';
|
||||
import uuidv1 from 'uuid/v1';
|
||||
|
||||
export function generateTableGroupId(table: TableInfo): TableInfo {
|
||||
if (!table) return table;
|
||||
if (!table.groupId) {
|
||||
return {
|
||||
...table,
|
||||
columns: table.columns.map(col => ({
|
||||
...col,
|
||||
groupid: uuidv1(),
|
||||
})),
|
||||
groupId: uuidv1(),
|
||||
};
|
||||
}
|
||||
return table;
|
||||
}
|
||||
Reference in New Issue
Block a user