Fix bigint? for Enum columns in MySQL

Follow up to #22896.
This commit is contained in:
Ryuta Kamizono 2016-01-31 01:07:02 +09:00
parent c4d85dfbc7
commit d0054b4908
3 changed files with 7 additions and 2 deletions

@ -30,7 +30,7 @@ def has_default?
end
def bigint?
/bigint/ === sql_type
/\Abigint\b/ === sql_type
end
# Returns the human name of the column name.

@ -18,4 +18,9 @@ def test_should_not_be_unsigned
column = EnumTest.columns_hash['enum_column']
assert_not column.unsigned?
end
def test_should_not_be_bigint
column = EnumTest.columns_hash['enum_column']
assert_not column.bigint?
end
end

@ -62,7 +62,7 @@
ActiveRecord::Base.connection.execute <<-SQL
CREATE TABLE enum_tests (
enum_column ENUM('text','blob','tiny','medium','long','unsigned')
enum_column ENUM('text','blob','tiny','medium','long','unsigned','bigint')
)
SQL
end