table editor WIP

This commit is contained in:
Jan Prochazka
2021-06-10 10:51:30 +02:00
parent 9959e61b35
commit 7847eaa64d
8 changed files with 135 additions and 83 deletions

View 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;
}