From fbef981fdc7ba64678f7ae1fc82b2cd790469280 Mon Sep 17 00:00:00 2001
From: Aaron Patterson <aaron.patterson@gmail.com>
Date: Mon, 24 Nov 2014 14:15:45 -0800
Subject: allow the "USING" statement to be specified on change column calls

---
 .../adapters/postgresql/change_schema_test.rb      | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 activerecord/test/cases/adapters/postgresql/change_schema_test.rb

(limited to 'activerecord/test')

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
-- 
cgit v1.2.3