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">
<select
className="input-sm form-control"
value={
selectedProperties[colName].uniqueConstraint ? 'true' : 'false'
}
value={selectedProperties[colName].isUnique}
onChange={toggleColumnUnique}
disabled={columnProperties.pkConstraint}
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,
isNullable: col.is_nullable === 'YES',
pkConstraint: columnPKConstraints[colName],
uniqueConstraint: columnUniqueConstraints[colName],
isUnique: columnUniqueConstraints[colName] ? true : false,
// uniqueConstraint: columnUniqueConstraints[colName],
default: col.column_default || '',
};
@ -85,7 +86,7 @@ const ColumnEditorList = ({
propertiesList.push('primary key');
}
if (columnProperties.uniqueConstraint) {
if (columnProperties.isUnique) {
propertiesList.push('unique');
}