aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema_dumper_test.rb
diff options
context:
space:
mode:
authorMichael Koziarski <michael@koziarski.com>2007-10-25 06:42:05 +0000
committerMichael Koziarski <michael@koziarski.com>2007-10-25 06:42:05 +0000
commit2d208eb3a09bf5b091464b7a4bbd00647eb7dfb2 (patch)
treeb20f2f43f2341cca157320c56335ded5f72bc45f /activerecord/test/schema_dumper_test.rb
parent12d8d48b7132e0467b477e6a88931840188f6c61 (diff)
downloadrails-2d208eb3a09bf5b091464b7a4bbd00647eb7dfb2.tar.gz
rails-2d208eb3a09bf5b091464b7a4bbd00647eb7dfb2.tar.bz2
rails-2d208eb3a09bf5b091464b7a4bbd00647eb7dfb2.zip
Make sure that the Schema Dumper supports non-standard primary keys with MySQL. Closes #9971 [RubyRedRick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8012 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/schema_dumper_test.rb')
-rw-r--r--activerecord/test/schema_dumper_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/schema_dumper_test.rb b/activerecord/test/schema_dumper_test.rb
index fa2b8bdf24..c6041e4f5c 100644
--- a/activerecord/test/schema_dumper_test.rb
+++ b/activerecord/test/schema_dumper_test.rb
@@ -110,6 +110,13 @@ if ActiveRecord::Base.connection.respond_to?(:tables)
output = standard_dump
assert_match %r{t.text\s+"body",\s+:default => "",\s+:null => false$}, output
end
+
+ def test_mysql_schema_dump_should_honor_nonstandard_primary_keys
+ output = standard_dump
+ match = output.match(%r{create_table "movies"(.*)do})
+ assert_not_nil(match, "nonstandardpk table not found")
+ assert_match %r(:primary_key => "movieid"), match[1], "non-standard primary key not preserved"
+ end
end
def test_schema_dump_includes_decimal_options