Skip to content

Commit

Permalink
HSC-218: Syntax corrections to run migration scripts on postgresql DB. (
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruhanga authored Feb 15, 2024
1 parent b35b9e4 commit 081f1b1
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions development/liquibase/odoo/sql/function_replicaIdentity.sql
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
DROP FUNCTION IF EXISTS replicaIdentity;
DROP FUNCTION IF EXISTS replicaIdentity(text[]);

GO

CREATE FUNCTION replicaIdentity(tables text []) RETURNS void AS $$
DECLARE m text;
BEGIN
FOREACH m IN ARRAY tables
LOOP
EXECUTE format($fmt$
ALTER TABLE %I REPLICA IDENTITY FULL;
$fmt$, m);
END LOOP;
END;
$$ LANGUAGE plpgsql;

GO
CREATE OR REPLACE FUNCTION replicaIdentity(tables text[]) RETURNS void AS $$
DECLARE
m text;
BEGIN
FOREACH m IN ARRAY tables
LOOP
EXECUTE format($fmt$
ALTER TABLE %I REPLICA IDENTITY FULL;
$fmt$, m);
END LOOP;
END;
$$ LANGUAGE plpgsql;

0 comments on commit 081f1b1

Please sign in to comment.