Skip to content

Instantly share code, notes, and snippets.

@gaurangrshah
Last active April 7, 2021 00:41
Show Gist options
  • Save gaurangrshah/d418e51629438941625e9173f31bfb76 to your computer and use it in GitHub Desktop.
Save gaurangrshah/d418e51629438941625e9173f31bfb76 to your computer and use it in GitHub Desktop.
Helpful sql statements / queries
CREATE TYPE enum_name AS ENUM ('value1', 'value2', 'value3', 'value4');
-- DROP TYPE admin_level1;
ALTER SEQUENCE media_id_seq RESTART WITH 1
-- resets auto table id generator count
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