From 60d3e4be62c50b3fc025b2efa834ce9e4583247c Mon Sep 17 00:00:00 2001 From: Yevhenii Moroziuk Date: Thu, 5 Dec 2024 13:54:44 +0200 Subject: [PATCH] Revert "HCK-8971: include schema name in index name of DDL (#33)" (#34) This reverts commit 85d6bcb71bcc8cf29c0f194d51f60f1eda19c15b. --- forward_engineering/ddlProvider/ddlHelpers/indexHelper.js | 7 ------- forward_engineering/ddlProvider/ddlProvider.js | 7 ++----- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/forward_engineering/ddlProvider/ddlHelpers/indexHelper.js b/forward_engineering/ddlProvider/ddlHelpers/indexHelper.js index f7fba31..82d699c 100644 --- a/forward_engineering/ddlProvider/ddlHelpers/indexHelper.js +++ b/forward_engineering/ddlProvider/ddlHelpers/indexHelper.js @@ -13,12 +13,6 @@ module.exports = ({ _, wrapInQuotes, checkAllKeysDeactivated, getColumnsList }) return getColumnsList(columns, isAllColumnsDeactivated, isParentActivated, mapIndexKey); }; - const getIndexName = ({ name, schemaName }) => { - const indexName = wrapInQuotes(name); - - return schemaName ? `${wrapInQuotes(schemaName)}.${indexName}` : indexName; - }; - const getIndexOptions = (index, isParentActivated) => { const includeKeys = getColumnsList( index.include || [], @@ -67,6 +61,5 @@ module.exports = ({ _, wrapInQuotes, checkAllKeysDeactivated, getColumnsList }) return { getIndexKeys, getIndexOptions, - getIndexName, }; }; diff --git a/forward_engineering/ddlProvider/ddlProvider.js b/forward_engineering/ddlProvider/ddlProvider.js index 2e4c000..3f1360a 100644 --- a/forward_engineering/ddlProvider/ddlProvider.js +++ b/forward_engineering/ddlProvider/ddlProvider.js @@ -71,7 +71,7 @@ module.exports = (baseProvider, options, app) => { wrapComment, }); - const { getIndexKeys, getIndexOptions, getIndexName } = require('./ddlHelpers/indexHelper')({ + const { getIndexKeys, getIndexOptions } = require('./ddlHelpers/indexHelper')({ _, wrapInQuotes, checkAllKeysDeactivated, @@ -261,10 +261,7 @@ module.exports = (baseProvider, options, app) => { createIndex(tableName, index, dbData, isParentActivated = true) { const isUnique = index.unique && index.index_method === 'btree'; - const name = getIndexName({ - name: index.indxName, - schemaName: index.schemaName - }) + const name = wrapInQuotes(index.indxName); const unique = isUnique ? ' UNIQUE' : ''; const concurrently = index.concurrently ? ' CONCURRENTLY' : ''; const ifNotExist = index.ifNotExist ? ' IF NOT EXISTS' : '';