diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2015-10-15 04:43:32 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2015-10-15 05:38:43 +0900 |
commit | f8438ae336f8f7d38c83a178d6ab6a9af635ee6c (patch) | |
tree | b447a66946204d2f341b53607aaaa0b3977277d4 /activerecord/test/cases | |
parent | de732e0015b356507b7c3554bcce2aa8818626c7 (diff) | |
download | rails-f8438ae336f8f7d38c83a178d6ab6a9af635ee6c.tar.gz rails-f8438ae336f8f7d38c83a178d6ab6a9af635ee6c.tar.bz2 rails-f8438ae336f8f7d38c83a178d6ab6a9af635ee6c.zip |
Fix to correctly schema dump the `tinyblob`
Currently `tinyblob` is dumped to `t.binary "tiny_blob", limit: 255`.
But `t.binary ... limit: 255` is generating SQL to `varchar(255)`.
It is incorrect. This commit fixes this problem.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/adapters/mysql/sql_types_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/adapters/mysql2/sql_types_test.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/schema_dumper_test.rb | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/adapters/mysql/sql_types_test.rb b/activerecord/test/cases/adapters/mysql/sql_types_test.rb index 25b28de7f0..d18579f242 100644 --- a/activerecord/test/cases/adapters/mysql/sql_types_test.rb +++ b/activerecord/test/cases/adapters/mysql/sql_types_test.rb @@ -4,7 +4,7 @@ class MysqlSqlTypesTest < ActiveRecord::MysqlTestCase def test_binary_types assert_equal 'varbinary(64)', type_to_sql(:binary, 64) assert_equal 'varbinary(4095)', type_to_sql(:binary, 4095) - assert_equal 'blob(4096)', type_to_sql(:binary, 4096) + assert_equal 'blob', type_to_sql(:binary, 4096) assert_equal 'blob', type_to_sql(:binary) end diff --git a/activerecord/test/cases/adapters/mysql2/sql_types_test.rb b/activerecord/test/cases/adapters/mysql2/sql_types_test.rb index ae505d29c9..4926bc2267 100644 --- a/activerecord/test/cases/adapters/mysql2/sql_types_test.rb +++ b/activerecord/test/cases/adapters/mysql2/sql_types_test.rb @@ -4,7 +4,7 @@ class Mysql2SqlTypesTest < ActiveRecord::Mysql2TestCase def test_binary_types assert_equal 'varbinary(64)', type_to_sql(:binary, 64) assert_equal 'varbinary(4095)', type_to_sql(:binary, 4095) - assert_equal 'blob(4096)', type_to_sql(:binary, 4096) + assert_equal 'blob', type_to_sql(:binary, 4096) assert_equal 'blob', type_to_sql(:binary) end diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb index feb1c29656..2a2c2bc8d0 100644 --- a/activerecord/test/cases/schema_dumper_test.rb +++ b/activerecord/test/cases/schema_dumper_test.rb @@ -215,7 +215,7 @@ class SchemaDumperTest < ActiveRecord::TestCase def test_schema_dump_includes_length_for_mysql_blob_and_text_fields output = standard_dump - assert_match %r{t\.binary\s+"tiny_blob",\s+limit: 255$}, output + assert_match %r{t\.blob\s+"tiny_blob",\s+limit: 255$}, output assert_match %r{t\.binary\s+"normal_blob",\s+limit: 65535$}, output assert_match %r{t\.binary\s+"medium_blob",\s+limit: 16777215$}, output assert_match %r{t\.binary\s+"long_blob",\s+limit: 4294967295$}, output |