diff options
author | Sean Griffin <sean@thoughtbot.com> | 2014-08-12 14:23:14 -0600 |
---|---|---|
committer | Sean Griffin <sean@thoughtbot.com> | 2014-08-12 14:40:11 -0600 |
commit | ea3ba34506c72d636096245016b5ef9cfe27c566 (patch) | |
tree | dd7f1c1ca5d3afafa56f914556dfe7acc7d6c414 /activerecord/test/schema | |
parent | 82e28492e7c581cdeea904464a18eb11118f4ac0 (diff) | |
download | rails-ea3ba34506c72d636096245016b5ef9cfe27c566.tar.gz rails-ea3ba34506c72d636096245016b5ef9cfe27c566.tar.bz2 rails-ea3ba34506c72d636096245016b5ef9cfe27c566.zip |
Change the default `null` value for timestamps
As per discussion, this changes the model generators to specify
`null: false` for timestamp columns. A warning is now emitted if
`timestamps` is called without a `null` option specified, so we can
safely change the behavior when no option is specified in Rails 5.
Diffstat (limited to 'activerecord/test/schema')
-rw-r--r-- | activerecord/test/schema/schema.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activerecord/test/schema/schema.rb b/activerecord/test/schema/schema.rb index a8b21904ac..98f2492ef8 100644 --- a/activerecord/test/schema/schema.rb +++ b/activerecord/test/schema/schema.rb @@ -138,7 +138,7 @@ ActiveRecord::Schema.define do t.integer :engines_count t.integer :wheels_count t.column :lock_version, :integer, null: false, default: 0 - t.timestamps + t.timestamps null: false end create_table :categories, force: true do |t| @@ -537,7 +537,7 @@ ActiveRecord::Schema.define do t.references :best_friend_of t.integer :insures, null: false, default: 0 t.timestamp :born_at - t.timestamps + t.timestamps null: false end create_table :peoples_treasures, id: false, force: true do |t| @@ -548,7 +548,7 @@ ActiveRecord::Schema.define do create_table :pets, primary_key: :pet_id, force: true do |t| t.string :name t.integer :owner_id, :integer - t.timestamps + t.timestamps null: false end create_table :pirates, force: true do |t| @@ -726,13 +726,13 @@ ActiveRecord::Schema.define do t.string :parent_title t.string :type t.string :group - t.timestamps + t.timestamps null: true end create_table :toys, primary_key: :toy_id, force: true do |t| t.string :name t.integer :pet_id, :integer - t.timestamps + t.timestamps null: false end create_table :traffic_lights, force: true do |t| |