aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/migration/change_schema_test.rb
diff options
context:
space:
mode:
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