Skip to content

Instantly share code, notes, and snippets.

View Rukosenpa's full-sized avatar
🏠
Working from home

Rukosenpa

🏠
Working from home
  • Russia, Krasnoyarsk
View GitHub Profile
@paulsturgess
paulsturgess / reset_primary_key.md
Created February 27, 2013 19:49
Reset postgres primary key index using Rails
$ ActiveRecord::Base.connection.reset_pk_sequence!('table_name')

If you need the table names:

$ ActiveRecord::Base.connection.tables

=> ["accounts", "assets", ...]