Skip to content
Snippets Groups Projects
Commit 4a3a4131 authored by Robert Speicher's avatar Robert Speicher
Browse files

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
No related branches found
No related tags found
1 merge request!7791Add `null: true` to timestamps in migrations that does not define it
Pipeline #
Showing
with 21 additions and 21 deletions
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
@@ -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/
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@ class CreateLabels < ActiveRecord::Migration
t.string :color
t.integer :project_id
 
t.timestamps
t.timestamps null: true
end
end
end
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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|
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
@@ -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,
Loading
Loading
Loading
Loading
@@ -6,7 +6,7 @@ class CreateAbuseReports < ActiveRecord::Migration
t.integer :user_id
t.text :message
 
t.timestamps
t.timestamps null: true
end
end
end
Loading
Loading
@@ -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
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment