mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 22:33:59 +00:00
Delete FK from drop column
This commit is contained in:
@@ -185,10 +185,12 @@ describe('Alter table', () => {
|
|||||||
await testTableDiff(engine, conn, driver,
|
await testTableDiff(engine, conn, driver,
|
||||||
tbl => {
|
tbl => {
|
||||||
tbl.columns = tbl.columns.filter(x => x.columnName != column);
|
tbl.columns = tbl.columns.filter(x => x.columnName != column);
|
||||||
tbl.foreignKeys = tbl.foreignKeys.map(fk => ({
|
tbl.foreignKeys = tbl.foreignKeys
|
||||||
...fk,
|
.map(fk => ({
|
||||||
columns: fk.columns.filter(col => col.columnName != column)
|
...fk,
|
||||||
})).filter(fk => fk.columns.length > 0);
|
columns: fk.columns.filter(col => col.columnName != column)
|
||||||
|
}))
|
||||||
|
.filter(fk => fk.columns.length > 0);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user