diff options
author | bUg <aleks.grebennik@gmail.com> | 2012-08-13 12:54:59 +0200 |
---|---|---|
committer | bUg <aleks.grebennik@gmail.com> | 2013-01-23 13:37:14 +0100 |
commit | af1ef85ad2b227c8d1fb4c90f814e5a8414faa92 (patch) | |
tree | 4b0e339d7395ea15a3ac0a51e9aa670d230fba50 /activerecord/test/schema | |
parent | e20c0e3a8f17d716720d248d3db5f022f7cb021a (diff) | |
download | rails-af1ef85ad2b227c8d1fb4c90f814e5a8414faa92.tar.gz rails-af1ef85ad2b227c8d1fb4c90f814e5a8414faa92.tar.bz2 rails-af1ef85ad2b227c8d1fb4c90f814e5a8414faa92.zip |
Add postgresql range types support
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r-- | activerecord/test/schema/postgresql_specific_schema.rb | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/activerecord/test/schema/postgresql_specific_schema.rb b/activerecord/test/schema/postgresql_specific_schema.rb index ae13f2cd8a..bf6f1ca191 100644 --- a/activerecord/test/schema/postgresql_specific_schema.rb +++ b/activerecord/test/schema/postgresql_specific_schema.rb @@ -1,7 +1,7 @@ ActiveRecord::Schema.define do - %w(postgresql_tsvectors postgresql_hstores postgresql_arrays postgresql_moneys postgresql_numbers postgresql_times postgresql_network_addresses postgresql_bit_strings postgresql_uuids postgresql_ltrees - postgresql_oids postgresql_xml_data_type defaults geometrics postgresql_timestamp_with_zones postgresql_partitioned_table postgresql_partitioned_table_parent postgresql_json_data_type postgresql_intrange_data_type).each do |table_name| + %w(postgresql_ranges postgresql_tsvectors postgresql_hstores postgresql_arrays postgresql_moneys postgresql_numbers postgresql_times postgresql_network_addresses postgresql_bit_strings postgresql_uuids postgresql_ltrees + postgresql_oids postgresql_xml_data_type defaults geometrics postgresql_timestamp_with_zones postgresql_partitioned_table postgresql_partitioned_table_parent postgresql_json_data_type).each do |table_name| execute "DROP TABLE IF EXISTS #{quote_table_name table_name}" end @@ -74,6 +74,18 @@ _SQL _SQL execute <<_SQL + CREATE TABLE postgresql_ranges ( + id SERIAL PRIMARY KEY, + date_range daterange, + num_range numrange, + ts_range tsrange, + tstz_range tstzrange, + int4_range int4range, + int8_range int8range + ); +_SQL + + execute <<_SQL CREATE TABLE postgresql_tsvectors ( id SERIAL PRIMARY KEY, text_vector tsvector @@ -106,16 +118,6 @@ _SQL ); _SQL end - - if 't' == select_value("select 'int4range'=ANY(select typname from pg_type)") - execute <<_SQL - CREATE TABLE postgresql_intrange_data_type ( - id SERIAL PRIMARY KEY, - int_range int4range, - int_long_range int8range - ); -_SQL - end execute <<_SQL CREATE TABLE postgresql_moneys ( |