[ci skip] Update all guides with `null: false` change in migrations
- We no longer add `null: false` for timestamps columns as per
rails/rails@a939506.
- Followup of
14867b1a9a
.
This commit is contained in:
parent
14867b1a9a
commit
b5bdcaa838
|
@ -361,7 +361,7 @@ class CreatePublications < ActiveRecord::Migration[5.0]
|
|||
t.string :publisher_type
|
||||
t.boolean :single_issue
|
||||
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
add_index :publications, :publication_type_id
|
||||
end
|
||||
|
|
|
@ -41,7 +41,7 @@ class CreateProducts < ActiveRecord::Migration[5.0]
|
|||
t.string :name
|
||||
t.text :description
|
||||
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -287,7 +287,7 @@ class CreateProducts < ActiveRecord::Migration[5.0]
|
|||
t.string :name
|
||||
t.text :description
|
||||
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -847,7 +847,7 @@ class CreateProducts < ActiveRecord::Migration[5.0]
|
|||
create_table :products do |t|
|
||||
t.string :name
|
||||
t.text :description
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -105,13 +105,13 @@ class CreateBooks < ActiveRecord::Migration[5.0]
|
|||
def change
|
||||
create_table :authors do |t|
|
||||
t.string :name
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :books do |t|
|
||||
t.belongs_to :author, index: true
|
||||
t.datetime :published_at
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -136,13 +136,13 @@ class CreateSuppliers < ActiveRecord::Migration[5.0]
|
|||
def change
|
||||
create_table :suppliers do |t|
|
||||
t.string :name
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :accounts do |t|
|
||||
t.belongs_to :supplier, index: true
|
||||
t.string :account_number
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -180,13 +180,13 @@ class CreateAuthors < ActiveRecord::Migration[5.0]
|
|||
def change
|
||||
create_table :authors do |t|
|
||||
t.string :name
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :books do |t|
|
||||
t.belongs_to :author, index: true
|
||||
t.datetime :published_at
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -222,19 +222,19 @@ class CreateAppointments < ActiveRecord::Migration[5.0]
|
|||
def change
|
||||
create_table :physicians do |t|
|
||||
t.string :name
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :patients do |t|
|
||||
t.string :name
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :appointments do |t|
|
||||
t.belongs_to :physician, index: true
|
||||
t.belongs_to :patient, index: true
|
||||
t.datetime :appointment_date
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -308,19 +308,19 @@ class CreateAccountHistories < ActiveRecord::Migration[5.0]
|
|||
def change
|
||||
create_table :suppliers do |t|
|
||||
t.string :name
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :accounts do |t|
|
||||
t.belongs_to :supplier, index: true
|
||||
t.string :account_number
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :account_histories do |t|
|
||||
t.belongs_to :account, index: true
|
||||
t.integer :credit_rating
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -349,12 +349,12 @@ class CreateAssembliesAndParts < ActiveRecord::Migration[5.0]
|
|||
def change
|
||||
create_table :assemblies do |t|
|
||||
t.string :name
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :parts do |t|
|
||||
t.string :part_number
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :assemblies_parts, id: false do |t|
|
||||
|
@ -388,13 +388,13 @@ class CreateSuppliers < ActiveRecord::Migration[5.0]
|
|||
def change
|
||||
create_table :suppliers do |t|
|
||||
t.string :name
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
create_table :accounts do |t|
|
||||
t.integer :supplier_id
|
||||
t.string :account_number
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :accounts, :supplier_id
|
||||
|
@ -472,7 +472,7 @@ class CreatePictures < ActiveRecord::Migration[5.0]
|
|||
t.string :name
|
||||
t.integer :imageable_id
|
||||
t.string :imageable_type
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :pictures, [:imageable_type, :imageable_id]
|
||||
|
@ -488,7 +488,7 @@ class CreatePictures < ActiveRecord::Migration[5.0]
|
|||
create_table :pictures do |t|
|
||||
t.string :name
|
||||
t.references :imageable, polymorphic: true, index: true
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -518,7 +518,7 @@ class CreateEmployees < ActiveRecord::Migration[5.0]
|
|||
def change
|
||||
create_table :employees do |t|
|
||||
t.references :manager, index: true
|
||||
t.timestamps null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue