dbgate/packages/tools/src/tableTransforms.ts

10 lines
288 B
TypeScript
Raw Normal View History

import { TableInfo } from 'dbgate-types';
2020-11-24 18:06:05 +00:00
import _cloneDeep from 'lodash/cloneDeep';
2020-09-27 06:28:59 +00:00
export function prepareTableForImport(table: TableInfo): TableInfo {
2020-11-24 18:06:05 +00:00
const res = _cloneDeep(table);
2020-09-27 06:28:59 +00:00
res.foreignKeys = [];
if (res.primaryKey) res.primaryKey.constraintName = null;
return res;
}