Commit 13d50d64 authored by Imre Farkas's avatar Imre Farkas

Merge branch '299376-add-namespaces-to-wide-tables' into 'master'

Add `namespaces` to wide tables

See merge request gitlab-org/gitlab!52153
parents e18903f4 62812393
......@@ -4,6 +4,6 @@ class AddAutoDevOpsEnabledToNamespaces < ActiveRecord::Migration[5.0]
DOWNTIME = false
def change
add_column :namespaces, :auto_devops_enabled, :boolean
add_column :namespaces, :auto_devops_enabled, :boolean # rubocop:disable Migration/AddColumnsToWideTables
end
end
......@@ -7,6 +7,6 @@ class AddLastCiMinutesNotificationAtToNamespaces < ActiveRecord::Migration[5.1]
DOWNTIME = false
def change
add_column :namespaces, :last_ci_minutes_notification_at, :datetime_with_timezone
add_column :namespaces, :last_ci_minutes_notification_at, :datetime_with_timezone # rubocop:disable Migration/AddColumnsToWideTables
end
end
......@@ -4,6 +4,6 @@ class AddLastCiMinutesUsageNotificationLevelToNamespaces < ActiveRecord::Migrati
DOWNTIME = false
def change
add_column :namespaces, :last_ci_minutes_usage_notification_level, :integer
add_column :namespaces, :last_ci_minutes_usage_notification_level, :integer # rubocop:disable Migration/AddColumnsToWideTables
end
end
......@@ -6,7 +6,7 @@ class AddGroupCreationLevelToNamespaces < ActiveRecord::Migration[5.1]
DOWNTIME = false
def up
add_column(:namespaces, :subgroup_creation_level, :integer)
add_column(:namespaces, :subgroup_creation_level, :integer) # rubocop:disable Migration/AddColumnsToWideTables
change_column_default(:namespaces,
:subgroup_creation_level,
::Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS)
......
......@@ -4,6 +4,6 @@ class AddGroupEmailsDisabled < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :namespaces, :emails_disabled, :boolean
add_column :namespaces, :emails_disabled, :boolean # rubocop:disable Migration/AddColumnsToWideTables
end
end
......@@ -4,6 +4,6 @@ class AddNamespacesMaxPagesSize < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :namespaces, :max_pages_size, :integer
add_column :namespaces, :max_pages_size, :integer # rubocop:disable Migration/AddColumnsToWideTables
end
end
......@@ -4,6 +4,6 @@ class AddNamespacesMaxArtifactsSize < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :namespaces, :max_artifacts_size, :integer
add_column :namespaces, :max_artifacts_size, :integer # rubocop:disable Migration/AddColumnsToWideTables
end
end
......@@ -4,6 +4,6 @@ class AddMentionsDisabledToNamespaces < ActiveRecord::Migration[5.2]
DOWNTIME = false
def change
add_column :namespaces, :mentions_disabled, :boolean
add_column :namespaces, :mentions_disabled, :boolean # rubocop:disable Migration/AddColumnsToWideTables
end
end
......@@ -7,7 +7,7 @@ class AddDefaultBranchProtectionToNamespaces < ActiveRecord::Migration[6.0]
def up
with_lock_retries do
add_column :namespaces, :default_branch_protection, :integer, limit: 2
add_column :namespaces, :default_branch_protection, :integer, limit: 2 # rubocop:disable Migration/AddColumnsToWideTables
end
end
......
......@@ -7,7 +7,7 @@ class AddUnlockMembershipToLdapOfGroups < ActiveRecord::Migration[5.2]
def up
with_lock_retries do
add_column(:namespaces, :unlock_membership_to_ldap, :boolean)
add_column(:namespaces, :unlock_membership_to_ldap, :boolean) # rubocop:disable Migration/AddColumnsToWideTables
end
end
......
......@@ -7,7 +7,7 @@ class AddMaxPersonalAccessTokenLifetimeToNamespaces < ActiveRecord::Migration[6.
def up
with_lock_retries do
add_column :namespaces, :max_personal_access_token_lifetime, :integer
add_column :namespaces, :max_personal_access_token_lifetime, :integer # rubocop:disable Migration/AddColumnsToWideTables
end
end
......
......@@ -7,7 +7,7 @@ class AddPushRuleIdToGroups < ActiveRecord::Migration[6.0]
def up
with_lock_retries do
add_column :namespaces, :push_rule_id, :bigint
add_column :namespaces, :push_rule_id, :bigint # rubocop:disable Migration/AddColumnsToWideTables
end
end
......
......@@ -7,8 +7,8 @@ class AddSharedRunnersEnabledAndOverrideToNamespaces < ActiveRecord::Migration[6
def up
with_lock_retries do
add_column :namespaces, :shared_runners_enabled, :boolean, default: true, null: false
add_column :namespaces, :allow_descendants_override_disabled_shared_runners, :boolean, default: false, null: false
add_column :namespaces, :shared_runners_enabled, :boolean, default: true, null: false # rubocop:disable Migration/AddColumnsToWideTables
add_column :namespaces, :allow_descendants_override_disabled_shared_runners, :boolean, default: false, null: false # rubocop:disable Migration/AddColumnsToWideTables
end
end
......
......@@ -7,7 +7,7 @@ class AddTraversalIdsToNamespaces < ActiveRecord::Migration[6.0]
def up
with_lock_retries do
add_column :namespaces, :traversal_ids, :integer, array: true, default: [], null: false
add_column :namespaces, :traversal_ids, :integer, array: true, default: [], null: false # rubocop:disable Migration/AddColumnsToWideTables
end
end
......
......@@ -7,7 +7,7 @@ class AddDelayedProjectRemovalToNamespaces < ActiveRecord::Migration[6.0]
def up
with_lock_retries do
add_column :namespaces, :delayed_project_removal, :boolean, default: false, null: false
add_column :namespaces, :delayed_project_removal, :boolean, default: false, null: false # rubocop:disable Migration/AddColumnsToWideTables
end
end
......
......@@ -16,7 +16,7 @@ class RemoveRepositoryReadOnlyToGroups < ActiveRecord::Migration[6.0]
def down
unless column_exists?(:namespaces, :repository_read_only)
with_lock_retries do
add_column :namespaces, :repository_read_only, :boolean, default: false, null: false
add_column :namespaces, :repository_read_only, :boolean, default: false, null: false # rubocop:disable Migration/AddColumnsToWideTables
end
end
end
......
......@@ -18,7 +18,7 @@ class RemoveNamespacesTrialEndsOn < ActiveRecord::Migration[6.0]
def down
unless column_exists?(:namespaces, :trial_ends_on)
with_lock_retries do
add_column :namespaces, :trial_ends_on, :datetime_with_timezone
add_column :namespaces, :trial_ends_on, :datetime_with_timezone # rubocop:disable Migration/AddColumnsToWideTables
end
end
......
......@@ -16,7 +16,7 @@ class DropNamespacesPlanId < ActiveRecord::Migration[6.0]
def down
unless column_exists?(:namespaces, :plan_id)
with_lock_retries do
add_column :namespaces, :plan_id, :integer
add_column :namespaces, :plan_id, :integer # rubocop:disable Migration/AddColumnsToWideTables
end
end
......
......@@ -7,11 +7,12 @@ module RuboCop
plan_limits
].freeze
# Tables with large number of columns (> 50 on GitLab.com as of 03/2020)
# Tables with large number of columns (> 50 on GitLab.com as of 01/2021)
WIDE_TABLES = %i[
users
projects
ci_builds
namespaces
projects
users
].freeze
# List of helpers that add new columns, either directly (ADD_COLUMN_METHODS)
......
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