1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

View file

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

View file

@ -18,4 +18,9 @@ class Mysql2EnumTest < ActiveRecord::Mysql2TestCase
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

View file

@ -62,7 +62,7 @@ SQL
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