-
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.
test: add reset script to improve dev workflow
- Loading branch information
1 parent
84685f7
commit 396625c
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
-- KeyHippo Database Reset Script | ||
-- Drop schemas | ||
DROP TABLE IF EXISTS public.test_accounts CASCADE; | ||
|
||
DROP SCHEMA IF EXISTS keyhippo CASCADE; | ||
|
||
DROP SCHEMA IF EXISTS keyhippo_internal CASCADE; | ||
|
||
DROP SCHEMA IF EXISTS keyhippo_rbac CASCADE; | ||
|
||
DROP SCHEMA IF EXISTS keyhippo_impersonation CASCADE; | ||
|
||
-- Drop custom types | ||
DROP TYPE IF EXISTS keyhippo.app_permission CASCADE; | ||
|
||
DROP TYPE IF EXISTS keyhippo.app_role CASCADE; | ||
|
||
-- Delete all rows from auth.users | ||
DELETE FROM auth.users; | ||
|
||
-- Drop the trigger on auth.users | ||
DROP TRIGGER IF EXISTS assign_default_role_trigger ON auth.users; | ||
|
||
-- Notify PostgREST to reload configuration | ||
NOTIFY pgrst, | ||
'reload config'; |