$ ActiveRecord::Base.connection.reset_pk_sequence!('table_name')
If you need the table names:
$ ActiveRecord::Base.connection.tables
=> ["accounts", "assets", ...]
$ ActiveRecord::Base.connection.reset_pk_sequence!('table_name')
If you need the table names:
$ ActiveRecord::Base.connection.tables
=> ["accounts", "assets", ...]
2021, here for get help