Hell, I'm following in Hartl's Ruby on Rails tutorial and I'm on chapter 9 adding administrative control to users.
I'm at the part where it says
reset the database:
$ bundle exec rake db:migrate:reset
$ bundle exec rake db:seed
Last time I followed this (much earlier in the tutorial), it reset the database as instructed but also deleted me schema.rb. Which was annoying.
Attempted it again, and yet again it deleted my database and erased my schema.rb. Surely this is not intended.
I'm having trouble figuring out what I should be doing anymore. I'm now getting all kinds of errors with my database. I get errors about pending migrations, but no db:xxx command works, every command just spits out this long list of errors such as
/Users/Ke0/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:994:in `execute_migration_in_transaction'
/Users/Ke0/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:956:in `block in migrate'
/Users/Ke0/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:952:in `each'
/Users/Ke0/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:952:in `migrate'
/Users/Ke0/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:820:in `up'
/Users/Ke0/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/migration.rb:798:in `migrate'
/Users/Ke0/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:137:in `migrate'
/Users/Ke0/.rvm/gems/ruby-2.2.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
Tasks: TOP => db:migrate
What does one do in such a situation?
Aucun commentaire:
Enregistrer un commentaire