Skip to content

Instantly share code, notes, and snippets.

@joshsusser
Created February 17, 2012 23:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshsusser/1856323 to your computer and use it in GitHub Desktop.
Save joshsusser/1856323 to your computer and use it in GitHub Desktop.
Reset PKs in postgresql
tables = ActiveRecord::Base.connection.tables
tables.delete(ActiveRecord::Migrator.schema_migrations_table_name)
tables.each { |table| ActiveRecord::Base.connection.reset_pk_sequence!(table) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment