Fix an issue in table dialog where changing column name was not syncing table constraints appropriately. #7229

This commit is contained in:
Aditya Toshniwal
2024-03-08 11:45:32 +05:30
committed by GitHub
parent 134e651989
commit 7374997425
7 changed files with 34 additions and 27 deletions

View File

@@ -106,6 +106,7 @@ describe('ExclusionConstraintSchema', ()=>{
is_exp: true,
column: 'abc',
col_type: null,
column_cid: null,
});
});
});
@@ -125,14 +126,14 @@ describe('ExclusionConstraintSchema', ()=>{
});
it('depChange', ()=>{
let state = {columns: [{local_column: 'id'}]};
let state = {columns: [{column: 'id', column_cid: 'c123'}]};
schemaObj.top = new TableSchema({}, null);
expect(getFieldDepChange(schemaObj, 'columns')(state, ['columns', 0], null, {
type: SCHEMA_STATE_ACTIONS.DELETE_ROW,
oldState: {
columns: [
{name: 'id'}
{name: 'id', cid: 'c123'}
],
},
path: ['columns'],
@@ -143,19 +144,19 @@ describe('ExclusionConstraintSchema', ()=>{
expect(getFieldDepChange(schemaObj, 'columns')(state, ['columns', 0], {
columns: [
{name: 'id123'}
{name: 'id123', cid: 'c123'}
],
}, {
type: SCHEMA_STATE_ACTIONS.SET_VALUE,
oldState: {
columns: [
{name: 'id'}
{name: 'id', cid: 'c123'}
],
},
path: ['columns', 0, 'name'],
value: 'id123',
})).toEqual({
columns: [{local_column: 'id123'}],
columns: [{column: 'id123', column_cid: 'c123'}],
});
state = {};