dbgate/packages/tools/src/tableTransforms.ts
2020-11-24 19:06:05 +01:00

10 lines
288 B
TypeScript

import { TableInfo } from 'dbgate-types';
import _cloneDeep from 'lodash/cloneDeep';
export function prepareTableForImport(table: TableInfo): TableInfo {
const res = _cloneDeep(table);
res.foreignKeys = [];
if (res.primaryKey) res.primaryKey.constraintName = null;
return res;
}