Can't get column collate option to work with MySQL #445

Closed
myronmarston opened this Issue Feb 25, 2012 · 3 comments

Comments

Projects
None yet
2 participants

It appears that sequel supports a column collate option:

https://github.com/jeremyevans/sequel/blob/a7e05a408e0b99a08c3161e46d1d61bea30333ce/spec/core/schema_spec.rb#L266-270

However, when I try the same syntax in my migration using MySQL and the MySQL2 gem:

require 'sequel'

Sequel.migration do
  change do
    create_table(:cats) do
      varchar :name, :collate => :utf8_bin
    end
  end
end

...then the collate option is ignored. Here's the table definition that MySQL tells me was run:

CREATE TABLE `cats` (
  `name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Owner

jeremyevans commented Feb 25, 2012

This is because collate support was added after the mysql adapter overrode the column definition order, and collate never got added. It's a simple change, I'll push a fix soon.

Owner

jeremyevans commented Feb 25, 2012

Fixed by 0f73864

That was fast. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment