Commit 4a3a4131 authored by Robert Speicher's avatar Robert Speicher

Merge branch '23666-set-null-true-for-timestamps-columns-in-migrations' into 'master'

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.

See merge request !7791
parents f0c44b5d c33b4898
...@@ -5,7 +5,7 @@ class CreateForkedProjectLinks < ActiveRecord::Migration ...@@ -5,7 +5,7 @@ class CreateForkedProjectLinks < ActiveRecord::Migration
t.integer :forked_to_project_id, null: false t.integer :forked_to_project_id, null: false
t.integer :forked_from_project_id, null: false t.integer :forked_from_project_id, null: false
t.timestamps t.timestamps null: true
end end
add_index :forked_project_links, :forked_to_project_id, unique: true add_index :forked_project_links, :forked_to_project_id, unique: true
end end
......
...@@ -5,7 +5,7 @@ class CreateDeployKeysProjects < ActiveRecord::Migration ...@@ -5,7 +5,7 @@ class CreateDeployKeysProjects < ActiveRecord::Migration
t.integer :deploy_key_id, null: false t.integer :deploy_key_id, null: false
t.integer :project_id, null: false t.integer :project_id, null: false
t.timestamps t.timestamps null: true
end end
end end
end end
...@@ -6,7 +6,7 @@ class CreateUsersGroups < ActiveRecord::Migration ...@@ -6,7 +6,7 @@ class CreateUsersGroups < ActiveRecord::Migration
t.integer :group_id, null: false t.integer :group_id, null: false
t.integer :user_id, null: false t.integer :user_id, null: false
t.timestamps t.timestamps null: true
end end
end end
end end
...@@ -5,7 +5,7 @@ class CreateProjectGroupLinks < ActiveRecord::Migration ...@@ -5,7 +5,7 @@ class CreateProjectGroupLinks < ActiveRecord::Migration
t.integer :project_id, null: false t.integer :project_id, null: false
t.integer :group_id, null: false t.integer :group_id, null: false
t.timestamps t.timestamps null: true
end end
end end
end end
...@@ -7,7 +7,7 @@ class CreateBroadcastMessages < ActiveRecord::Migration ...@@ -7,7 +7,7 @@ class CreateBroadcastMessages < ActiveRecord::Migration
t.datetime :ends_at t.datetime :ends_at
t.integer :alert_type t.integer :alert_type
t.timestamps t.timestamps null: true
end end
end end
end end
...@@ -7,7 +7,7 @@ class CreateMergeRequestDiffs < ActiveRecord::Migration ...@@ -7,7 +7,7 @@ class CreateMergeRequestDiffs < ActiveRecord::Migration
t.text :st_diffs, null: true t.text :st_diffs, null: true
t.integer :merge_request_id, null: false t.integer :merge_request_id, null: false
t.timestamps t.timestamps null: true
end end
if ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/ if ActiveRecord::Base.configurations[Rails.env]['adapter'] =~ /^mysql/
......
...@@ -5,7 +5,7 @@ class CreateEmails < ActiveRecord::Migration ...@@ -5,7 +5,7 @@ class CreateEmails < ActiveRecord::Migration
t.integer :user_id, null: false t.integer :user_id, null: false
t.string :email, null: false t.string :email, null: false
t.timestamps t.timestamps null: true
end end
add_index :emails, :user_id add_index :emails, :user_id
......
...@@ -4,7 +4,7 @@ class CreateUsersStarProjects < ActiveRecord::Migration ...@@ -4,7 +4,7 @@ class CreateUsersStarProjects < ActiveRecord::Migration
create_table :users_star_projects do |t| create_table :users_star_projects do |t|
t.integer :project_id, null: false t.integer :project_id, null: false
t.integer :user_id, null: false t.integer :user_id, null: false
t.timestamps t.timestamps null: true
end end
add_index :users_star_projects, :user_id add_index :users_star_projects, :user_id
add_index :users_star_projects, :project_id add_index :users_star_projects, :project_id
......
...@@ -6,7 +6,7 @@ class CreateLabels < ActiveRecord::Migration ...@@ -6,7 +6,7 @@ class CreateLabels < ActiveRecord::Migration
t.string :color t.string :color
t.integer :project_id t.integer :project_id
t.timestamps t.timestamps null: true
end end
end end
end end
...@@ -6,7 +6,7 @@ class CreateLabelLinks < ActiveRecord::Migration ...@@ -6,7 +6,7 @@ class CreateLabelLinks < ActiveRecord::Migration
t.integer :target_id t.integer :target_id
t.string :target_type t.string :target_type
t.timestamps t.timestamps null: true
end end
end end
end end
...@@ -9,7 +9,7 @@ class AddMembersTable < ActiveRecord::Migration ...@@ -9,7 +9,7 @@ class AddMembersTable < ActiveRecord::Migration
t.integer :notification_level, null: false t.integer :notification_level, null: false
t.string :type t.string :type
t.timestamps t.timestamps null: true
end end
add_index :members, :type add_index :members, :type
......
...@@ -12,7 +12,7 @@ class RemoveOldMemberTables < ActiveRecord::Migration ...@@ -12,7 +12,7 @@ class RemoveOldMemberTables < ActiveRecord::Migration
t.integer :user_id, null: false t.integer :user_id, null: false
t.integer :notification_level, null: false, default: 3 t.integer :notification_level, null: false, default: 3
t.timestamps t.timestamps null: true
end end
create_table :users_projects do |t| create_table :users_projects do |t|
...@@ -21,7 +21,7 @@ class RemoveOldMemberTables < ActiveRecord::Migration ...@@ -21,7 +21,7 @@ class RemoveOldMemberTables < ActiveRecord::Migration
t.integer :user_id, null: false t.integer :user_id, null: false
t.integer :notification_level, null: false, default: 3 t.integer :notification_level, null: false, default: 3
t.timestamps t.timestamps null: true
end end
end end
end end
...@@ -13,7 +13,7 @@ class AddAuditEvent < ActiveRecord::Migration ...@@ -13,7 +13,7 @@ class AddAuditEvent < ActiveRecord::Migration
# Details for the event # Details for the event
t.text :details t.text :details
t.timestamps t.timestamps null: true
end end
add_index :audit_events, :author_id add_index :audit_events, :author_id
......
...@@ -7,7 +7,7 @@ class CreateDoorkeeperTables < ActiveRecord::Migration ...@@ -7,7 +7,7 @@ class CreateDoorkeeperTables < ActiveRecord::Migration
t.string :secret, null: false t.string :secret, null: false
t.text :redirect_uri, null: false t.text :redirect_uri, null: false
t.string :scopes, null: false, default: '' t.string :scopes, null: false, default: ''
t.timestamps t.timestamps null: true
end end
add_index :oauth_applications, :uid, unique: true add_index :oauth_applications, :uid, unique: true
......
...@@ -8,7 +8,7 @@ class CreateApplicationSettings < ActiveRecord::Migration ...@@ -8,7 +8,7 @@ class CreateApplicationSettings < ActiveRecord::Migration
t.boolean :gravatar_enabled t.boolean :gravatar_enabled
t.text :sign_in_text t.text :sign_in_text
t.timestamps t.timestamps null: true
end end
end end
end end
...@@ -6,7 +6,7 @@ class CreateSubscriptionsTable < ActiveRecord::Migration ...@@ -6,7 +6,7 @@ class CreateSubscriptionsTable < ActiveRecord::Migration
t.references :subscribable, polymorphic: true t.references :subscribable, polymorphic: true
t.boolean :subscribed t.boolean :subscribed
t.timestamps t.timestamps null: true
end end
add_index :subscriptions, add_index :subscriptions,
......
...@@ -6,7 +6,7 @@ class CreateAbuseReports < ActiveRecord::Migration ...@@ -6,7 +6,7 @@ class CreateAbuseReports < ActiveRecord::Migration
t.integer :user_id t.integer :user_id
t.text :message t.text :message
t.timestamps t.timestamps null: true
end end
end end
end end
...@@ -5,7 +5,7 @@ class CreateLfsObjects < ActiveRecord::Migration ...@@ -5,7 +5,7 @@ class CreateLfsObjects < ActiveRecord::Migration
t.string :oid, null: false, unique: true t.string :oid, null: false, unique: true
t.integer :size, null: false t.integer :size, null: false
t.timestamps t.timestamps null: true
end end
end end
end end
...@@ -5,7 +5,7 @@ class CreateLfsObjectsProjects < ActiveRecord::Migration ...@@ -5,7 +5,7 @@ class CreateLfsObjectsProjects < ActiveRecord::Migration
t.integer :lfs_object_id, null: false t.integer :lfs_object_id, null: false
t.integer :project_id, null: false t.integer :project_id, null: false
t.timestamps t.timestamps null: true
end end
add_index :lfs_objects_projects, :project_id add_index :lfs_objects_projects, :project_id
......
...@@ -6,7 +6,7 @@ class CreateReleases < ActiveRecord::Migration ...@@ -6,7 +6,7 @@ class CreateReleases < ActiveRecord::Migration
t.text :description t.text :description
t.integer :project_id t.integer :project_id
t.timestamps t.timestamps null: true
end end
add_index :releases, :project_id add_index :releases, :project_id
......
...@@ -9,7 +9,7 @@ class CreateTasks < ActiveRecord::Migration ...@@ -9,7 +9,7 @@ class CreateTasks < ActiveRecord::Migration
t.integer :action, null: false t.integer :action, null: false
t.string :state, null: false, index: true t.string :state, null: false, index: true
t.timestamps t.timestamps null: true
end end
end end
end end
...@@ -6,7 +6,7 @@ class AddAwardEmoji < ActiveRecord::Migration ...@@ -6,7 +6,7 @@ class AddAwardEmoji < ActiveRecord::Migration
t.references :user t.references :user
t.references :awardable, polymorphic: true t.references :awardable, polymorphic: true
t.timestamps t.timestamps null: true
end end
add_index :award_emoji, :user_id add_index :award_emoji, :user_id
......
...@@ -10,7 +10,7 @@ class CreateProjectFeatures < ActiveRecord::Migration ...@@ -10,7 +10,7 @@ class CreateProjectFeatures < ActiveRecord::Migration
t.integer :snippets_access_level t.integer :snippets_access_level
t.integer :builds_access_level t.integer :builds_access_level
t.timestamps t.timestamps null: true
end end
end 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