aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration/change_schema_test.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-19 18:56:00 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-19 18:56:00 -0300
commit03035d69e14032a589e9653e3145237b8a9a09be (patch)
treea20b809cd5b17c706709a51594c0ab1480503c6c /activerecord/test/cases/migration/change_schema_test.rb
parent09cc922ed31bf699b26fafe4822fc7048b821825 (diff)
parentd0f8c46e1962b28d77209f367f12c2d2c77f4b12 (diff)
downloadrails-03035d69e14032a589e9653e3145237b8a9a09be.tar.gz
rails-03035d69e14032a589e9653e3145237b8a9a09be.tar.bz2
rails-03035d69e14032a589e9653e3145237b8a9a09be.zip
Merge pull request #15184 from sgrif/sg-remove-timestamp-type
Remove :timestamp column type
Diffstat (limited to 'activerecord/test/cases/migration/change_schema_test.rb')
-rw-r--r--activerecord/test/cases/migration/change_schema_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/activerecord/test/cases/migration/change_schema_test.rb b/activerecord/test/cases/migration/change_schema_test.rb
index cbad718b43..b63dcf4459 100644
--- a/activerecord/test/cases/migration/change_schema_test.rb
+++ b/activerecord/test/cases/migration/change_schema_test.rb
@@ -233,6 +233,23 @@ module ActiveRecord
end
end
+ def test_add_column_with_timestamp_type
+ connection.create_table :testings do |t|
+ t.column :foo, :timestamp
+ end
+
+ klass = Class.new(ActiveRecord::Base)
+ klass.table_name = 'testings'
+
+ assert_equal :datetime, klass.columns_hash['foo'].type
+
+ if current_adapter?(:PostgreSQLAdapter)
+ assert_equal 'timestamp without time zone', klass.columns_hash['foo'].sql_type
+ else
+ assert_equal klass.connection.type_to_sql('datetime'), klass.columns_hash['foo'].sql_type
+ end
+ end
+
def test_change_column_quotes_column_names
connection.create_table :testings do |t|
t.column :select, :string