mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue where changing a column name should reflect in all the constraints in table object dialog and ERD table dialog. #7476
This commit is contained in:
@@ -106,7 +106,6 @@ describe('ExclusionConstraintSchema', ()=>{
|
||||
is_exp: true,
|
||||
column: 'abc',
|
||||
col_type: null,
|
||||
column_cid: null,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -126,14 +125,14 @@ describe('ExclusionConstraintSchema', ()=>{
|
||||
});
|
||||
|
||||
it('depChange', ()=>{
|
||||
let state = {columns: [{column: 'id', column_cid: 'c123'}]};
|
||||
let state = {columns: [{column: 'id'}]};
|
||||
|
||||
schemaObj.top = new TableSchema({}, null);
|
||||
expect(getFieldDepChange(schemaObj, 'columns')(state, ['columns', 0], null, {
|
||||
type: SCHEMA_STATE_ACTIONS.DELETE_ROW,
|
||||
oldState: {
|
||||
columns: [
|
||||
{name: 'id', cid: 'c123'}
|
||||
{name: 'id'}
|
||||
],
|
||||
},
|
||||
path: ['columns'],
|
||||
@@ -144,19 +143,19 @@ describe('ExclusionConstraintSchema', ()=>{
|
||||
|
||||
expect(getFieldDepChange(schemaObj, 'columns')(state, ['columns', 0], {
|
||||
columns: [
|
||||
{name: 'id123', cid: 'c123'}
|
||||
{name: 'id123'}
|
||||
],
|
||||
}, {
|
||||
type: SCHEMA_STATE_ACTIONS.SET_VALUE,
|
||||
oldState: {
|
||||
columns: [
|
||||
{name: 'id', cid: 'c123'}
|
||||
{name: 'id'}
|
||||
],
|
||||
},
|
||||
path: ['columns', 0, 'name'],
|
||||
value: 'id123',
|
||||
})).toEqual({
|
||||
columns: [{column: 'id123', column_cid: 'c123'}],
|
||||
columns: [{column: 'id123'}],
|
||||
});
|
||||
|
||||
state = {};
|
||||
|
||||
@@ -122,7 +122,7 @@ describe('PrimaryKeySchema', ()=>{
|
||||
|
||||
expect(getFieldDepChange(schemaObj, 'columns')(state, ['columns', 0], {
|
||||
columns: [
|
||||
{name: 'id123'}
|
||||
{name: 'id123', is_primary_key: true}
|
||||
],
|
||||
}, {
|
||||
type: SCHEMA_STATE_ACTIONS.SET_VALUE,
|
||||
|
||||
Reference in New Issue
Block a user