ruby on rails - rake db:migrate:reset to dump schema -
hell, i'm following in hartl's ruby on rails tutorial , i'm on chapter 9 adding administrative control users.
i'm @ part says
reset database:
$ bundle exec rake db:migrate:reset $ bundle exec rake db:seed
last time followed (much earlier in tutorial), reset database instructed deleted me schema.rb. annoying.
attempted again, , yet again deleted database , erased schema.rb. surely not intended.
i'm having trouble figuring out should doing anymore. i'm getting kinds of errors database. errors pending migrations, no db:xxx command works, every command spits out 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 1 in such situation?
try verify following :-
- you have db username/password mentioned in database.yml
- you have db empty
- when run
rake db:migrate
,thenschema.rb
getting generated - you have valid
database.yml
file
Comments
Post a Comment