lemmy/migrations/2022-09-07-113813_drop_ccnew_indexes_function/up.sql

22 lines
361 B
MySQL
Raw Normal View History

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;