aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/change_schema_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-11-24 14:15:45 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2014-11-24 14:15:56 -0800
commitfbef981fdc7ba64678f7ae1fc82b2cd790469280 (patch)
treed2d7f29e95e4ec3f2dc9a7063c8bf77c422eb18e /activerecord/test/cases/adapters/postgresql/change_schema_test.rb
parent9f33e3daab02304e768e7391940fe29290f3c3bf (diff)
downloadrails-fbef981fdc7ba64678f7ae1fc82b2cd790469280.tar.gz
rails-fbef981fdc7ba64678f7ae1fc82b2cd790469280.tar.bz2
rails-fbef981fdc7ba64678f7ae1fc82b2cd790469280.zip
allow the "USING" statement to be specified on change column calls
Diffstat (limited to 'activerecord/test/cases/adapters/postgresql/change_schema_test.rb')
-rw-r--r--activerecord/test/cases/adapters/postgresql/change_schema_test.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/activerecord/test/cases/adapters/postgresql/change_schema_test.rb b/activerecord/test/cases/adapters/postgresql/change_schema_test.rb
new file mode 100644
index 0000000000..90cd28c2ec
--- /dev/null
+++ b/activerecord/test/cases/adapters/postgresql/change_schema_test.rb
@@ -0,0 +1,25 @@
+require 'cases/helper'
+
+module ActiveRecord
+ class Migration
+ class PGChangeSchemaTest < ActiveRecord::TestCase
+ attr_reader :connection
+
+ def setup
+ super
+ @connection = ActiveRecord::Base.connection
+ connection.create_table(:strings) do |t|
+ t.string :somedate
+ end
+ end
+
+ def teardown
+ connection.drop_table :strings
+ end
+
+ def test_change_string_to_date
+ connection.change_column :strings, :somedate, :timestamp, using: 'CAST("somedate" AS timestamp)'
+ end
+ end
+ end
+end