Created
May 23, 2025 02:18
-
-
Save sawirricardo/e1b45302804fa19b527607093fafcea0 to your computer and use it in GitHub Desktop.
better alternative and more efficient db:wipe for postgres
This file contains hidden or 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 is more efficient than cleaning views, tables and types like `db:wipe` does. | |
--This cleans up the whole schema, removing custom functions as well. | |
DROP SCHEMA public CASCADE; | |
CREATE SCHEMA public; | |
GRANT ALL ON SCHEMA public TO postgres; | |
GRANT ALL ON SCHEMA public TO public; | |
COMMENT ON SCHEMA public IS 'standard public schema'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment