]> Untitled Git - lemmy.git/blob - migrations/2022-09-07-113813_drop_ccnew_indexes_function/up.sql
add enable_federated_downvotes site option
[lemmy.git] / migrations / 2022-09-07-113813_drop_ccnew_indexes_function / up.sql
1 CREATE OR REPLACE FUNCTION drop_ccnew_indexes ()
2     RETURNS integer
3     AS $$
4 DECLARE
5     i RECORD;
6 BEGIN
7     FOR i IN (
8         SELECT
9             relname
10         FROM
11             pg_class
12         WHERE
13             relname LIKE '%ccnew%')
14         LOOP
15             EXECUTE 'DROP INDEX ' || i.relname;
16         END LOOP;
17     RETURN 1;
18 END;
19 $$
20 LANGUAGE plpgsql;
21