aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorTristan Dunn <tristanzdunn@gmail.com>2009-08-08 18:29:20 -0400
committerJeremy Kemper <jeremy@bitsweat.net>2009-08-08 19:31:35 -0700
commit791cccaedab9c3e975b00135db76047ad4435611 (patch)
treefaed7fae067004603c289f4a0cc2d63c5b2592ff /activerecord/test
parent4b7f95eb8b45a32c470a414c7f536fb8cb029bda (diff)
downloadrails-791cccaedab9c3e975b00135db76047ad4435611.tar.gz
rails-791cccaedab9c3e975b00135db76047ad4435611.tar.bz2
rails-791cccaedab9c3e975b00135db76047ad4435611.zip
Don't define a default primary key in the schema dumper.
[#1908 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/schema_dumper_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb
index 4f8e20b3ba..e6a77f626b 100644
--- a/activerecord/test/cases/schema_dumper_test.rb
+++ b/activerecord/test/cases/schema_dumper_test.rb
@@ -205,4 +205,12 @@ class SchemaDumperTest < ActiveRecord::TestCase
assert_match %r{t.decimal\s+"atoms_in_universe",\s+:precision => 55,\s+:scale => 0}, output
end
end
+
+ def test_schema_dump_keeps_id_column_when_id_is_false_and_id_column_added
+ output = standard_dump
+ match = output.match(%r{create_table "goofy_string_id"(.*)do.*\n(.*)\n})
+ assert_not_nil(match, "goofy_string_id table not found")
+ assert_match %r(:id => false), match[1], "no table id not preserved"
+ assert_match %r{t.string[[:space:]]+"id",[[:space:]]+:null => false$}, match[2], "non-primary key id column not preserved"
+ end
end