On 23 August 2010 22:40, Zack Nathan <[email protected]> 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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.