Skip to content

Commit

Permalink
Fix error in SQL installation scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mdouchin committed May 28, 2020
1 parent 3b71c83 commit c64132c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 25 deletions.
20 changes: 8 additions & 12 deletions lizsync/install/sql/lizsync/10_FUNCTION.sql
Original file line number Diff line number Diff line change
Expand Up @@ -386,12 +386,10 @@ BEGIN
Coalesce(
lizsync.get_event_sql(
a.event_id,
''%2$s'',
array_to_string(
array_cat(
string_to_array(''%3$s'',''@''),
array_remove(akeys(a.changed_fields), s)
), '',''
''%2$s''::text,
array_cat(
string_to_array(''%3$s'',''@''),
array_remove(akeys(a.changed_fields), s)
)
),
''''
Expand Down Expand Up @@ -477,12 +475,10 @@ BEGIN
Coalesce(
lizsync.get_event_sql(
a.event_id,
p_uid_field,
array_to_string(
array_cat(
p_excluded_columns,
array_remove(akeys(a.changed_fields), s)
), ','
p_uid_field::text,
array_cat(
p_excluded_columns,
array_remove(akeys(a.changed_fields), s)
)
),
''
Expand Down
21 changes: 8 additions & 13 deletions lizsync/install/sql/upgrade/upgrade_to_0.4.1.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
BEGIN;

DROP FUNCTION IF EXISTS lizsync.get_event_sql(target text, pevent_id bigint, puid_column text, excluded_columns text);

CREATE OR REPLACE FUNCTION lizsync.get_event_sql(pevent_id bigint, puid_column text, excluded_columns text[]) RETURNS text
LANGUAGE plpgsql
AS $$
Expand Down Expand Up @@ -173,12 +172,10 @@ BEGIN
Coalesce(
lizsync.get_event_sql(
a.event_id,
''%2$s'',
array_to_string(
array_cat(
string_to_array(''%3$s'',''@''),
array_remove(akeys(a.changed_fields), s)
), '',''
''%2$s''::text,
array_cat(
string_to_array(''%3$s'',''@''),
array_remove(akeys(a.changed_fields), s)
)
),
''''
Expand Down Expand Up @@ -263,12 +260,10 @@ BEGIN
Coalesce(
lizsync.get_event_sql(
a.event_id,
p_uid_field,
array_to_string(
array_cat(
p_excluded_columns,
array_remove(akeys(a.changed_fields), s)
), ','
p_uid_field::text,
array_cat(
p_excluded_columns,
array_remove(akeys(a.changed_fields), s)
)
),
''
Expand Down

0 comments on commit c64132c

Please sign in to comment.