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:
Anil Sahoo
2024-06-17 14:07:45 +05:30
committed by GitHub
parent 5866da8194
commit a946c70869
8 changed files with 28 additions and 30 deletions

View File

@@ -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 = {};

View File

@@ -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,