diff --git a/forward_engineering/configs/templates.js b/forward_engineering/configs/templates.js index a4fa707..0e30c4b 100644 --- a/forward_engineering/configs/templates.js +++ b/forward_engineering/configs/templates.js @@ -17,8 +17,7 @@ module.exports = { 'CREATE${unique}${clustered}${columnstore} INDEX ${name}\n' + '\tON ${table}${keys}${include}${expression}${relational_index_option}${terminator}\n', - fullTextIndex: - 'CREATE FULLTEXT INDEX ON ${table} (\n\t${keys}\n)\nKEY INDEX ${indexName}\n${catalog}${options}${terminator}\n', + fullTextIndex: 'CREATE FULLTEXT INDEX ON ${table}\nKEY INDEX ${indexName}\n${catalog}${options}${terminator}\n', spatialIndex: 'CREATE SPATIAL INDEX ${name} ON ${table} (${column})${using}\n${options}${terminator}\n', diff --git a/forward_engineering/helpers/indexHelper.js b/forward_engineering/helpers/indexHelper.js index e907447..c533235 100644 --- a/forward_engineering/helpers/indexHelper.js +++ b/forward_engineering/helpers/indexHelper.js @@ -61,7 +61,7 @@ module.exports = app => { }; const createIndex = (terminator, tableName, index, isParentActivated = true) => { - const isInvalidColumnStore = index.type !== 'columnstore' || (index.type === 'columnstore' && index.clustered); + const isInvalidColumnStore = index.type !== 'columnstore' || (index.type === 'columnstore' && !index.clustered); if ((_.isEmpty(index.keys) && isInvalidColumnStore) || !index.name) { return ''; @@ -136,33 +136,35 @@ module.exports = app => { }; const createFullTextIndex = (terminator, tableName, index, isParentActivated) => { - if (_.isEmpty(index.keys) || !index.keyIndex) { + if (!index.keyIndex) { return ''; } const catalog = getFulltextCatalog(index); const options = getFullTextOptions(index); - return assignTemplates(templates.fullTextIndex, { - table: getTableName(tableName, index.schemaName), - keys: index.keys - .map(key => { - let column = `[${key.name}]`; + const keys = index.keys + .map(key => { + let column = `[${key.name}]`; - if (key.columnType) { - column += ` TYPE COLUMN ${key.columnType}`; - } + if (key.columnType) { + column += ` TYPE COLUMN ${key.columnType}`; + } - if (key.languageTerm) { - column += ` LANGUAGE ${key.languageTerm}`; - } + if (key.languageTerm) { + column += ` LANGUAGE ${key.languageTerm}`; + } - if (key.statisticalSemantics) { - column += ` STATISTICAL_SEMANTICS`; - } + if (key.statisticalSemantics) { + column += ` STATISTICAL_SEMANTICS`; + } - return isParentActivated ? commentIfDeactivated(column, key) : column; - }) - .join(',\n\t'), + return isParentActivated ? commentIfDeactivated(column, key) : column; + }) + .join(',\n\t'); + + return assignTemplates(templates.fullTextIndex, { + table: getTableName(tableName, index.schemaName), + keys: keys ? ` (\n\t${keys}\n)\n` : '', indexName: index.keyIndex, catalog: catalog ? `ON ${catalog}\n` : '', options: options ? `WITH (\n\t${options}\n)` : '', @@ -230,9 +232,9 @@ module.exports = app => { return createSpatialIndex(terminator, tableName, index); } else if (index.type === 'fulltext') { return createFullTextIndex(terminator, tableName, index); - } else { - return createIndex(terminator, tableName, index, isParentActivated); } + + return createIndex(terminator, tableName, index, isParentActivated); }; const createMemoryOptimizedClusteredIndex = indexData => { diff --git a/properties_pane/entity_level/entityLevelConfig.json b/properties_pane/entity_level/entityLevelConfig.json index a9776d1..f3465ce 100644 --- a/properties_pane/entity_level/entityLevelConfig.json +++ b/properties_pane/entity_level/entityLevelConfig.json @@ -886,8 +886,13 @@ making sure that you maintain a proper JSON format. "value": "Columnstore" }, { - "key": "clusteredIndx", - "value": false + "type": "not", + "values": [ + { + "key": "clusteredIndx", + "value": true + } + ] } ] }, @@ -1388,10 +1393,6 @@ making sure that you maintain a proper JSON format. "dependency": { "key": "indxType", "value": "FullText" - }, - "validation": { - "required": true, - "minLength": 1 } }, { @@ -1423,11 +1424,13 @@ making sure that you maintain a proper JSON format. { "propertyName": "Key index", "propertyKeyword": "indxFullTextKeyIndex", - "requiredProperty": true, "propertyType": "text", "dependency": { "key": "indxType", "value": "FullText" + }, + "validation": { + "required": true } }, {