diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-02-13 02:34:52 +0900 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2017-02-12 19:52:58 -0700 |
commit | 42ed16a987c91dcb1705a414b5da15c5275e2b16 (patch) | |
tree | 695dd8ef4a8f14939e6971199126353b8d028e7c /activerecord/test/schema | |
parent | bb45fa05d1681230764af023058af65142c75cff (diff) | |
download | rails-42ed16a987c91dcb1705a414b5da15c5275e2b16.tar.gz rails-42ed16a987c91dcb1705a414b5da15c5275e2b16.tar.bz2 rails-42ed16a987c91dcb1705a414b5da15c5275e2b16.zip |
Schema dumping support for PostgreSQL interval type
Closes #27979
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r-- | activerecord/test/schema/postgresql_specific_schema.rb | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/activerecord/test/schema/postgresql_specific_schema.rb b/activerecord/test/schema/postgresql_specific_schema.rb index 15ba2d67ab..a390a76a16 100644 --- a/activerecord/test/schema/postgresql_specific_schema.rb +++ b/activerecord/test/schema/postgresql_specific_schema.rb @@ -23,12 +23,17 @@ ActiveRecord::Schema.define do t.string :char2, limit: 50, default: "a varchar field" t.text :char3, default: "a text field" t.bigint :bigint_default, default: -> { "0::bigint" } - t.text :multiline_default, default: '--- [] + t.text :multiline_default, default: "--- [] -' +" end - %w(postgresql_times postgresql_oids postgresql_timestamp_with_zones + create_table :postgresql_times, force: true do |t| + t.interval :time_interval + t.interval :scaled_time_interval, precision: 6 + end + + %w(postgresql_oids postgresql_timestamp_with_zones postgresql_partitioned_table postgresql_partitioned_table_parent).each do |table_name| drop_table table_name, if_exists: true end @@ -45,14 +50,6 @@ ActiveRecord::Schema.define do end execute <<_SQL - CREATE TABLE postgresql_times ( - id SERIAL PRIMARY KEY, - time_interval INTERVAL, - scaled_time_interval INTERVAL(6) - ); -_SQL - - execute <<_SQL CREATE TABLE postgresql_oids ( id SERIAL PRIMARY KEY, obj_id OID |