mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 16:36:00 +00:00
db deploy fixes
This commit is contained in:
@@ -498,22 +498,25 @@ export class AlterPlan {
|
||||
return this.operations;
|
||||
}
|
||||
const fks = [];
|
||||
const res = this.operations.map(op => {
|
||||
if (op.operationType == 'createTable') {
|
||||
fks.push(...(op.newObject.foreignKeys || []));
|
||||
return {
|
||||
...op,
|
||||
newObject: {
|
||||
...op.newObject,
|
||||
foreignKeys: [],
|
||||
},
|
||||
};
|
||||
}
|
||||
return op;
|
||||
});
|
||||
const res = this.operations
|
||||
.filter(op => op.operationType != 'createConstraint')
|
||||
.map(op => {
|
||||
if (op.operationType == 'createTable') {
|
||||
fks.push(...(op.newObject.foreignKeys || []));
|
||||
return {
|
||||
...op,
|
||||
newObject: {
|
||||
...op.newObject,
|
||||
foreignKeys: [],
|
||||
},
|
||||
};
|
||||
}
|
||||
return op;
|
||||
});
|
||||
|
||||
return [
|
||||
...res,
|
||||
...this.operations.filter(op => op.operationType == 'createConstraint'),
|
||||
...fks.map(
|
||||
fk =>
|
||||
({
|
||||
|
||||
Reference in New Issue
Block a user