Skip to content

Commit

Permalink
fix: dependent field queries not printing the org id
Browse files Browse the repository at this point in the history
  • Loading branch information
JustARatherRidiculouslyLongUsername committed Dec 12, 2024
1 parent ba48fed commit 7ccc6e0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scripts/sql/reset_db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,16 @@ BEGIN
GET DIAGNOSTICS rcount = ROW_COUNT;
RAISE NOTICE 'Deleted % users', rcount;

_org_id := (SELECT org_id FROM workspaces WHERE id = _workspace_id);

DELETE
FROM workspaces w
WHERE w.id = _workspace_id;
GET DIAGNOSTICS rcount = ROW_COUNT;
RAISE NOTICE 'Deleted % workspaces', rcount;

_org_id := (SELECT fyle_org_id FROM workspaces WHERE id = _workspace_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;
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
Expand Down

0 comments on commit 7ccc6e0

Please sign in to comment.