Just deleted my all my model tables by (Setting.delete_all). But when I create a new setting it starts from id 12. How do i delete the ids of the "deleted settings"? I want to delete everything so that I start from setting/1 when I create a new setting.

Help, thanks :)

有帮助吗?

解决方案

You will need to drop your table and then regenerate it using migration:

To drop table:

rake db:migrate:down VERSION="20130910082232"    #replace with version no. of your table migration

Then create it again:

rake db:migrate:up VERSION="20130910082232"      #replace with version no. of your table migration
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top