简体   繁体   中英

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!

Try running bundle exec rake db:schema:dump .

Refer to Active Record Migrations for more info.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM