Im using restful authentication, and i changed the username model from login to username. The error is Mysql::Error: Key column ''login'' doesn''t exist in table: CREATE UNIQUE INDEX `index_users_on_login` Heres the trace: DEPRECATION WARNING: Rake tasks in vendor/plugins/restful-authentication/tasks are deprecated. Use lib/tasks instead. (called from /Users/Zack/.gem/ruby/1.8/gems/rails-2.3.8/lib/tasks/rails.rb:10) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate == CreateUsers: migrating ===================================================-- create_table("users", {:force=>true}) -> 0.1138s -- add_index(:users, :login, {:unique=>true}) rake aborted! An error has occurred, all later migrations canceled: Mysql::Error: Key column ''login'' doesn''t exist in table: CREATE UNIQUE INDEX `index_users_on_login` ON `users` (`login`) /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract_adapter.rb:221:in `log'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/mysql_adapter.rb:323:in `execute'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract/schema_statements.rb:291:in `add_index'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:352:in `send'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:352:in `method_missing'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:328:in `say_with_time'' /opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:328:in `say_with_time'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:348:in `method_missing'' ./db/migrate//20100823072211_create_users.rb:21:in `up_without_benchmarks'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:282:in `send'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:282:in `migrate'' /opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:282:in `migrate'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:365:in `__send__'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:365:in `migrate'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:491:in `migrate'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:567:in `call'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:567:in `ddl_transaction'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:490:in `migrate'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:477:in `each'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:477:in `migrate'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:401:in `up'' /Users/Zack/.gem/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/migration.rb:383:in `migrate'' /Users/Zack/.gem/ruby/1.8/gems/rails-2.3.8/lib/tasks/databases.rake:112 /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'' /opt/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'' /opt/local/lib/ruby/gems/1.8/gems/rake-0.8.7/bin/rake:31 /opt/local/bin/rake:19:in `load'' /opt/local/bin/rake:19 -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 23 August 2010 22:40, Zack Nathan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Im using restful authentication, and i changed the username model from > login to username. The error is Mysql::Error: Key column ''login'' doesn''t > exist in table: CREATE UNIQUE INDEX `index_users_on_login` Heres the > trace:If you are only just starting with Resful Authentication I would suggest not doing this, it is generally considered not the best nowadays. Have a look at Authlogic instead.> > DEPRECATION WARNING: Rake tasks in > vendor/plugins/restful-authentication/tasks are deprecated. Use > lib/tasks instead. (called from > /Users/Zack/.gem/ruby/1.8/gems/rails-2.3.8/lib/tasks/rails.rb:10) > ** Invoke db:migrate (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute db:migrate > == CreateUsers: migrating > ===================================================> -- create_table("users", {:force=>true}) > -> 0.1138s > -- add_index(:users, :login, {:unique=>true}) > rake aborted! > An error has occurred, all later migrations canceled: > > Mysql::Error: Key column ''login'' doesn''t exist in table: CREATE UNIQUE > INDEX `index_users_on_login` ON `users` (`login`)In the migration have you added the login field to the database? This must be done before adding the index. The clue is in the error message. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Seemingly Similar Threads
- Rails 3 bug: undefined method `<=>' for class `ActiveSupport::Multibyte::Chars'
- Beginner Facing Problem with rake db:migrate
- rake:db:prepare Mysql::Error: #42000BLOB/TEXT column ' used in key specification without a length
- wrong argument type Mysql (expected Struct) running rake with Ruby 1.9 / Rails 2.3.3
- Rake Aborted! db:migrate