console: allow dropping indices on all schemas

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/2560
GitOrigin-RevId: f79fbbecbc4b7d9d9a64f7c8f2f9e36487b77158
This commit is contained in:
Ikechukwu Eze 2021-10-20 15:26:03 +01:00 committed by hasura-bot
parent 8acd35c2e7
commit 9015b354ac
4 changed files with 14 additions and 5 deletions

View File

@ -1,6 +1,15 @@
# Hasura GraphQL Engine Changelog
## Next release
(Add entries below in the order of server, console, cli, docs, others)
- server: fix bug which recreated event triggers every time the graphql-engine started up
- server: fix bug in OpenAPI when multiple REST endpoints have the same URL path but different method
- console: design cleanup Modify and Add Table forms (close #7454)
- console: enable custom graphql root fields for mssql under modify tab
- console: allow dropping indices on all schemas
- cli: split remote schema permissions metadata into seperate files (#7033)
### Function field names customization (#7405)
It is now possible to specify the GraphQL names of tracked SQL functions in

View File

@ -2112,7 +2112,7 @@ const saveIndex = (indexInfo, successCb, errorCb) => (dispatch, getState) => {
indexType: indexInfo?.index_type,
unique: indexInfo?.unique,
});
const downSql = dataSource.dropIndexSql(indexInfo?.index_name);
const downSql = dataSource.dropIndexSql(indexInfo?.index_name, currentSchema);
upQueries.push(getRunSqlQuery(upSql, currentDataSource));
downQueries.push(getRunSqlQuery(downSql, currentDataSource));
@ -2161,7 +2161,7 @@ const removeIndex = (indexInfo, successCb, errorCb) => (dispatch, getState) => {
const upQueries = [];
const downQueries = [];
const upSql = dataSource.dropIndexSql(indexInfo?.index_name);
const upSql = dataSource.dropIndexSql(indexInfo?.index_name, currentSchema);
const downSql = dataSource.createIndexSql({
indexName: indexInfo?.index_name,
indexType: indexInfo?.index_type,

View File

@ -344,7 +344,7 @@ export interface DataSourcesAPI {
columns: string[];
unique?: boolean;
}) => string;
dropIndexSql?: (indexName: string) => string;
dropIndexSql?: (indexName: string, schema: string) => string;
indexFormToolTips?: IndexFormToolTips;
indexTypes?: Record<string, IndexType>;
supportedIndex?: {

View File

@ -1101,8 +1101,8 @@ export const getCreateIndexSql = (indexObj: {
`;
};
export const getDropIndexSql = (indexName: string) =>
`DROP INDEX IF EXISTS "${indexName}"`;
export const getDropIndexSql = (indexName: string, schema: string) =>
`DROP INDEX IF EXISTS "${schema}"."${indexName}"`;
export const frequentlyUsedColumns: FrequentlyUsedColumn[] = [
{