mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-09 04:28:38 -05:00
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:
committed by
Akshay Joshi
parent
9f992a9e5d
commit
903b300b9e
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user