Domanda

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 :)

È stato utile?

Soluzione

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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top