Skip to content

Commit

Permalink
fix: raise notice to delete dependent fields after workspace reset (#583
Browse files Browse the repository at this point in the history
)

* fix: raise notice to delete dependent fields after workspace reset

* refactor: squish query to a one-liner
  • Loading branch information
1 parent e1f7f3c commit 609d157
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/sql/functions/delete-workspace.sql
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ BEGIN
RAISE NOTICE E'\n\n\n\n\n\n\n\n\nSwitch to prod db and run the below query to update the subscription';
RAISE NOTICE E'begin; update platform_schema.admin_subscriptions set is_enabled = false where org_id = ''%'';\n\n\n\n\n\n\n\n\n\n\n', _org_id;

RAISE NOTICE E'\n\n\n\n\n\n\n\n\nSwitch to prod db and run the below queries to delete dependent fields';
RAISE NOTICE E'rollback;begin; delete from platform_schema.dependent_expense_field_mappings where expense_field_id in (select id from platform_schema.expense_fields where org_id =''%'' and type=''DEPENDENT_SELECT''); delete from platform_schema.expense_fields where org_id = ''%'' and type = ''DEPENDENT_SELECT'';\n\n\n\n\n\n\n\n\n\n\n', _org_id, _org_id;


RETURN;
END
$$ LANGUAGE plpgsql;

0 comments on commit 609d157

Please sign in to comment.