Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I recreate Schema.rb (after deleting) in Ruby on Rails?

I deleted my Schema.rb by mistake (sort of) and I can't seem to be able to regenerate it into db/ by using rake db:dump, I don't really know what to do at this point.

Some suggested rake db:dump:all rake db:create:all rake db:migrate

Nothing worked. Please help!

like image 699
Jason Procka Avatar asked Feb 28 '16 23:02

Jason Procka


2 Answers

Try running bundle exec rake db:schema:dump.

Refer to Active Record Migrations for more info.

like image 157
Dharam Gollapudi Avatar answered Sep 22 '22 18:09

Dharam Gollapudi


You could try

rake db:drop db:create db:migrate

That should do it. If you're not getting any errors and the schema file is not being regenerated, then something is potentially wacky with your local environment.

like image 34
Josh Deeden Avatar answered Sep 20 '22 18:09

Josh Deeden