1) Added support for unique keys in ERD. Fixes #7249

2) Fixed an issue where foreign key relationships do not update when the primary key is modified. Fixes #7197
This commit is contained in:
Aditya Toshniwal
2022-03-28 16:26:43 +05:30
committed by Akshay Joshi
parent 9f992a9e5d
commit 903b300b9e
9 changed files with 84 additions and 56 deletions
@@ -48,6 +48,5 @@ export class FakeLink {
}
export class FakePort {
constructor() {}
getLinks() {return null;}
}
@@ -135,31 +135,6 @@ describe('ERD TableNodeModel', ()=>{
});
expect(existPort.removeAllLinks).not.toHaveBeenCalled();
});
it('remove columns', ()=>{
spyOn(existPort, 'getSubtype').and.returnValue('one');
existPort.removeAllLinks.calls.reset();
modelObj.setData({
name: 'noname',
schema: 'erd',
columns: [
{name: 'col2', not_null:false, attnum: 1},
{name: 'col3', not_null:false, attnum: 2},
],
});
expect(modelObj.getData()).toEqual({
name: 'noname',
schema: 'erd',
columns: [
{name: 'col2', not_null:false, attnum: 1},
{name: 'col3', not_null:false, attnum: 2},
],
});
expect(modelObj.getPortName).toHaveBeenCalledWith(0);
expect(existPort.removeAllLinks).toHaveBeenCalled();
expect(modelObj.removePort).toHaveBeenCalledWith(existPort);
});
});
it('getSchemaTableName', ()=>{
@@ -257,6 +257,7 @@ describe('ERD BodyWidget', ()=>{
'getNodesDict': ()=>nodesDict,
});
spyOn(bodyInstance.diagram, 'addLink');
spyOn(bodyInstance.diagram, 'syncTableLinks');
/* New */
tableDialog.show.calls.reset();
bodyInstance.addEditTable();