aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorDave Kroondyk <dave.kroondyk@thomsonreuters.com>2012-07-18 10:03:36 -0400
committerDave Kroondyk <dave.kroondyk@thomsonreuters.com>2012-07-18 10:59:32 -0400
commitccf7cd05ade081423bf8f000d4b98f8de030683d (patch)
treed507df065a87c9664d36e7c2fa99b11694fdaf8f /activerecord/test/cases
parent35072161b5c116b17bee235b079148b770a27c8b (diff)
downloadrails-ccf7cd05ade081423bf8f000d4b98f8de030683d.tar.gz
rails-ccf7cd05ade081423bf8f000d4b98f8de030683d.tar.bz2
rails-ccf7cd05ade081423bf8f000d4b98f8de030683d.zip
revert Default timestamps to non-null
Commit 3dbedd2 added NOT NULL constraints to timestamps. Commit fcef728 started to revert this, but was incomplete. With this commit, 3dbedd2 should be fully reverted and timestamps will no longer default to NOT NULL.
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/migration/change_schema_test.rb4
-rw-r--r--activerecord/test/cases/migration/column_attributes_test.rb8
2 files changed, 6 insertions, 6 deletions
diff --git a/activerecord/test/cases/migration/change_schema_test.rb b/activerecord/test/cases/migration/change_schema_test.rb
index ce9be66069..ec4c554abb 100644
--- a/activerecord/test/cases/migration/change_schema_test.rb
+++ b/activerecord/test/cases/migration/change_schema_test.rb
@@ -141,8 +141,8 @@ module ActiveRecord
created_at_column = created_columns.detect {|c| c.name == 'created_at' }
updated_at_column = created_columns.detect {|c| c.name == 'updated_at' }
- assert !created_at_column.null
- assert !updated_at_column.null
+ assert created_at_column.null
+ assert updated_at_column.null
end
def test_create_table_with_timestamps_should_create_datetime_columns_with_options
diff --git a/activerecord/test/cases/migration/column_attributes_test.rb b/activerecord/test/cases/migration/column_attributes_test.rb
index 3014bbe273..9584d5dd06 100644
--- a/activerecord/test/cases/migration/column_attributes_test.rb
+++ b/activerecord/test/cases/migration/column_attributes_test.rb
@@ -54,13 +54,13 @@ module ActiveRecord
# Do a manual insertion
if current_adapter?(:OracleAdapter)
- connection.execute "insert into test_models (id, wealth, created_at, updated_at) values (people_seq.nextval, 12345678901234567890.0123456789, sysdate, sysdate)"
+ connection.execute "insert into test_models (id, wealth) values (people_seq.nextval, 12345678901234567890.0123456789)"
elsif current_adapter?(:OpenBaseAdapter) || (current_adapter?(:MysqlAdapter) && Mysql.client_version < 50003) #before mysql 5.0.3 decimals stored as strings
- connection.execute "insert into test_models (wealth, created_at, updated_at) values ('12345678901234567890.0123456789', 0, 0)"
+ connection.execute "insert into test_models (wealth) values ('12345678901234567890.0123456789')"
elsif current_adapter?(:PostgreSQLAdapter)
- connection.execute "insert into test_models (wealth, created_at, updated_at) values (12345678901234567890.0123456789, now(), now())"
+ connection.execute "insert into test_models (wealth) values (12345678901234567890.0123456789)"
else
- connection.execute "insert into test_models (wealth, created_at, updated_at) values (12345678901234567890.0123456789, 0, 0)"
+ connection.execute "insert into test_models (wealth) values (12345678901234567890.0123456789)"
end
# SELECT