From c1abe4430684512709976f66634903a4dc147d03 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sun, 2 Mar 2008 04:42:10 +0000 Subject: Make the mysql schema dumper roundtrip the limits of text/blob columns. Closes #7424 [will.bryant] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8969 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/cases/schema_dumper_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'activerecord/test/cases/schema_dumper_test.rb') diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb index 8413fce3fa..d96bd62e56 100644 --- a/activerecord/test/cases/schema_dumper_test.rb +++ b/activerecord/test/cases/schema_dumper_test.rb @@ -115,6 +115,18 @@ if ActiveRecord::Base.connection.respond_to?(:tables) assert_not_nil(match, "nonstandardpk table not found") assert_match %r(:primary_key => "movieid"), match[1], "non-standard primary key not preserved" end + + 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.binary\s+"normal_blob"$}, output + assert_match %r{t.binary\s+"medium_blob",\s+:limit => 16777215$}, output + assert_match %r{t.binary\s+"long_blob",\s+:limit => 2147483647$}, output + assert_match %r{t.text\s+"tiny_text",\s+:limit => 255$}, output + assert_match %r{t.text\s+"normal_text"$}, output + assert_match %r{t.text\s+"medium_text",\s+:limit => 16777215$}, output + assert_match %r{t.text\s+"long_text",\s+:limit => 2147483647$}, output + end end def test_schema_dump_includes_decimal_options -- cgit v1.2.3