Skip to content

Commit

Permalink
avniproject/avni-etl#73 | Do not remove sync status rows when deletin…
Browse files Browse the repository at this point in the history
…g the schema. This can cause duplicate rows for the undeleted schema
  • Loading branch information
vinayvenu committed Oct 3, 2023
1 parent b575872 commit ee18818
Showing 1 changed file with 0 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ $$
BEGIN
execute 'set role ' || in_db_owner || ';';
execute 'drop schema if exists ' || in_impl_schema || ' cascade;';
execute 'delete from entity_sync_status where db_user = ''' || in_db_user || ''';';
execute 'delete from entity_sync_status where schema_name = ''' || in_impl_schema || ''';';
execute 'delete from index_metadata where table_metadata_id in (select id from table_metadata where schema_name = ''' || in_impl_schema || ''');';
execute 'delete from column_metadata where table_id in (select id from table_metadata where schema_name = ''' || in_impl_schema || ''');';
Expand All @@ -177,7 +176,6 @@ $$
BEGIN
EXECUTE 'set role openchs;';
execute 'drop schema ' || in_impl_schema || ' cascade;';
execute 'delete from entity_sync_status where db_user = ''' || in_db_user || ''';';
execute 'delete from entity_sync_status where schema_name = ''' || in_impl_schema || ''';';
execute 'delete from index_metadata where table_metadata_id in (select id from table_metadata where schema_name = ''' || in_impl_schema || ''');';
execute 'delete from column_metadata where table_id in (select id from table_metadata where schema_name = ''' || in_impl_schema || ''');';
Expand Down

0 comments on commit ee18818

Please sign in to comment.