Add `null: true` to timestamps in migrations that does not define it

This is to ensure that migrations will still be consitent when we will
upgrade to Rails 5 which default to `null: false` for timestamps
columns.

Fixes #23666.
Signed-off-by: 's avatarRémy Coutable <remy@rymai.me>
parent e6d31ce3
......@@ -5,7 +5,7 @@ class CreateForkedProjectLinks < ActiveRecord::Migration
t.integer :forked_to_project_id, null: false
t.integer :forked_from_project_id, null: false
t.timestamps
t.timestamps null: true
end
add_index :forked_project_links, :forked_to_project_id, unique: true
end
......
......@@ -5,7 +5,7 @@ class CreateDeployKeysProjects < ActiveRecord::Migration
t.integer :deploy_key_id, null: false
t.integer :project_id, null: false
t.timestamps
t.timestamps null: true
end
end
end
......@@ -6,7 +6,7 @@ class CreateUsersGroups < ActiveRecord::Migration
t.integer :group_id, null: false
t.integer :user_id, null: false
t.timestamps
t.timestamps null: true
end
end
end
......@@ -5,7 +5,7 @@ class CreateProjectGroupLinks < ActiveRecord::Migration
t.integer :project_id, null: false
t.integer :group_id, null: false
t.timestamps
t.timestamps null: true
end
end
end
......@@ -7,7 +7,7 @@ class CreateBroadcastMessages < ActiveRecord::Migration
t.datetime :ends_at
t.integer :alert_type
t.timestamps
t.timestamps null: true
end
end
end
......@@ -7,7 +7,7 @@ class CreateMergeRequestDiffs < ActiveRecord::Migration
t.text :st_diffs, null: true
t.integer :merge_request_id, null: false
t.timestamps
t.timestamps null: true
end
if ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/
......
......@@ -5,7 +5,7 @@ class CreateEmails < ActiveRecord::Migration
t.integer :user_id, null: false
t.string :email, null: false
t.timestamps
t.timestamps null: true
end
add_index :emails, :user_id
......
......@@ -4,7 +4,7 @@ class CreateUsersStarProjects < ActiveRecord::Migration
create_table :users_star_projects do |t|
t.integer :project_id, null: false
t.integer :user_id, null: false
t.timestamps
t.timestamps null: true
end
add_index :users_star_projects, :user_id
add_index :users_star_projects, :project_id
......
......@@ -6,7 +6,7 @@ class CreateLabels < ActiveRecord::Migration
t.string :color
t.integer :project_id
t.timestamps
t.timestamps null: true
end
end
end
......@@ -6,7 +6,7 @@ class CreateLabelLinks < ActiveRecord::Migration
t.integer :target_id
t.string :target_type
t.timestamps
t.timestamps null: true
end
end
end
......@@ -9,7 +9,7 @@ class AddMembersTable < ActiveRecord::Migration
t.integer :notification_level, null: false
t.string :type
t.timestamps
t.timestamps null: true
end
add_index :members, :type
......
......@@ -12,7 +12,7 @@ class RemoveOldMemberTables < ActiveRecord::Migration
t.integer :user_id, null: false
t.integer :notification_level, null: false, default: 3
t.timestamps
t.timestamps null: true
end
create_table :users_projects do |t|
......@@ -21,7 +21,7 @@ class RemoveOldMemberTables < ActiveRecord::Migration
t.integer :user_id, null: false
t.integer :notification_level, null: false, default: 3
t.timestamps
t.timestamps null: true
end
end
end
......@@ -13,7 +13,7 @@ class AddAuditEvent < ActiveRecord::Migration
# Details for the event
t.text :details
t.timestamps
t.timestamps null: true
end
add_index :audit_events, :author_id
......
......@@ -7,7 +7,7 @@ class CreateDoorkeeperTables < ActiveRecord::Migration
t.string :secret, null: false
t.text :redirect_uri, null: false
t.string :scopes, null: false, default: ''
t.timestamps
t.timestamps null: true
end
add_index :oauth_applications, :uid, unique: true
......
......@@ -8,7 +8,7 @@ class CreateApplicationSettings < ActiveRecord::Migration
t.boolean :gravatar_enabled
t.text :sign_in_text
t.timestamps
t.timestamps null: true
end
end
end
......@@ -6,7 +6,7 @@ class CreateSubscriptionsTable < ActiveRecord::Migration
t.references :subscribable, polymorphic: true
t.boolean :subscribed
t.timestamps
t.timestamps null: true
end
add_index :subscriptions,
......
......@@ -6,7 +6,7 @@ class CreateAbuseReports < ActiveRecord::Migration
t.integer :user_id
t.text :message
t.timestamps
t.timestamps null: true
end
end
end
......@@ -5,7 +5,7 @@ class CreateLfsObjects < ActiveRecord::Migration
t.string :oid, null: false, unique: true
t.integer :size, null: false
t.timestamps
t.timestamps null: true
end
end
end
......@@ -5,7 +5,7 @@ class CreateLfsObjectsProjects < ActiveRecord::Migration
t.integer :lfs_object_id, null: false
t.integer :project_id, null: false
t.timestamps
t.timestamps null: true
end
add_index :lfs_objects_projects, :project_id
......
......@@ -6,7 +6,7 @@ class CreateReleases < ActiveRecord::Migration
t.text :description
t.integer :project_id
t.timestamps
t.timestamps null: true
end
add_index :releases, :project_id
......
......@@ -9,7 +9,7 @@ class CreateTasks < ActiveRecord::Migration
t.integer :action, null: false
t.string :state, null: false, index: true
t.timestamps
t.timestamps null: true
end
end
end
......@@ -6,7 +6,7 @@ class AddAwardEmoji < ActiveRecord::Migration
t.references :user
t.references :awardable, polymorphic: true
t.timestamps
t.timestamps null: true
end
add_index :award_emoji, :user_id
......
......@@ -10,7 +10,7 @@ class CreateProjectFeatures < ActiveRecord::Migration
t.integer :snippets_access_level
t.integer :builds_access_level
t.timestamps
t.timestamps null: true
end
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment