Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running the migration from page 126 throws an error #6

Open
lifeBalance opened this issue Nov 21, 2015 · 0 comments
Open

Running the migration from page 126 throws an error #6

lifeBalance opened this issue Nov 21, 2015 · 0 comments

Comments

@lifeBalance
Copy link

When I try to run this migration:

class AddIndexToLinks < ActiveRecord::Migration
  def change
    add_index :links, :cl_sortkey
  end
end

I get the following error:

$ bundle exec rake db:migrate
== 20151121175520 AddIndexToLinks: migrating ==================================
-- add_index(:links, :cl_sortkey)
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

Mysql2::Error: BLOB/TEXT column 'cl_sortkey' used in key specification without a key length: CREATE  INDEX `index_links_on_cl_sortkey`  ON `links` (`cl_sortkey`) /Users/javi/.gem/ruby/2.2.2/gems/mysql2-0.4.1/lib/mysql2/client.rb:85:in `_query'

Maybe has something to do with having populated my db from the seeds file, instead of the dumps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant