mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-18 05:36:00 +00:00
13 lines
347 B
TypeScript
13 lines
347 B
TypeScript
import { TableInfo } from 'dbgate-types';
|
|
import _cloneDeep from 'lodash/cloneDeep';
|
|
|
|
export function prepareTableForImport(table: TableInfo): TableInfo {
|
|
const res = _cloneDeep(table);
|
|
res.foreignKeys = [];
|
|
res.indexes = [];
|
|
res.uniques = [];
|
|
res.checks = [];
|
|
if (res.primaryKey) res.primaryKey.constraintName = null;
|
|
return res;
|
|
}
|