fix set column as unique bug (close #2096) (#2108)

This commit is contained in:
Rikin Kachhia 2019-05-03 13:10:27 +05:30 committed by GitHub
parent c87940ae42
commit b24456788c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -183,9 +183,7 @@ const ColumnEditor = ({
<div className="col-xs-6"> <div className="col-xs-6">
<select <select
className="input-sm form-control" className="input-sm form-control"
value={ value={selectedProperties[colName].isUnique}
selectedProperties[colName].uniqueConstraint ? 'true' : 'false'
}
onChange={toggleColumnUnique} onChange={toggleColumnUnique}
disabled={columnProperties.pkConstraint} disabled={columnProperties.pkConstraint}
data-test="edit-col-unique" data-test="edit-col-unique"

View File

@ -50,7 +50,8 @@ const ColumnEditorList = ({
type: col.data_type !== 'USER-DEFINED' ? col.data_type : col.udt_name, type: col.data_type !== 'USER-DEFINED' ? col.data_type : col.udt_name,
isNullable: col.is_nullable === 'YES', isNullable: col.is_nullable === 'YES',
pkConstraint: columnPKConstraints[colName], pkConstraint: columnPKConstraints[colName],
uniqueConstraint: columnUniqueConstraints[colName], isUnique: columnUniqueConstraints[colName] ? true : false,
// uniqueConstraint: columnUniqueConstraints[colName],
default: col.column_default || '', default: col.column_default || '',
}; };
@ -85,7 +86,7 @@ const ColumnEditorList = ({
propertiesList.push('primary key'); propertiesList.push('primary key');
} }
if (columnProperties.uniqueConstraint) { if (columnProperties.isUnique) {
propertiesList.push('unique'); propertiesList.push('unique');
} }