Last active
April 7, 2021 00:41
-
-
Save gaurangrshah/d418e51629438941625e9173f31bfb76 to your computer and use it in GitHub Desktop.
Helpful sql statements / queries
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
CREATE TYPE enum_name AS ENUM ('value1', 'value2', 'value3', 'value4'); | |
-- DROP TYPE admin_level1; |
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
ALTER SEQUENCE media_id_seq RESTART WITH 1 | |
-- resets auto table id generator count |
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
TRUNCATE TABLE table_name; | |
-- removes table content as long as it is not being refrenced by another table. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment