-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f97b83
commit c5a9007
Showing
1 changed file
with
22 additions
and
1 deletion.
There are no files selected for viewing
23 changes: 22 additions & 1 deletion
23
backend/migrations/000035_add_contract_permissions.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,22 @@ | ||
DROP TABLE IF EXISTS Contracts; | ||
DO $$ | ||
DECLARE | ||
permission_id INT; | ||
BEGIN | ||
-- Revert 'Invest in the certificate' | ||
SELECT id INTO permission_id FROM Permission WHERE name = 'Invest in the certificate'; | ||
DELETE FROM RolePermissionJunction WHERE permission_id = permission_id; | ||
DELETE FROM Operation WHERE permission_id = permission_id; | ||
DELETE FROM Permission WHERE id = permission_id; | ||
|
||
-- Revert 'Create wallet' | ||
SELECT id INTO permission_id FROM Permission WHERE name = 'Create wallet'; | ||
DELETE FROM RolePermissionJunction WHERE permission_id = permission_id; | ||
DELETE FROM Operation WHERE permission_id = permission_id; | ||
DELETE FROM Permission WHERE id = permission_id; | ||
|
||
-- Revert 'Create certificates' | ||
SELECT id INTO permission_id FROM Permission WHERE name = 'Create certificates'; | ||
DELETE FROM RolePermissionJunction WHERE permission_id = permission_id; | ||
DELETE FROM Operation WHERE permission_id = permission_id; | ||
DELETE FROM Permission WHERE id = permission_id; | ||
END $$; |