Skip to content

Commit

Permalink
Revert "HCK-8971: include schema name in index name of DDL (#33)" (#34)
Browse files Browse the repository at this point in the history
This reverts commit 85d6bcb.
  • Loading branch information
Nightlngale authored Dec 5, 2024
1 parent 85d6bcb commit 60d3e4b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
7 changes: 0 additions & 7 deletions forward_engineering/ddlProvider/ddlHelpers/indexHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 || [],
Expand Down Expand Up @@ -67,6 +61,5 @@ module.exports = ({ _, wrapInQuotes, checkAllKeysDeactivated, getColumnsList })
return {
getIndexKeys,
getIndexOptions,
getIndexName,
};
};
7 changes: 2 additions & 5 deletions forward_engineering/ddlProvider/ddlProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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' : '';
Expand Down

0 comments on commit 60d3e4b

Please sign in to comment.