diff options
author | Leonardo Borges <leonardoborges.rj@gmail.com> | 2009-08-09 12:56:25 +0400 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-08-09 22:24:54 -0700 |
commit | 0c391b46fb39b697bbae1493caade23e2ddbd8a6 (patch) | |
tree | 5af5ca090d1cf4cc31b51b2f4cfd528e21d2f724 /activerecord/test/cases/schema_dumper_test.rb | |
parent | 9c1bac0b7fcb627640db6824dca3e6e829a3c3e6 (diff) | |
download | rails-0c391b46fb39b697bbae1493caade23e2ddbd8a6.tar.gz rails-0c391b46fb39b697bbae1493caade23e2ddbd8a6.tar.bz2 rails-0c391b46fb39b697bbae1493caade23e2ddbd8a6.zip |
PostgreSQL: XML datatype support
[#1874 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/test/cases/schema_dumper_test.rb')
-rw-r--r-- | activerecord/test/cases/schema_dumper_test.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb index e6a77f626b..1c43e3c5b5 100644 --- a/activerecord/test/cases/schema_dumper_test.rb +++ b/activerecord/test/cases/schema_dumper_test.rb @@ -161,7 +161,7 @@ class SchemaDumperTest < ActiveRecord::TestCase index_definition = standard_dump.split(/\n/).grep(/add_index.*companies/).first.strip assert_equal 'add_index "companies", ["firm_id", "type", "rating", "ruby_type"], :name => "company_index"', index_definition end - + def test_schema_dump_should_honor_nonstandard_primary_keys output = standard_dump match = output.match(%r{create_table "movies"(.*)do}) @@ -196,6 +196,15 @@ class SchemaDumperTest < ActiveRecord::TestCase assert_match %r{:precision => 3,[[:space:]]+:scale => 2,[[:space:]]+:default => 2.78}, output end + if current_adapter?(:PostgreSQLAdapter) + def test_schema_dump_includes_xml_shorthand_definition + output = standard_dump + if %r{create_table "postgresql_xml_data_type"} =~ output + assert_match %r{t.xml "data"}, output + end + end + end + def test_schema_dump_keeps_large_precision_integer_columns_as_decimal output = standard_dump # Oracle supports precision up to 38 and it identifies decimals with scale 0 as integers @@ -214,3 +223,4 @@ class SchemaDumperTest < ActiveRecord::TestCase assert_match %r{t.string[[:space:]]+"id",[[:space:]]+:null => false$}, match[2], "non-primary key id column not preserved" end end + |