-
-
Notifications
You must be signed in to change notification settings - Fork 885
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding job to drop phantom ccnew indexes. Fixes #2431
- Loading branch information
1 parent
3f2a689
commit 2c1fdbd
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
migrations/2022-09-07-113813_drop_ccnew_indexes_function/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
drop function drop_ccnew_indexes; |
13 changes: 13 additions & 0 deletions
13
migrations/2022-09-07-113813_drop_ccnew_indexes_function/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CREATE OR REPLACE FUNCTION drop_ccnew_indexes() RETURNS INTEGER AS $$ | ||
DECLARE | ||
i RECORD; | ||
BEGIN | ||
FOR i IN | ||
(SELECT relname FROM pg_class WHERE relname like '%ccnew%') | ||
LOOP | ||
EXECUTE 'DROP INDEX ' || i.relname; | ||
END LOOP; | ||
RETURN 1; | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters