aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/schema
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-02-10 10:55:34 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-02-10 10:55:34 -0800
commitf7b915b50718c86d3644941cd0bbe7df08888a5b (patch)
tree694847bdcdf374afc65eec9a81aa76fa63855ccf /activerecord/test/schema
parent522b72fd28b898c914cfbdbc31837e56702f60d5 (diff)
parent2dd0178229ccd5e7f19f120ded85fd4a80306cac (diff)
downloadrails-f7b915b50718c86d3644941cd0bbe7df08888a5b.tar.gz
rails-f7b915b50718c86d3644941cd0bbe7df08888a5b.tar.bz2
rails-f7b915b50718c86d3644941cd0bbe7df08888a5b.zip
Merge branch 'joelhoffman-postgres_schema_builder' into instance_reader
* joelhoffman-postgres_schema_builder: Also support writing the hstore back to the database Hstore values are all strings string_to_hstore / hstore_to_string, serializing don't test schema where hstore not installed schema dumper tests for hstore Additional hstore tests, supporting null values, better compliance with postgres docs add hstore to postgres native types and defaults Conflicts: activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r--activerecord/test/schema/postgresql_specific_schema.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/activerecord/test/schema/postgresql_specific_schema.rb b/activerecord/test/schema/postgresql_specific_schema.rb
index 5cf9a207f3..25b416a906 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
@@ -63,6 +63,15 @@ _SQL
);
_SQL
+ if 't' == select_value("select 'hstore'=ANY(select typname from pg_type)")
+ execute <<_SQL
+ CREATE TABLE postgresql_hstores (
+ id SERIAL PRIMARY KEY,
+ hash_store hstore default ''::hstore
+ );
+_SQL
+ end
+
execute <<_SQL
CREATE TABLE postgresql_moneys (
id SERIAL PRIMARY KEY,