diff options
author | Joel <joel@renewfund.com> | 2012-02-05 11:52:50 -0800 |
---|---|---|
committer | Joel <joel@renewfund.com> | 2012-02-08 22:28:51 -0800 |
commit | 102ef98d32a40e1c7a7526d1d0d3165885315f1c (patch) | |
tree | 7a23deb011bfe352d51ca4e764b9adeebb9f008d /activerecord/test | |
parent | cf572114608b7813cacd88076dc272ac2a2a7955 (diff) | |
download | rails-102ef98d32a40e1c7a7526d1d0d3165885315f1c.tar.gz rails-102ef98d32a40e1c7a7526d1d0d3165885315f1c.tar.bz2 rails-102ef98d32a40e1c7a7526d1d0d3165885315f1c.zip |
schema dumper tests for hstore
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/schema_dumper_test.rb | 7 | ||||
-rw-r--r-- | activerecord/test/schema/postgresql_specific_schema.rb | 9 |
2 files changed, 15 insertions, 1 deletions
diff --git a/activerecord/test/cases/schema_dumper_test.rb b/activerecord/test/cases/schema_dumper_test.rb index abeb56fd3f..ddddce069f 100644 --- a/activerecord/test/cases/schema_dumper_test.rb +++ b/activerecord/test/cases/schema_dumper_test.rb @@ -229,6 +229,13 @@ class SchemaDumperTest < ActiveRecord::TestCase def test_schema_dump_includes_tsvector_shorthand_definition output = standard_dump + if %r{create_table "postgresql_hstores"} =~ output + assert_match %r{t.hstore "hash_store", default => ""}, output + end + end + + def test_schema_dump_includes_tsvector_shorthand_definition + output = standard_dump if %r{create_table "postgresql_tsvectors"} =~ output assert_match %r{t.tsvector "text_vector"}, output end diff --git a/activerecord/test/schema/postgresql_specific_schema.rb b/activerecord/test/schema/postgresql_specific_schema.rb index 5cf9a207f3..a2e5724167 100644 --- a/activerecord/test/schema/postgresql_specific_schema.rb +++ b/activerecord/test/schema/postgresql_specific_schema.rb @@ -1,6 +1,6 @@ ActiveRecord::Schema.define do - %w(postgresql_tsvectors postgresql_arrays postgresql_moneys postgresql_numbers postgresql_times postgresql_network_addresses postgresql_bit_strings + %w(postgresql_tsvectors postgresql_hstores postgresql_arrays postgresql_moneys postgresql_numbers postgresql_times postgresql_network_addresses postgresql_bit_strings postgresql_oids postgresql_xml_data_type defaults geometrics postgresql_timestamp_with_zones).each do |table_name| execute "DROP TABLE IF EXISTS #{quote_table_name table_name}" end @@ -64,6 +64,13 @@ _SQL _SQL execute <<_SQL + CREATE TABLE postgresql_hstores ( + id SERIAL PRIMARY KEY, + hash_store hstore default ''::hstore + ); +_SQL + + execute <<_SQL CREATE TABLE postgresql_moneys ( id SERIAL PRIMARY KEY, wealth MONEY |