diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index 6707e76272e..63d90adec61 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -187,7 +187,7 @@ rspec fast_spec_helper: db:rollback: extends: .db-job-base script: - - scripts/db_tasks db:migrate VERSION=20210301200959 + - scripts/db_tasks db:migrate VERSION=20210602155110 - scripts/db_tasks db:migrate SKIP_SCHEMA_VERSION_CHECK=true db:rollback single-db: diff --git a/.gitlab/issue_templates/Experiment Successful Cleanup.md b/.gitlab/issue_templates/Experiment Successful Cleanup.md index 1dd57332b8e..14a29452e49 100644 --- a/.gitlab/issue_templates/Experiment Successful Cleanup.md +++ b/.gitlab/issue_templates/Experiment Successful Cleanup.md @@ -11,6 +11,8 @@ The changes need to become an official part of the product. - [ ] Determine whether the feature should apply to EE - and which tiers - and/or Core - [ ] Determine if tracking should be kept as is, removed, or modified. - [ ] Ensure any relevant documentation has been updated. +- [ ] Determine whether there are other concerns that need to be considered before removing the feature flag. + - These are typically captured in the `Experiment Successful Cleanup Concerns` section of the rollout issue. - [ ] Consider changes to any `feature_category:` introduced by the experiment if ownership is changing (PM for Growth and PM for the new category as DRIs) - [ ] Check to see if the experiment introduced new design assets. Add them to the appropriate repos and document them if needed. - [ ] Optional: Migrate experiment to a default enabled [feature flag](https://docs.gitlab.com/ee/development/feature_flags) for one milestone and add a changelog. Converting to a feature flag can be skipped at the ICs discretion if risk is deemed low with consideration to both SaaS and (if applicable) self managed diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 560b459c122..80f3271ae4a 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -522c0d9283f757583fcfd43e66b4d5b323503bc0 +5ac19c65a70ffe94d1cc52232f2f23071e782cef diff --git a/app/assets/javascripts/editor/schema/ci.json b/app/assets/javascripts/editor/schema/ci.json index 9a57548ddf3..3a6ff9bbc19 100644 --- a/app/assets/javascripts/editor/schema/ci.json +++ b/app/assets/javascripts/editor/schema/ci.json @@ -240,7 +240,10 @@ ] }, "coverage_report": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "Used to collect coverage reports from the job.", "properties": { "coverage_format": { diff --git a/app/assets/javascripts/lib/utils/datetime/date_calculation_utility.js b/app/assets/javascripts/lib/utils/datetime/date_calculation_utility.js index 4e0a59d0a38..9eb812b8694 100644 --- a/app/assets/javascripts/lib/utils/datetime/date_calculation_utility.js +++ b/app/assets/javascripts/lib/utils/datetime/date_calculation_utility.js @@ -531,7 +531,7 @@ export const getOverlappingDaysInPeriods = (givenPeriodLeft = {}, givenPeriodRig /** * Mimics the behaviour of the rails distance_of_time_in_words function - * https://api.rubyonrails.org/v6.0.1/classes/ActionView/Helpers/DateHelper.html#method-i-distance_of_time_in_words + * https://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html#method-i-distance_of_time_in_words * 0 < -> 29 secs => less than a minute * 30 secs < -> 1 min, 29 secs => 1 minute * 1 min, 30 secs < -> 44 mins, 29 secs => [2..44] minutes diff --git a/app/assets/javascripts/members/components/table/role_dropdown.vue b/app/assets/javascripts/members/components/table/role_dropdown.vue index daf5e95e6ef..70808587d56 100644 --- a/app/assets/javascripts/members/components/table/role_dropdown.vue +++ b/app/assets/javascripts/members/components/table/role_dropdown.vue @@ -13,7 +13,7 @@ export default { GlDropdownItem, LdapDropdownItem: () => import('ee_component/members/components/ldap/ldap_dropdown_item.vue'), }, - inject: ['namespace'], + inject: ['namespace', 'group'], props: { member: { type: Object, @@ -32,7 +32,7 @@ export default { }, computed: { disabled() { - return this.busy || (this.permissions.canOverride && !this.member.isOverridden); + return this.permissions.canOverride && !this.member.isOverridden; }, }, mounted() { @@ -52,21 +52,29 @@ export default { return dispatch(`${this.namespace}/updateMemberRole`, payload); }, }), - async handleOverageConfirm(currentAccessLevel, value) { + async handleOverageConfirm(currentRoleValue, newRoleValue, newRoleName) { return guestOverageConfirmAction({ - currentAccessIntValue: currentAccessLevel, - dropdownIntValue: value, + currentRoleValue, + newRoleValue, + newRoleName, + group: this.group, + memberId: this.member.id, + memberType: this.namespace, }); }, - async handleSelect(value, name) { - const currentAccessLevel = this.member.accessLevel.integerValue; - if (value === currentAccessLevel) { + async handleSelect(newRoleValue, newRoleName) { + const currentRoleValue = this.member.accessLevel.integerValue; + if (newRoleValue === currentRoleValue) { return; } this.busy = true; - const confirmed = await this.handleOverageConfirm(currentAccessLevel, value); + const confirmed = await this.handleOverageConfirm( + currentRoleValue, + newRoleValue, + newRoleName, + ); if (!confirmed) { this.busy = false; return; @@ -74,7 +82,7 @@ export default { this.updateMemberRole({ memberId: this.member.id, - accessLevel: { integerValue: value, stringValue: name }, + accessLevel: { integerValue: newRoleValue, stringValue: newRoleName }, }) .then(() => { this.$toast.show(s__('Members|Role updated successfully.')); @@ -97,6 +105,7 @@ export default { :text="member.accessLevel.stringValue" :header-text="__('Change role')" :disabled="disabled" + :loading="busy" > { canExportMembers, canFilterByEnterprise, exportCsvPath, + groupName, + groupPath, ...vuexStoreAttributes } = parseDataAttributes(el); @@ -66,6 +68,10 @@ export const initMembersApp = (el, options) => { canFilterByEnterprise, canExportMembers, exportCsvPath, + group: { + name: groupName, + path: groupPath, + }, }, render: (createElement) => createElement('members-tabs'), }); diff --git a/app/controllers/import/bulk_imports_controller.rb b/app/controllers/import/bulk_imports_controller.rb index c51cb454ba1..82212a3ed89 100644 --- a/app/controllers/import/bulk_imports_controller.rb +++ b/app/controllers/import/bulk_imports_controller.rb @@ -17,6 +17,9 @@ class Import::BulkImportsController < ApplicationController session[access_token_key] = configure_params[access_token_key]&.strip session[url_key] = configure_params[url_key] + verify_blocked_uri && performed? && return + validate_configure_params! + redirect_to status_import_bulk_imports_url(namespace_id: params[:namespace_id]) end @@ -100,6 +103,16 @@ class Import::BulkImportsController < ApplicationController params.permit(access_token_key, url_key) end + def validate_configure_params! + client = BulkImports::Clients::HTTP.new( + url: credentials[:url], + token: credentials[:access_token] + ) + + client.validate_instance_version! + client.validate_import_scopes! + end + def create_params params.permit(bulk_import: bulk_import_params)[:bulk_import] end diff --git a/app/helpers/groups/group_members_helper.rb b/app/helpers/groups/group_members_helper.rb index 5034a4cb9b4..60011e31d43 100644 --- a/app/helpers/groups/group_members_helper.rb +++ b/app/helpers/groups/group_members_helper.rb @@ -13,7 +13,9 @@ module Groups::GroupMembersHelper access_request: group_members_list_data(group, access_requests.nil? ? [] : access_requests), source_id: group.id, can_manage_members: can?(current_user, :admin_group_member, group), - can_manage_access_requests: can?(current_user, :admin_member_access_request, group) + can_manage_access_requests: can?(current_user, :admin_member_access_request, group), + group_name: group.name, + group_path: group.full_path } end diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 527106de790..873251be74a 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -35,18 +35,6 @@ module IssuesHelper end end - def status_box_variant(item) - if item.try(:expired?) - 'warning' - elsif item.closed? - 'danger' - elsif item.try(:upcoming?) - 'neutral' - else - 'success' - end - end - def issue_status_visibility(issue, status_box:) case status_box when :open diff --git a/app/helpers/projects/project_members_helper.rb b/app/helpers/projects/project_members_helper.rb index 6026124abb9..634f6e8ba59 100644 --- a/app/helpers/projects/project_members_helper.rb +++ b/app/helpers/projects/project_members_helper.rb @@ -9,7 +9,9 @@ module Projects::ProjectMembersHelper access_request: project_members_list_data(project, access_requests.nil? ? [] : access_requests), source_id: project.id, can_manage_members: Ability.allowed?(current_user, :admin_project_member, project), - can_manage_access_requests: Ability.allowed?(current_user, :admin_member_access_request, project) + can_manage_access_requests: Ability.allowed?(current_user, :admin_member_access_request, project), + group_name: project.group&.name, + group_path: project.group&.full_path }.to_json end diff --git a/app/helpers/timeboxes_helper.rb b/app/helpers/timeboxes_helper.rb index 7d013dd74dc..66c9011fbcc 100644 --- a/app/helpers/timeboxes_helper.rb +++ b/app/helpers/timeboxes_helper.rb @@ -16,6 +16,18 @@ module TimeboxesHelper end end + def milestone_badge_variant(milestone) + if milestone.closed? + :danger + elsif milestone.expired? + :warning + elsif milestone.upcoming? + :neutral + else + :success + end + end + def milestones_filter_path(opts = {}) if @project project_milestones_path(@project, opts) diff --git a/app/models/namespace.rb b/app/models/namespace.rb index ad6e2147813..04787360622 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -11,17 +11,12 @@ class Namespace < ApplicationRecord include FeatureGate include FromUnion include Gitlab::Utils::StrongMemoize - include IgnorableColumns include Namespaces::Traversal::Recursive include Namespaces::Traversal::Linear include EachBatch include BlocksUnsafeSerialization include Ci::NamespaceSettings - # Temporary column used for back-filling project namespaces. - # Remove it once the back-filling of all project namespaces is done. - ignore_column :tmp_project_id, remove_with: '14.7', remove_after: '2022-01-22' - # Tells ActiveRecord not to store the full class name, in order to save some space # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69794 self.store_full_sti_class = false diff --git a/app/services/personal_access_tokens/revoke_service.rb b/app/services/personal_access_tokens/revoke_service.rb index bb5edc27340..237c95bc456 100644 --- a/app/services/personal_access_tokens/revoke_service.rb +++ b/app/services/personal_access_tokens/revoke_service.rb @@ -4,13 +4,17 @@ module PersonalAccessTokens class RevokeService < BaseService attr_reader :token, :current_user, :group - VALID_SOURCES = %w[secret_detection].freeze + VALID_SOURCES = %i[self secret_detection].freeze def initialize(current_user = nil, token: nil, group: nil, source: nil) @current_user = current_user @token = token @group = group @source = source + + @source = :self if @current_user && !@source + + raise ArgumentError unless VALID_SOURCES.include?(@source) end def execute @@ -36,22 +40,21 @@ module PersonalAccessTokens end def revocation_permitted? - if current_user + case @source + when :self Ability.allowed?(current_user, :revoke_token, token) + when :secret_detection + true else - source && VALID_SOURCES.include?(source) + false end end - def source - current_user&.username || @source - end - def log_event Gitlab::AppLogger.info( class: self.class.name, message: "PAT Revoked", - revoked_by: source, + revoked_by: current_user&.username || @source, revoked_for: token.user.username, token_id: token.id) end diff --git a/app/views/notify/access_token_revoked_email.html.haml b/app/views/notify/access_token_revoked_email.html.haml index ecd2b3e84b2..780d633f184 100644 --- a/app/views/notify/access_token_revoked_email.html.haml +++ b/app/views/notify/access_token_revoked_email.html.haml @@ -2,7 +2,7 @@ = _('Hi %{username}!') % { username: sanitize_name(@user.name) } %p = html_escape(_('A personal access token, named %{code_start}%{token_name}%{code_end}, has been revoked.')) % { code_start: ''.html_safe, token_name: @token_name, code_end: ''.html_safe } -- if @source == 'secret_detection' +- if @source == :secret_detection = _('We found your token in a public project and have automatically revoked it to protect your account.') %p - pat_link_start = ''.html_safe % { url: @target_url } diff --git a/app/views/notify/access_token_revoked_email.text.erb b/app/views/notify/access_token_revoked_email.text.erb index a0623f96488..8ddab63ae27 100644 --- a/app/views/notify/access_token_revoked_email.text.erb +++ b/app/views/notify/access_token_revoked_email.text.erb @@ -1,7 +1,7 @@ <%= _('Hi %{username}!') % { username: sanitize_name(@user.name) } %> <%= _('A personal access token, named %{token_name}, has been revoked.') % { token_name: @token_name } %> -<% if @source == 'secret_detection' %> +<% if @source == :secret_detection %> <%= _('We found your token in a public project and have automatically revoked it to protect your account.') %> <% end %> diff --git a/app/views/shared/_milestone_expired.html.haml b/app/views/shared/_milestone_expired.html.haml index 8c84f96932c..c7e780d8b4b 100644 --- a/app/views/shared/_milestone_expired.html.haml +++ b/app/views/shared/_milestone_expired.html.haml @@ -1,6 +1 @@ -- if milestone.expired? && !milestone.closed? - = gl_badge_tag _('Expired'), { variant: :warning }, { class: "gl-mb-2" } -- if milestone.upcoming? - = gl_badge_tag _('Upcoming'), { variant: :info }, { class: "gl-mb-2" } -- if milestone.closed? - = gl_badge_tag _('Closed'), { variant: :danger }, { class: "gl-mb-2" } += gl_badge_tag milestone_status_string(milestone), { variant: milestone_badge_variant(milestone) }, { class: 'gl-mb-2' } diff --git a/app/views/shared/milestones/_header.html.haml b/app/views/shared/milestones/_header.html.haml index 1d5f282dcf9..900c71675d9 100644 --- a/app/views/shared/milestones/_header.html.haml +++ b/app/views/shared/milestones/_header.html.haml @@ -1,6 +1,6 @@ .detail-page-header.milestone-page-header - = render Pajamas::BadgeComponent.new(variant: status_box_variant(milestone), class: 'gl-mr-3') do - = milestone_status_string(milestone) + = gl_badge_tag milestone_status_string(milestone), { variant: milestone_badge_variant(milestone) }, { class: 'gl-mr-3' } + .header-text-content %span.identifier %strong diff --git a/config/feature_flags/ops/enforce_memory_watchdog.yml b/config/feature_flags/ops/enforce_memory_watchdog.yml index fae127564c9..ae0ab81f9f6 100644 --- a/config/feature_flags/ops/enforce_memory_watchdog.yml +++ b/config/feature_flags/ops/enforce_memory_watchdog.yml @@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/367534 milestone: '15.2' type: ops group: group::application performance -default_enabled: false +default_enabled: true diff --git a/config/feature_flags/ops/gitlab_memory_watchdog.yml b/config/feature_flags/ops/gitlab_memory_watchdog.yml deleted file mode 100644 index f4c9a489864..00000000000 --- a/config/feature_flags/ops/gitlab_memory_watchdog.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: gitlab_memory_watchdog -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/91910 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/367534 -milestone: '15.2' -type: ops -group: group::application performance -default_enabled: false diff --git a/db/init_structure.sql b/db/init_structure.sql index b83436e85f0..00f06078426 100644 --- a/db/init_structure.sql +++ b/db/init_structure.sql @@ -41,58 +41,534 @@ RETURN NULL; END $$; -CREATE FUNCTION table_sync_function_2be879775d() RETURNS trigger +CREATE FUNCTION table_sync_function_29bc99d6db() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN IF (TG_OP = 'DELETE') THEN - DELETE FROM audit_events_archived where id = OLD.id; + DELETE FROM web_hook_logs_archived where id = OLD.id; ELSIF (TG_OP = 'UPDATE') THEN - UPDATE audit_events_archived - SET author_id = NEW.author_id, - entity_id = NEW.entity_id, - entity_type = NEW.entity_type, - details = NEW.details, + UPDATE web_hook_logs_archived + SET web_hook_id = NEW.web_hook_id, + trigger = NEW.trigger, + url = NEW.url, + request_headers = NEW.request_headers, + request_data = NEW.request_data, + response_headers = NEW.response_headers, + response_body = NEW.response_body, + response_status = NEW.response_status, + execution_duration = NEW.execution_duration, + internal_error_message = NEW.internal_error_message, created_at = NEW.created_at, - ip_address = NEW.ip_address, - author_name = NEW.author_name, - target_details = NEW.target_details, - entity_path = NEW.entity_path, - target_type = NEW.target_type, - target_id = NEW.target_id - WHERE audit_events_archived.id = NEW.id; + updated_at = NEW.updated_at + WHERE web_hook_logs_archived.id = NEW.id; ELSIF (TG_OP = 'INSERT') THEN - INSERT INTO audit_events_archived (id, - author_id, - entity_id, - entity_type, - details, + INSERT INTO web_hook_logs_archived (id, + web_hook_id, + trigger, + url, + request_headers, + request_data, + response_headers, + response_body, + response_status, + execution_duration, + internal_error_message, created_at, - ip_address, - author_name, - target_details, - entity_path, - target_type, - target_id) + updated_at) VALUES (NEW.id, - NEW.author_id, - NEW.entity_id, - NEW.entity_type, - NEW.details, + NEW.web_hook_id, + NEW.trigger, + NEW.url, + NEW.request_headers, + NEW.request_data, + NEW.response_headers, + NEW.response_body, + NEW.response_status, + NEW.execution_duration, + NEW.internal_error_message, NEW.created_at, - NEW.ip_address, - NEW.author_name, - NEW.target_details, - NEW.entity_path, - NEW.target_type, - NEW.target_id); + NEW.updated_at); END IF; RETURN NULL; END $$; -COMMENT ON FUNCTION table_sync_function_2be879775d() IS 'Partitioning migration: table sync for audit_events table'; +COMMENT ON FUNCTION table_sync_function_29bc99d6db() IS 'Partitioning migration: table sync for web_hook_logs table'; + +CREATE FUNCTION trigger_07c94931164e() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."event_id_convert_to_bigint" := NEW."event_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_21e7a2602957() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_3f6129be01d2() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."id_convert_to_bigint" := NEW."id"; + NEW."stage_id_convert_to_bigint" := NEW."stage_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_51ab7cef8934() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_69523443cc10() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."id_convert_to_bigint" := NEW."id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_77f5e1d20482() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."deployable_id_convert_to_bigint" := NEW."deployable_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_8485e97c00e3() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."source_job_id_convert_to_bigint" := NEW."source_job_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_8487d4de3e7b() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_91dc388a5fe6() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_aebe8b822ad3() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."id_convert_to_bigint" := NEW."id"; + NEW."taggable_id_convert_to_bigint" := NEW."taggable_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_be1804f21693() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."id_convert_to_bigint" := NEW."id"; + NEW."job_id_convert_to_bigint" := NEW."job_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_cf2f9e35f002() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_f1ca8ec18d78() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."job_artifact_id_convert_to_bigint" := NEW."job_artifact_id"; + RETURN NEW; +END; +$$; + +CREATE TABLE audit_events ( + id bigint NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +) +PARTITION BY RANGE (created_at); + +CREATE SEQUENCE audit_events_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE audit_events_id_seq OWNED BY audit_events.id; + +CREATE TABLE gitlab_partitions_dynamic.audit_events_000000 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000 FOR VALUES FROM (MINVALUE) TO ('2022-12-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202212 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212 FOR VALUES FROM ('2022-12-01 00:00:00') TO ('2023-01-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202301 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301 FOR VALUES FROM ('2023-01-01 00:00:00') TO ('2023-02-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202302 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302 FOR VALUES FROM ('2023-02-01 00:00:00') TO ('2023-03-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202303 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303 FOR VALUES FROM ('2023-03-01 00:00:00') TO ('2023-04-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202304 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304 FOR VALUES FROM ('2023-04-01 00:00:00') TO ('2023-05-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202305 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305 FOR VALUES FROM ('2023-05-01 00:00:00') TO ('2023-06-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202306 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00'); + +CREATE TABLE web_hook_logs ( + id bigint NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +) +PARTITION BY RANGE (created_at); + +CREATE SEQUENCE web_hook_logs_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE web_hook_logs_id_seq OWNED BY web_hook_logs.id; + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_000000 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_000000 FOR VALUES FROM (MINVALUE) TO ('2022-12-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202212 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202212 FOR VALUES FROM ('2022-12-01 00:00:00') TO ('2023-01-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202301 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202301 FOR VALUES FROM ('2023-01-01 00:00:00') TO ('2023-02-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202302 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302 FOR VALUES FROM ('2023-02-01 00:00:00') TO ('2023-03-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202303 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303 FOR VALUES FROM ('2023-03-01 00:00:00') TO ('2023-04-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202304 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304 FOR VALUES FROM ('2023-04-01 00:00:00') TO ('2023-05-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202305 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305 FOR VALUES FROM ('2023-05-01 00:00:00') TO ('2023-06-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202306 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00'); CREATE TABLE product_analytics_events_experimental ( id bigint NOT NULL, @@ -8938,7 +9414,8 @@ CREATE TABLE analytics_cycle_analytics_project_stages ( end_event_label_id bigint, hidden boolean DEFAULT false NOT NULL, custom boolean DEFAULT true NOT NULL, - name character varying(255) NOT NULL + name character varying(255) NOT NULL, + project_value_stream_id bigint NOT NULL ); CREATE SEQUENCE analytics_cycle_analytics_project_stages_id_seq @@ -8950,33 +9427,31 @@ CREATE SEQUENCE analytics_cycle_analytics_project_stages_id_seq ALTER SEQUENCE analytics_cycle_analytics_project_stages_id_seq OWNED BY analytics_cycle_analytics_project_stages.id; -CREATE TABLE analytics_devops_adoption_segment_selections ( +CREATE TABLE analytics_cycle_analytics_project_value_streams ( id bigint NOT NULL, - segment_id bigint NOT NULL, - group_id bigint, - project_id bigint, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - CONSTRAINT segment_selection_project_id_or_group_id_required CHECK ((((project_id <> NULL::bigint) AND (group_id IS NULL)) OR ((group_id <> NULL::bigint) AND (project_id IS NULL)))) + project_id bigint NOT NULL, + name text NOT NULL, + CONSTRAINT check_9b1970a898 CHECK ((char_length(name) <= 100)) ); -CREATE SEQUENCE analytics_devops_adoption_segment_selections_id_seq +CREATE SEQUENCE analytics_cycle_analytics_project_value_streams_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -ALTER SEQUENCE analytics_devops_adoption_segment_selections_id_seq OWNED BY analytics_devops_adoption_segment_selections.id; +ALTER SEQUENCE analytics_cycle_analytics_project_value_streams_id_seq OWNED BY analytics_cycle_analytics_project_value_streams.id; CREATE TABLE analytics_devops_adoption_segments ( id bigint NOT NULL, - name text, last_recorded_at timestamp with time zone, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, namespace_id integer, - CONSTRAINT check_4be7a006fd CHECK ((char_length(name) <= 255)) + display_namespace_id integer ); CREATE SEQUENCE analytics_devops_adoption_segments_id_seq @@ -8990,7 +9465,7 @@ ALTER SEQUENCE analytics_devops_adoption_segments_id_seq OWNED BY analytics_devo CREATE TABLE analytics_devops_adoption_snapshots ( id bigint NOT NULL, - segment_id bigint NOT NULL, + segment_id bigint, recorded_at timestamp with time zone NOT NULL, issue_opened boolean NOT NULL, merge_request_opened boolean NOT NULL, @@ -8999,7 +9474,11 @@ CREATE TABLE analytics_devops_adoption_snapshots ( pipeline_succeeded boolean NOT NULL, deploy_succeeded boolean NOT NULL, security_scan_succeeded boolean NOT NULL, - end_time timestamp with time zone NOT NULL + end_time timestamp with time zone NOT NULL, + total_projects_count integer, + code_owners_used_count integer, + namespace_id integer, + CONSTRAINT check_3f472de131 CHECK ((namespace_id IS NOT NULL)) ); CREATE SEQUENCE analytics_devops_adoption_snapshots_id_seq @@ -9011,22 +9490,6 @@ CREATE SEQUENCE analytics_devops_adoption_snapshots_id_seq ALTER SEQUENCE analytics_devops_adoption_snapshots_id_seq OWNED BY analytics_devops_adoption_snapshots.id; -CREATE TABLE analytics_instance_statistics_measurements ( - id bigint NOT NULL, - count bigint NOT NULL, - recorded_at timestamp with time zone NOT NULL, - identifier smallint NOT NULL -); - -CREATE SEQUENCE analytics_instance_statistics_measurements_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE analytics_instance_statistics_measurements_id_seq OWNED BY analytics_instance_statistics_measurements.id; - CREATE TABLE analytics_language_trend_repository_languages ( file_count integer DEFAULT 0 NOT NULL, programming_language_id bigint NOT NULL, @@ -9037,6 +9500,22 @@ CREATE TABLE analytics_language_trend_repository_languages ( snapshot_date date NOT NULL ); +CREATE TABLE analytics_usage_trends_measurements ( + id bigint NOT NULL, + count bigint NOT NULL, + recorded_at timestamp with time zone NOT NULL, + identifier smallint NOT NULL +); + +CREATE SEQUENCE analytics_usage_trends_measurements_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE analytics_usage_trends_measurements_id_seq OWNED BY analytics_usage_trends_measurements.id; + CREATE TABLE appearances ( id integer NOT NULL, title character varying NOT NULL, @@ -9377,13 +9856,38 @@ CREATE TABLE application_settings ( invisible_captcha_enabled boolean DEFAULT false NOT NULL, rate_limiting_response_text text, keep_latest_artifact boolean DEFAULT true NOT NULL, - enforce_ssh_key_expiration boolean DEFAULT false NOT NULL, + enforce_ssh_key_expiration boolean DEFAULT true NOT NULL, git_two_factor_session_expiry integer DEFAULT 15 NOT NULL, notes_create_limit integer DEFAULT 300 NOT NULL, notes_create_limit_allowlist text[] DEFAULT '{}'::text[] NOT NULL, in_product_marketing_emails_enabled boolean DEFAULT true NOT NULL, asset_proxy_whitelist text, + delayed_project_removal boolean DEFAULT false NOT NULL, + lock_delayed_project_removal boolean DEFAULT false NOT NULL, + admin_mode boolean DEFAULT false NOT NULL, + throttle_unauthenticated_packages_api_requests_per_period integer DEFAULT 800 NOT NULL, + throttle_unauthenticated_packages_api_period_in_seconds integer DEFAULT 15 NOT NULL, + throttle_authenticated_packages_api_requests_per_period integer DEFAULT 1000 NOT NULL, + throttle_authenticated_packages_api_period_in_seconds integer DEFAULT 15 NOT NULL, + throttle_unauthenticated_packages_api_enabled boolean DEFAULT false NOT NULL, + throttle_authenticated_packages_api_enabled boolean DEFAULT false NOT NULL, + valid_runner_registrars character varying[] DEFAULT '{project,group}'::character varying[], + whats_new_variant smallint DEFAULT 0, + external_pipeline_validation_service_timeout integer, + encrypted_external_pipeline_validation_service_token text, + encrypted_external_pipeline_validation_service_token_iv text, + external_pipeline_validation_service_url text, + deactivate_dormant_users boolean DEFAULT false NOT NULL, + encrypted_spam_check_api_key bytea, + encrypted_spam_check_api_key_iv bytea, + elasticsearch_username text, + encrypted_elasticsearch_password bytea, + encrypted_elasticsearch_password_iv bytea, + floc_enabled boolean DEFAULT false NOT NULL, + diff_max_lines integer DEFAULT 50000 NOT NULL, + diff_max_files integer DEFAULT 1000 NOT NULL, CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)), + CONSTRAINT app_settings_ext_pipeline_validation_service_url_text_limit CHECK ((char_length(external_pipeline_validation_service_url) <= 255)), CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)), CONSTRAINT check_17d9558205 CHECK ((char_length(kroki_url) <= 1024)), CONSTRAINT check_2dba05b802 CHECK ((char_length(gitpod_url) <= 255)), @@ -9398,6 +9902,7 @@ CREATE TABLE application_settings ( CONSTRAINT check_b4f67a6296 CHECK ((allow_local_requests_from_web_hooks_and_services IS NOT NULL)), CONSTRAINT check_d03919528d CHECK ((char_length(container_registry_vendor) <= 255)), CONSTRAINT check_d820146492 CHECK ((char_length(spam_check_endpoint_url) <= 255)), + CONSTRAINT check_e5024c8801 CHECK ((char_length(elasticsearch_username) <= 255)), CONSTRAINT check_e5aba18f02 CHECK ((char_length(container_registry_version) <= 255)), CONSTRAINT check_ef6176834f CHECK ((char_length(encrypted_cloud_license_auth_token_iv) <= 255)) ); @@ -9631,55 +10136,6 @@ CREATE SEQUENCE atlassian_identities_user_id_seq ALTER SEQUENCE atlassian_identities_user_id_seq OWNED BY atlassian_identities.user_id; -CREATE TABLE audit_events ( - id bigint NOT NULL, - author_id integer NOT NULL, - entity_id integer NOT NULL, - entity_type character varying NOT NULL, - details text, - ip_address inet, - author_name text, - target_details text, - entity_path text, - created_at timestamp without time zone NOT NULL, - target_type text, - target_id bigint, - CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), - CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), - CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), - CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) -) -PARTITION BY RANGE (created_at); - -CREATE TABLE audit_events_archived ( - id integer NOT NULL, - author_id integer NOT NULL, - entity_id integer NOT NULL, - entity_type character varying NOT NULL, - details text, - created_at timestamp without time zone, - ip_address inet, - author_name text, - target_details text, - entity_path text, - target_type text, - target_id bigint, - CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), - CONSTRAINT check_82294106dd CHECK ((char_length(target_type) <= 255)), - CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), - CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) -); - -CREATE SEQUENCE audit_events_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE audit_events_id_seq OWNED BY audit_events.id; - CREATE TABLE authentication_events ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -9784,7 +10240,9 @@ CREATE TABLE batched_background_migration_jobs ( batch_size integer NOT NULL, sub_batch_size integer NOT NULL, status smallint DEFAULT 0 NOT NULL, - attempts smallint DEFAULT 0 NOT NULL + attempts smallint DEFAULT 0 NOT NULL, + metrics jsonb DEFAULT '{}'::jsonb NOT NULL, + pause_ms integer DEFAULT 100 NOT NULL ); CREATE SEQUENCE batched_background_migration_jobs_id_seq @@ -9807,10 +10265,12 @@ CREATE TABLE batched_background_migrations ( "interval" smallint NOT NULL, status smallint DEFAULT 0 NOT NULL, job_class_name text NOT NULL, - batch_class_name text DEFAULT 'Gitlab::Database::BackgroundMigration::PrimaryKeyBatchingStrategy'::text NOT NULL, + batch_class_name text DEFAULT 'PrimaryKeyBatchingStrategy'::text NOT NULL, table_name text NOT NULL, column_name text NOT NULL, job_arguments jsonb DEFAULT '"[]"'::jsonb NOT NULL, + total_tuple_count bigint, + pause_ms integer DEFAULT 100 NOT NULL, CONSTRAINT check_5bb0382d6f CHECK ((char_length(column_name) <= 63)), CONSTRAINT check_6b6a06254a CHECK ((char_length(table_name) <= 63)), CONSTRAINT check_batch_size_in_range CHECK ((batch_size >= sub_batch_size)), @@ -9963,6 +10423,24 @@ CREATE SEQUENCE boards_epic_board_positions_id_seq ALTER SEQUENCE boards_epic_board_positions_id_seq OWNED BY boards_epic_board_positions.id; +CREATE TABLE boards_epic_board_recent_visits ( + id bigint NOT NULL, + user_id bigint NOT NULL, + epic_board_id bigint NOT NULL, + group_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE boards_epic_board_recent_visits_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE boards_epic_board_recent_visits_id_seq OWNED BY boards_epic_board_recent_visits.id; + CREATE TABLE boards_epic_boards ( id bigint NOT NULL, hide_backlog_list boolean DEFAULT false NOT NULL, @@ -10123,6 +10601,47 @@ CREATE SEQUENCE bulk_import_entities_id_seq ALTER SEQUENCE bulk_import_entities_id_seq OWNED BY bulk_import_entities.id; +CREATE TABLE bulk_import_export_uploads ( + id bigint NOT NULL, + export_id bigint NOT NULL, + updated_at timestamp with time zone NOT NULL, + export_file text, + CONSTRAINT check_5add76239d CHECK ((char_length(export_file) <= 255)) +); + +CREATE SEQUENCE bulk_import_export_uploads_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE bulk_import_export_uploads_id_seq OWNED BY bulk_import_export_uploads.id; + +CREATE TABLE bulk_import_exports ( + id bigint NOT NULL, + group_id bigint, + project_id bigint, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + status smallint DEFAULT 0 NOT NULL, + relation text NOT NULL, + jid text, + error text, + CONSTRAINT check_24cb010672 CHECK ((char_length(relation) <= 255)), + CONSTRAINT check_8f0f357334 CHECK ((char_length(error) <= 255)), + CONSTRAINT check_9ee6d14d33 CHECK ((char_length(jid) <= 255)) +); + +CREATE SEQUENCE bulk_import_exports_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE bulk_import_exports_id_seq OWNED BY bulk_import_exports.id; + CREATE TABLE bulk_import_failures ( id bigint NOT NULL, bulk_import_entity_id bigint NOT NULL, @@ -10154,8 +10673,12 @@ CREATE TABLE bulk_import_trackers ( relation text NOT NULL, next_page text, has_next_page boolean DEFAULT false NOT NULL, + jid text, + stage smallint DEFAULT 0 NOT NULL, + status smallint DEFAULT 0 NOT NULL, CONSTRAINT check_2d45cae629 CHECK ((char_length(relation) <= 255)), CONSTRAINT check_40aeaa600b CHECK ((char_length(next_page) <= 255)), + CONSTRAINT check_603f91cb06 CHECK ((char_length(jid) <= 255)), CONSTRAINT check_next_page_requirement CHECK (((has_next_page IS FALSE) OR (next_page IS NOT NULL))) ); @@ -10233,7 +10756,8 @@ CREATE TABLE ci_build_needs ( build_id integer NOT NULL, name text NOT NULL, artifacts boolean DEFAULT true NOT NULL, - optional boolean DEFAULT false NOT NULL + optional boolean DEFAULT false NOT NULL, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_build_needs_id_seq @@ -10288,7 +10812,8 @@ CREATE TABLE ci_build_trace_chunks ( data_store integer NOT NULL, raw_data bytea, checksum bytea, - lock_version integer DEFAULT 0 NOT NULL + lock_version integer DEFAULT 0 NOT NULL, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_build_trace_chunks_id_seq @@ -10323,7 +10848,8 @@ CREATE TABLE ci_build_trace_sections ( byte_start bigint NOT NULL, byte_end bigint NOT NULL, build_id integer NOT NULL, - section_name_id integer NOT NULL + section_name_id integer NOT NULL, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE TABLE ci_builds ( @@ -10371,7 +10897,9 @@ CREATE TABLE ci_builds ( processed boolean, resource_group_id bigint, waiting_for_resource_at timestamp with time zone, - scheduling_type smallint + scheduling_type smallint, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL, + stage_id_convert_to_bigint bigint ); CREATE SEQUENCE ci_builds_id_seq @@ -10396,7 +10924,8 @@ CREATE TABLE ci_builds_metadata ( has_exposed_artifacts boolean, environment_auto_stop_in character varying(255), expanded_environment_name character varying(255), - secrets jsonb DEFAULT '{}'::jsonb NOT NULL + secrets jsonb DEFAULT '{}'::jsonb NOT NULL, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_builds_metadata_id_seq @@ -10414,7 +10943,8 @@ CREATE TABLE ci_builds_runner_session ( build_id integer NOT NULL, url character varying NOT NULL, certificate character varying, - "authorization" character varying + "authorization" character varying, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_builds_runner_session_id_seq @@ -10500,7 +11030,8 @@ CREATE TABLE ci_group_variables ( updated_at timestamp with time zone NOT NULL, masked boolean DEFAULT false NOT NULL, variable_type smallint DEFAULT 1 NOT NULL, - environment_scope text DEFAULT '*'::text NOT NULL + environment_scope text DEFAULT '*'::text NOT NULL, + CONSTRAINT check_dfe009485a CHECK ((char_length(environment_scope) <= 255)) ); CREATE SEQUENCE ci_group_variables_id_seq @@ -10549,6 +11080,8 @@ CREATE TABLE ci_job_artifacts ( file_sha256 bytea, file_format smallint, file_location smallint, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL, + job_id_convert_to_bigint bigint DEFAULT 0 NOT NULL, CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL)) ); @@ -10562,6 +11095,23 @@ CREATE SEQUENCE ci_job_artifacts_id_seq ALTER SEQUENCE ci_job_artifacts_id_seq OWNED BY ci_job_artifacts.id; +CREATE TABLE ci_job_token_project_scope_links ( + id bigint NOT NULL, + source_project_id bigint NOT NULL, + target_project_id bigint NOT NULL, + added_by_id bigint, + created_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE ci_job_token_project_scope_links_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_job_token_project_scope_links_id_seq OWNED BY ci_job_token_project_scope_links.id; + CREATE TABLE ci_job_variables ( id bigint NOT NULL, key character varying NOT NULL, @@ -10581,6 +11131,26 @@ CREATE SEQUENCE ci_job_variables_id_seq ALTER SEQUENCE ci_job_variables_id_seq OWNED BY ci_job_variables.id; +CREATE TABLE ci_minutes_additional_packs ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + namespace_id bigint NOT NULL, + expires_at date, + number_of_minutes integer NOT NULL, + purchase_xid text, + CONSTRAINT check_d7ef254af0 CHECK ((char_length(purchase_xid) <= 32)) +); + +CREATE SEQUENCE ci_minutes_additional_packs_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_minutes_additional_packs_id_seq OWNED BY ci_minutes_additional_packs.id; + CREATE TABLE ci_namespace_monthly_usages ( id bigint NOT NULL, namespace_id bigint NOT NULL, @@ -10599,6 +11169,22 @@ CREATE SEQUENCE ci_namespace_monthly_usages_id_seq ALTER SEQUENCE ci_namespace_monthly_usages_id_seq OWNED BY ci_namespace_monthly_usages.id; +CREATE TABLE ci_pending_builds ( + id bigint NOT NULL, + build_id bigint NOT NULL, + project_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL +); + +CREATE SEQUENCE ci_pending_builds_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_pending_builds_id_seq OWNED BY ci_pending_builds.id; + CREATE TABLE ci_pipeline_artifacts ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -10611,8 +11197,16 @@ CREATE TABLE ci_pipeline_artifacts ( file_format smallint NOT NULL, file text, expire_at timestamp with time zone, + verification_started_at timestamp with time zone, + verification_retry_at timestamp with time zone, + verified_at timestamp with time zone, + verification_state smallint DEFAULT 0 NOT NULL, + verification_retry_count smallint, + verification_checksum bytea, + verification_failure text, CONSTRAINT check_191b5850ec CHECK ((char_length(file) <= 255)), - CONSTRAINT check_abeeb71caf CHECK ((file IS NOT NULL)) + CONSTRAINT check_abeeb71caf CHECK ((file IS NOT NULL)), + CONSTRAINT ci_pipeline_artifacts_verification_failure_text_limit CHECK ((char_length(verification_failure) <= 255)) ); CREATE SEQUENCE ci_pipeline_artifacts_id_seq @@ -10922,7 +11516,8 @@ CREATE TABLE ci_runners ( runner_type smallint NOT NULL, token_encrypted character varying, public_projects_minutes_cost_factor double precision DEFAULT 0.0 NOT NULL, - private_projects_minutes_cost_factor double precision DEFAULT 1.0 NOT NULL + private_projects_minutes_cost_factor double precision DEFAULT 1.0 NOT NULL, + config jsonb DEFAULT '{}'::jsonb NOT NULL ); CREATE SEQUENCE ci_runners_id_seq @@ -10935,13 +11530,32 @@ CREATE SEQUENCE ci_runners_id_seq ALTER SEQUENCE ci_runners_id_seq OWNED BY ci_runners.id; +CREATE TABLE ci_running_builds ( + id bigint NOT NULL, + build_id bigint NOT NULL, + project_id bigint NOT NULL, + runner_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + runner_type smallint NOT NULL +); + +CREATE SEQUENCE ci_running_builds_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_running_builds_id_seq OWNED BY ci_running_builds.id; + CREATE TABLE ci_sources_pipelines ( id integer NOT NULL, project_id integer, pipeline_id integer, source_project_id integer, source_job_id integer, - source_pipeline_id integer + source_pipeline_id integer, + source_job_id_convert_to_bigint bigint ); CREATE SEQUENCE ci_sources_pipelines_id_seq @@ -11078,6 +11692,42 @@ CREATE SEQUENCE ci_triggers_id_seq ALTER SEQUENCE ci_triggers_id_seq OWNED BY ci_triggers.id; +CREATE TABLE ci_unit_test_failures ( + id bigint NOT NULL, + failed_at timestamp with time zone NOT NULL, + unit_test_id bigint NOT NULL, + build_id bigint NOT NULL +); + +CREATE SEQUENCE ci_unit_test_failures_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_unit_test_failures_id_seq OWNED BY ci_unit_test_failures.id; + +CREATE TABLE ci_unit_tests ( + id bigint NOT NULL, + project_id bigint NOT NULL, + key_hash text NOT NULL, + name text NOT NULL, + suite_name text NOT NULL, + CONSTRAINT check_248fae1a3b CHECK ((char_length(name) <= 255)), + CONSTRAINT check_b288215ffe CHECK ((char_length(key_hash) <= 64)), + CONSTRAINT check_c2d57b3c49 CHECK ((char_length(suite_name) <= 255)) +); + +CREATE SEQUENCE ci_unit_tests_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_unit_tests_id_seq OWNED BY ci_unit_tests.id; + CREATE TABLE ci_variables ( id integer NOT NULL, key character varying NOT NULL, @@ -11111,6 +11761,8 @@ CREATE TABLE cluster_agent_tokens ( created_by_user_id bigint, description text, name text, + last_used_at timestamp with time zone, + CONSTRAINT check_0fb634d04d CHECK ((name IS NOT NULL)), CONSTRAINT check_2b79dbb315 CHECK ((char_length(name) <= 255)), CONSTRAINT check_4e4ec5070a CHECK ((char_length(description) <= 1024)), CONSTRAINT check_c60daed227 CHECK ((char_length(token_encrypted) <= 255)) @@ -11537,6 +12189,24 @@ CREATE SEQUENCE clusters_id_seq ALTER SEQUENCE clusters_id_seq OWNED BY clusters.id; +CREATE TABLE clusters_integration_elasticstack ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + cluster_id bigint NOT NULL, + enabled boolean DEFAULT false NOT NULL, + chart_version text, + CONSTRAINT check_f8d671ce04 CHECK ((char_length(chart_version) <= 10)) +); + +CREATE TABLE clusters_integration_prometheus ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + cluster_id bigint NOT NULL, + enabled boolean DEFAULT false NOT NULL, + encrypted_alert_manager_token text, + encrypted_alert_manager_token_iv text +); + CREATE TABLE clusters_kubernetes_namespaces ( id bigint NOT NULL, cluster_id integer NOT NULL, @@ -11749,6 +12419,13 @@ CREATE SEQUENCE dast_profiles_id_seq ALTER SEQUENCE dast_profiles_id_seq OWNED BY dast_profiles.id; +CREATE TABLE dast_profiles_pipelines ( + dast_profile_id bigint NOT NULL, + ci_pipeline_id bigint NOT NULL +); + +COMMENT ON TABLE dast_profiles_pipelines IS '{"owner":"group::dynamic analysis","description":"Join table between DAST Profiles and CI Pipelines"}'; + CREATE TABLE dast_scanner_profiles ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -11772,6 +12449,31 @@ CREATE SEQUENCE dast_scanner_profiles_id_seq ALTER SEQUENCE dast_scanner_profiles_id_seq OWNED BY dast_scanner_profiles.id; +CREATE TABLE dast_site_profile_secret_variables ( + id bigint NOT NULL, + dast_site_profile_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + variable_type smallint DEFAULT 1 NOT NULL, + key text NOT NULL, + encrypted_value bytea NOT NULL, + encrypted_value_iv bytea NOT NULL, + CONSTRAINT check_236213f179 CHECK ((length(encrypted_value) <= 13352)), + CONSTRAINT check_8cbef204b2 CHECK ((char_length(key) <= 255)), + CONSTRAINT check_b49080abbf CHECK ((length(encrypted_value_iv) <= 17)) +); + +COMMENT ON TABLE dast_site_profile_secret_variables IS '{"owner":"group::dynamic analysis","description":"Secret variables used in DAST on-demand scans"}'; + +CREATE SEQUENCE dast_site_profile_secret_variables_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE dast_site_profile_secret_variables_id_seq OWNED BY dast_site_profile_secret_variables.id; + CREATE TABLE dast_site_profiles ( id bigint NOT NULL, project_id bigint NOT NULL, @@ -11779,7 +12481,18 @@ CREATE TABLE dast_site_profiles ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, name text NOT NULL, - CONSTRAINT check_6cfab17b48 CHECK ((char_length(name) <= 255)) + excluded_urls text[] DEFAULT '{}'::text[] NOT NULL, + auth_enabled boolean DEFAULT false NOT NULL, + auth_url text, + auth_username_field text, + auth_password_field text, + auth_username text, + target_type smallint DEFAULT 0 NOT NULL, + CONSTRAINT check_5203110fee CHECK ((char_length(auth_username_field) <= 255)), + CONSTRAINT check_6cfab17b48 CHECK ((char_length(name) <= 255)), + CONSTRAINT check_c329dffdba CHECK ((char_length(auth_password_field) <= 255)), + CONSTRAINT check_d446f7047b CHECK ((char_length(auth_url) <= 1024)), + CONSTRAINT check_f22f18002a CHECK ((char_length(auth_username) <= 255)) ); CREATE SEQUENCE dast_site_profiles_id_seq @@ -11791,6 +12504,13 @@ CREATE SEQUENCE dast_site_profiles_id_seq ALTER SEQUENCE dast_site_profiles_id_seq OWNED BY dast_site_profiles.id; +CREATE TABLE dast_site_profiles_pipelines ( + dast_site_profile_id bigint NOT NULL, + ci_pipeline_id bigint NOT NULL +); + +COMMENT ON TABLE dast_site_profiles_pipelines IS '{"owner":"group::dynamic analysis","description":"Join table between DAST Site Profiles and CI Pipelines"}'; + CREATE TABLE dast_site_tokens ( id bigint NOT NULL, project_id bigint NOT NULL, @@ -11997,7 +12717,8 @@ CREATE TABLE deployments ( on_stop character varying, finished_at timestamp with time zone, status smallint NOT NULL, - cluster_id integer + cluster_id integer, + deployable_id_convert_to_bigint bigint ); CREATE SEQUENCE deployments_id_seq @@ -12167,13 +12888,53 @@ CREATE SEQUENCE draft_notes_id_seq ALTER SEQUENCE draft_notes_id_seq OWNED BY draft_notes.id; +CREATE TABLE elastic_index_settings ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + number_of_replicas smallint DEFAULT 1 NOT NULL, + number_of_shards smallint DEFAULT 5 NOT NULL, + alias_name text NOT NULL, + CONSTRAINT check_c30005c325 CHECK ((char_length(alias_name) <= 255)) +); + +CREATE SEQUENCE elastic_index_settings_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE elastic_index_settings_id_seq OWNED BY elastic_index_settings.id; + +CREATE TABLE elastic_reindexing_slices ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + elastic_reindexing_subtask_id bigint NOT NULL, + elastic_slice smallint DEFAULT 0 NOT NULL, + elastic_max_slice smallint DEFAULT 0 NOT NULL, + retry_attempt smallint DEFAULT 0 NOT NULL, + elastic_task text, + CONSTRAINT check_ca30e1396e CHECK ((char_length(elastic_task) <= 255)) +); + +CREATE SEQUENCE elastic_reindexing_slices_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE elastic_reindexing_slices_id_seq OWNED BY elastic_reindexing_slices.id; + CREATE TABLE elastic_reindexing_subtasks ( id bigint NOT NULL, elastic_reindexing_task_id bigint NOT NULL, alias_name text NOT NULL, index_name_from text NOT NULL, index_name_to text NOT NULL, - elastic_task text NOT NULL, + elastic_task text, documents_count_target integer, documents_count integer, created_at timestamp with time zone NOT NULL, @@ -12206,6 +12967,8 @@ CREATE TABLE elastic_reindexing_tasks ( error_message text, documents_count_target integer, delete_original_index_at timestamp with time zone, + max_slices_running smallint DEFAULT 60 NOT NULL, + slice_multiplier smallint DEFAULT 2 NOT NULL, CONSTRAINT check_04151aca42 CHECK ((char_length(index_name_from) <= 255)), CONSTRAINT check_7f64acda8e CHECK ((char_length(error_message) <= 255)), CONSTRAINT check_85ebff7124 CHECK ((char_length(index_name_to) <= 255)), @@ -12389,6 +13152,7 @@ CREATE TABLE events ( target_type character varying, group_id bigint, fingerprint bytea, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL, CONSTRAINT check_97e06e05ad CHECK ((octet_length(fingerprint) <= 128)) ); @@ -12424,14 +13188,14 @@ CREATE TABLE experiment_subjects ( id bigint NOT NULL, experiment_id bigint NOT NULL, user_id bigint, - group_id bigint, project_id bigint, variant smallint DEFAULT 0 NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, converted_at timestamp with time zone, context jsonb DEFAULT '{}'::jsonb NOT NULL, - CONSTRAINT chk_has_one_subject CHECK ((num_nonnulls(user_id, group_id, project_id) = 1)) + namespace_id bigint, + CONSTRAINT check_f6411bc4b5 CHECK ((num_nonnulls(user_id, namespace_id, project_id) = 1)) ); CREATE SEQUENCE experiment_subjects_id_seq @@ -12721,7 +13485,8 @@ ALTER SEQUENCE geo_hashed_storage_migrated_events_id_seq OWNED BY geo_hashed_sto CREATE TABLE geo_job_artifact_deleted_events ( id bigint NOT NULL, job_artifact_id integer NOT NULL, - file_path character varying NOT NULL + file_path character varying NOT NULL, + job_artifact_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE geo_job_artifact_deleted_events_id_seq @@ -13008,7 +13773,8 @@ CREATE TABLE gitlab_subscription_histories ( gitlab_subscription_id bigint NOT NULL, created_at timestamp with time zone, trial_starts_on date, - auto_renew boolean + auto_renew boolean, + trial_extension_type smallint ); CREATE SEQUENCE gitlab_subscription_histories_id_seq @@ -13035,7 +13801,9 @@ CREATE TABLE gitlab_subscriptions ( trial_starts_on date, auto_renew boolean, seats_in_use integer DEFAULT 0 NOT NULL, - seats_owed integer DEFAULT 0 NOT NULL + seats_owed integer DEFAULT 0 NOT NULL, + trial_extension_type smallint, + CONSTRAINT check_77fea3f0e7 CHECK ((namespace_id IS NOT NULL)) ); CREATE SEQUENCE gitlab_subscriptions_id_seq @@ -13257,7 +14025,11 @@ CREATE TABLE group_merge_request_approval_settings ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, group_id bigint NOT NULL, - allow_author_approval boolean DEFAULT false NOT NULL + allow_author_approval boolean DEFAULT false NOT NULL, + allow_committer_approval boolean DEFAULT false NOT NULL, + allow_overrides_to_approver_list_per_merge_request boolean DEFAULT false NOT NULL, + retain_approvals_on_push boolean DEFAULT false NOT NULL, + require_password_to_approve boolean DEFAULT false NOT NULL ); CREATE TABLE group_repository_storage_moves ( @@ -13335,7 +14107,9 @@ CREATE TABLE import_export_uploads ( project_id integer, import_file text, export_file text, - group_id bigint + group_id bigint, + remote_import_url text, + CONSTRAINT check_58f0d37481 CHECK ((char_length(remote_import_url) <= 512)) ); CREATE SEQUENCE import_export_uploads_id_seq @@ -13371,6 +14145,60 @@ CREATE SEQUENCE import_failures_id_seq ALTER SEQUENCE import_failures_id_seq OWNED BY import_failures.id; +CREATE TABLE in_product_marketing_emails ( + id bigint NOT NULL, + user_id bigint NOT NULL, + cta_clicked_at timestamp with time zone, + track smallint NOT NULL, + series smallint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE in_product_marketing_emails_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE in_product_marketing_emails_id_seq OWNED BY in_product_marketing_emails.id; + +CREATE TABLE incident_management_escalation_policies ( + id bigint NOT NULL, + project_id bigint NOT NULL, + name text NOT NULL, + description text, + CONSTRAINT check_510b2a5258 CHECK ((char_length(description) <= 160)), + CONSTRAINT check_9a26365850 CHECK ((char_length(name) <= 72)) +); + +CREATE SEQUENCE incident_management_escalation_policies_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE incident_management_escalation_policies_id_seq OWNED BY incident_management_escalation_policies.id; + +CREATE TABLE incident_management_escalation_rules ( + id bigint NOT NULL, + policy_id bigint NOT NULL, + oncall_schedule_id bigint NOT NULL, + status smallint NOT NULL, + elapsed_time_seconds integer NOT NULL +); + +CREATE SEQUENCE incident_management_escalation_rules_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE incident_management_escalation_rules_id_seq OWNED BY incident_management_escalation_rules.id; + CREATE TABLE incident_management_oncall_participants ( id bigint NOT NULL, oncall_rotation_id bigint NOT NULL, @@ -13749,6 +14577,9 @@ CREATE TABLE iterations_cadences ( active boolean DEFAULT true NOT NULL, automatic boolean DEFAULT true NOT NULL, title text NOT NULL, + roll_over boolean DEFAULT false NOT NULL, + description text, + CONSTRAINT check_5c5d2b44bd CHECK ((char_length(description) <= 5000)), CONSTRAINT check_fedff82d3b CHECK ((char_length(title) <= 255)) ); @@ -13766,7 +14597,9 @@ CREATE TABLE jira_connect_installations ( client_key character varying, encrypted_shared_secret character varying, encrypted_shared_secret_iv character varying, - base_url character varying + base_url character varying, + instance_url text, + CONSTRAINT check_4c6abed669 CHECK ((char_length(instance_url) <= 255)) ); CREATE SEQUENCE jira_connect_installations_id_seq @@ -13844,14 +14677,6 @@ CREATE TABLE jira_tracker_data ( deployment_type smallint DEFAULT 0 NOT NULL, vulnerabilities_issuetype text, vulnerabilities_enabled boolean DEFAULT false NOT NULL, - encrypted_proxy_address text, - encrypted_proxy_address_iv text, - encrypted_proxy_port text, - encrypted_proxy_port_iv text, - encrypted_proxy_username text, - encrypted_proxy_username_iv text, - encrypted_proxy_password text, - encrypted_proxy_password_iv text, jira_issue_transition_automatic boolean DEFAULT false NOT NULL, CONSTRAINT check_0bf84b76e9 CHECK ((char_length(vulnerabilities_issuetype) <= 255)), CONSTRAINT check_214cf6a48b CHECK ((char_length(project_key) <= 255)) @@ -13878,7 +14703,9 @@ CREATE TABLE keys ( public boolean DEFAULT false NOT NULL, last_used_at timestamp without time zone, fingerprint_sha256 bytea, - expires_at timestamp with time zone + expires_at timestamp with time zone, + expiry_notification_delivered_at timestamp with time zone, + before_expiry_notification_delivered_at timestamp with time zone ); CREATE SEQUENCE keys_id_seq @@ -14037,7 +14864,8 @@ CREATE TABLE licenses ( id integer NOT NULL, data text NOT NULL, created_at timestamp without time zone, - updated_at timestamp without time zone + updated_at timestamp without time zone, + cloud boolean DEFAULT false ); CREATE SEQUENCE licenses_id_seq @@ -14215,6 +15043,24 @@ CREATE SEQUENCE merge_request_context_commits_id_seq ALTER SEQUENCE merge_request_context_commits_id_seq OWNED BY merge_request_context_commits.id; +CREATE TABLE merge_request_diff_commit_users ( + id bigint NOT NULL, + name text, + email text, + CONSTRAINT check_147358fc42 CHECK ((char_length(name) <= 512)), + CONSTRAINT check_f5fa206cf7 CHECK ((char_length(email) <= 512)), + CONSTRAINT merge_request_diff_commit_users_name_or_email_existence CHECK (((COALESCE(name, ''::text) <> ''::text) OR (COALESCE(email, ''::text) <> ''::text))) +); + +CREATE SEQUENCE merge_request_diff_commit_users_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_request_diff_commit_users_id_seq OWNED BY merge_request_diff_commit_users.id; + CREATE TABLE merge_request_diff_commits ( authored_date timestamp with time zone, committed_date timestamp with time zone, @@ -14226,7 +15072,9 @@ CREATE TABLE merge_request_diff_commits ( committer_name text, committer_email text, message text, - trailers jsonb DEFAULT '{}'::jsonb NOT NULL + trailers jsonb DEFAULT '{}'::jsonb NOT NULL, + commit_author_id bigint, + committer_id bigint ); CREATE TABLE merge_request_diff_details ( @@ -14236,6 +15084,8 @@ CREATE TABLE merge_request_diff_details ( verification_retry_count smallint, verification_checksum bytea, verification_failure text, + verification_state smallint DEFAULT 0 NOT NULL, + verification_started_at timestamp with time zone, CONSTRAINT check_81429e3622 CHECK ((char_length(verification_failure) <= 255)) ); @@ -14408,7 +15258,8 @@ CREATE TABLE merge_requests ( rebase_jid character varying, squash_commit_sha bytea, sprint_id bigint, - merge_ref_sha bytea + merge_ref_sha bytea, + draft boolean DEFAULT false NOT NULL ); CREATE TABLE merge_requests_closing_issues ( @@ -14576,6 +15427,9 @@ CREATE TABLE namespace_package_settings ( namespace_id bigint NOT NULL, maven_duplicates_allowed boolean DEFAULT true NOT NULL, maven_duplicate_exception_regex text DEFAULT ''::text NOT NULL, + generic_duplicates_allowed boolean DEFAULT true NOT NULL, + generic_duplicate_exception_regex text DEFAULT ''::text NOT NULL, + CONSTRAINT check_31340211b1 CHECK ((char_length(generic_duplicate_exception_regex) <= 255)), CONSTRAINT check_d63274b2b6 CHECK ((char_length(maven_duplicate_exception_regex) <= 255)) ); @@ -14611,7 +15465,10 @@ CREATE TABLE namespace_settings ( allow_mfa_for_subgroups boolean DEFAULT true NOT NULL, default_branch_name text, repository_read_only boolean DEFAULT false NOT NULL, - delayed_project_removal boolean DEFAULT false NOT NULL, + delayed_project_removal boolean, + lock_delayed_project_removal boolean DEFAULT false NOT NULL, + resource_access_token_creation_allowed boolean DEFAULT true NOT NULL, + prevent_sharing_groups_outside_hierarchy boolean DEFAULT false NOT NULL, CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)) ); @@ -14745,7 +15602,8 @@ CREATE TABLE notes ( change_position text, resolved_by_push boolean, review_id bigint, - confidential boolean + confidential boolean, + last_edited_at timestamp with time zone ); CREATE SEQUENCE notes_id_seq @@ -15232,6 +16090,30 @@ CREATE SEQUENCE packages_debian_group_components_id_seq ALTER SEQUENCE packages_debian_group_components_id_seq OWNED BY packages_debian_group_components.id; +CREATE TABLE packages_debian_group_distribution_keys ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + distribution_id bigint NOT NULL, + encrypted_private_key text NOT NULL, + encrypted_private_key_iv text NOT NULL, + encrypted_passphrase text NOT NULL, + encrypted_passphrase_iv text NOT NULL, + public_key text NOT NULL, + fingerprint text NOT NULL, + CONSTRAINT check_bc95dc3fbe CHECK ((char_length(fingerprint) <= 255)), + CONSTRAINT check_f708183491 CHECK ((char_length(public_key) <= 524288)) +); + +CREATE SEQUENCE packages_debian_group_distribution_keys_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_debian_group_distribution_keys_id_seq OWNED BY packages_debian_group_distribution_keys.id; + CREATE TABLE packages_debian_group_distributions ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -15334,6 +16216,30 @@ CREATE SEQUENCE packages_debian_project_components_id_seq ALTER SEQUENCE packages_debian_project_components_id_seq OWNED BY packages_debian_project_components.id; +CREATE TABLE packages_debian_project_distribution_keys ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + distribution_id bigint NOT NULL, + encrypted_private_key text NOT NULL, + encrypted_private_key_iv text NOT NULL, + encrypted_passphrase text NOT NULL, + encrypted_passphrase_iv text NOT NULL, + public_key text NOT NULL, + fingerprint text NOT NULL, + CONSTRAINT check_9e8a5eef0a CHECK ((char_length(fingerprint) <= 255)), + CONSTRAINT check_d188f6547f CHECK ((char_length(public_key) <= 524288)) +); + +CREATE SEQUENCE packages_debian_project_distribution_keys_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_debian_project_distribution_keys_id_seq OWNED BY packages_debian_project_distribution_keys.id; + CREATE TABLE packages_debian_project_distributions ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -15440,6 +16346,15 @@ CREATE SEQUENCE packages_events_id_seq ALTER SEQUENCE packages_events_id_seq OWNED BY packages_events.id; +CREATE TABLE packages_helm_file_metadata ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + package_file_id bigint NOT NULL, + channel text NOT NULL, + metadata jsonb, + CONSTRAINT check_c34067922d CHECK ((char_length(channel) <= 63)) +); + CREATE TABLE packages_maven_metadata ( id bigint NOT NULL, package_id bigint NOT NULL, @@ -15819,7 +16734,13 @@ CREATE TABLE plan_limits ( daily_invites integer DEFAULT 0 NOT NULL, ci_pipeline_deployments integer DEFAULT 500 NOT NULL, pull_mirror_interval_seconds integer DEFAULT 300 NOT NULL, - rubygems_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL + rubygems_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL, + terraform_module_max_file_size bigint DEFAULT 1073741824 NOT NULL, + helm_max_file_size bigint DEFAULT 5242880 NOT NULL, + ci_registered_group_runners integer DEFAULT 1000 NOT NULL, + ci_registered_project_runners integer DEFAULT 1000 NOT NULL, + web_hook_calls integer DEFAULT 0 NOT NULL, + ci_daily_pipeline_schedule_triggers integer DEFAULT 0 NOT NULL ); CREATE SEQUENCE plan_limits_id_seq @@ -16471,7 +17392,8 @@ CREATE TABLE project_settings ( has_confluence boolean DEFAULT false NOT NULL, cve_id_request_enabled boolean DEFAULT true NOT NULL, has_vulnerabilities boolean DEFAULT false NOT NULL, - prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL + prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL, + mr_default_target_self boolean DEFAULT false NOT NULL ); CREATE TABLE project_statistics ( @@ -16576,7 +17498,7 @@ CREATE TABLE projects ( disable_overriding_approvers_per_merge_request boolean, external_webhook_token character varying, issues_template text, - merge_requests_author_approval boolean, + merge_requests_author_approval boolean DEFAULT false, merge_requests_disable_committers_approval boolean, merge_requests_template text, mirror_last_successful_update_at timestamp without time zone, @@ -16784,10 +17706,12 @@ ALTER SEQUENCE protected_environment_deploy_access_levels_id_seq OWNED BY protec CREATE TABLE protected_environments ( id integer NOT NULL, - project_id integer NOT NULL, + project_id integer, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - name character varying NOT NULL + name character varying NOT NULL, + group_id bigint, + CONSTRAINT protected_environments_project_or_group_existence CHECK (((project_id IS NULL) <> (group_id IS NULL))) ); CREATE SEQUENCE protected_environments_id_seq @@ -16847,7 +17771,8 @@ CREATE TABLE push_event_payloads ( commit_to bytea, ref text, commit_title character varying(70), - ref_count integer + ref_count integer, + event_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE TABLE push_rules ( @@ -17230,7 +18155,8 @@ CREATE TABLE saml_providers ( enforced_sso boolean DEFAULT false NOT NULL, enforced_group_managed_accounts boolean DEFAULT false NOT NULL, prohibited_outer_forks boolean DEFAULT true NOT NULL, - default_membership_role smallint DEFAULT 10 NOT NULL + default_membership_role smallint DEFAULT 10 NOT NULL, + git_check_enforced boolean DEFAULT false NOT NULL ); CREATE SEQUENCE saml_providers_id_seq @@ -17307,7 +18233,8 @@ CREATE TABLE security_orchestration_policy_configurations ( project_id bigint NOT NULL, security_policy_management_project_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL + updated_at timestamp with time zone NOT NULL, + configured_at timestamp with time zone ); COMMENT ON TABLE security_orchestration_policy_configurations IS '{"owner":"group::container security","description":"Configuration used to store relationship between project and security policy repository"}'; @@ -17321,12 +18248,36 @@ CREATE SEQUENCE security_orchestration_policy_configurations_id_seq ALTER SEQUENCE security_orchestration_policy_configurations_id_seq OWNED BY security_orchestration_policy_configurations.id; +CREATE TABLE security_orchestration_policy_rule_schedules ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + next_run_at timestamp with time zone, + security_orchestration_policy_configuration_id bigint NOT NULL, + user_id bigint NOT NULL, + policy_index integer NOT NULL, + cron text NOT NULL, + CONSTRAINT check_915825a76e CHECK ((char_length(cron) <= 255)) +); + +COMMENT ON TABLE security_orchestration_policy_rule_schedules IS '{"owner":"group::container security","description":"Schedules used to store relationship between project and security policy repository"}'; + +CREATE SEQUENCE security_orchestration_policy_rule_schedules_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE security_orchestration_policy_rule_schedules_id_seq OWNED BY security_orchestration_policy_rule_schedules.id; + CREATE TABLE security_scans ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, build_id bigint NOT NULL, - scan_type smallint NOT NULL + scan_type smallint NOT NULL, + info jsonb DEFAULT '{}'::jsonb NOT NULL ); CREATE SEQUENCE security_scans_id_seq @@ -17518,6 +18469,8 @@ CREATE TABLE snippet_repositories ( verified_at timestamp with time zone, verification_checksum bytea, verification_failure text, + verification_state smallint DEFAULT 0 NOT NULL, + verification_started_at timestamp with time zone, CONSTRAINT snippet_repositories_verification_failure_text_limit CHECK ((char_length(verification_failure) <= 255)) ); @@ -17689,6 +18642,22 @@ CREATE SEQUENCE sprints_id_seq ALTER SEQUENCE sprints_id_seq OWNED BY sprints.id; +CREATE TABLE status_check_responses ( + id bigint NOT NULL, + merge_request_id bigint NOT NULL, + external_approval_rule_id bigint NOT NULL, + sha bytea NOT NULL +); + +CREATE SEQUENCE status_check_responses_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE status_check_responses_id_seq OWNED BY status_check_responses.id; + CREATE TABLE status_page_published_incidents ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -17799,7 +18768,9 @@ CREATE TABLE taggings ( tagger_id integer, tagger_type character varying, context character varying, - created_at timestamp without time zone + created_at timestamp without time zone, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL, + taggable_id_convert_to_bigint bigint ); CREATE SEQUENCE taggings_id_seq @@ -17862,6 +18833,8 @@ CREATE TABLE terraform_state_versions ( verification_checksum bytea, verification_failure text, ci_build_id bigint, + verification_started_at timestamp with time zone, + verification_state smallint DEFAULT 0 NOT NULL, CONSTRAINT check_0824bb7bbd CHECK ((char_length(file) <= 255)), CONSTRAINT tf_state_versions_verification_failure_text_limit CHECK ((char_length(verification_failure) <= 255)) ); @@ -17908,7 +18881,8 @@ CREATE TABLE timelogs ( issue_id integer, merge_request_id integer, spent_at timestamp with time zone, - note_id integer + note_id integer, + project_id integer ); CREATE SEQUENCE timelogs_id_seq @@ -18001,6 +18975,24 @@ CREATE SEQUENCE u2f_registrations_id_seq ALTER SEQUENCE u2f_registrations_id_seq OWNED BY u2f_registrations.id; +CREATE TABLE upcoming_reconciliations ( + id bigint NOT NULL, + namespace_id bigint, + next_reconciliation_date date NOT NULL, + display_alert_from date NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE upcoming_reconciliations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE upcoming_reconciliations_id_seq OWNED BY upcoming_reconciliations.id; + CREATE TABLE uploads ( id integer NOT NULL, size bigint NOT NULL, @@ -18081,6 +19073,11 @@ CREATE SEQUENCE user_canonical_emails_id_seq ALTER SEQUENCE user_canonical_emails_id_seq OWNED BY user_canonical_emails.id; +CREATE TABLE user_credit_card_validations ( + user_id bigint NOT NULL, + credit_card_validated_at timestamp with time zone NOT NULL +); + CREATE TABLE user_custom_attributes ( id integer NOT NULL, created_at timestamp with time zone NOT NULL, @@ -18514,23 +19511,87 @@ CREATE SEQUENCE vulnerability_feedback_id_seq ALTER SEQUENCE vulnerability_feedback_id_seq OWNED BY vulnerability_feedback.id; -CREATE TABLE vulnerability_finding_fingerprints ( +CREATE TABLE vulnerability_finding_evidence_headers ( id bigint NOT NULL, - finding_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - algorithm_type smallint NOT NULL, - fingerprint_sha256 bytea NOT NULL + vulnerability_finding_evidence_request_id bigint, + vulnerability_finding_evidence_response_id bigint, + name text NOT NULL, + value text NOT NULL, + CONSTRAINT check_01d21e8d92 CHECK ((char_length(name) <= 255)), + CONSTRAINT check_3f9011f903 CHECK ((char_length(value) <= 8192)) ); -CREATE SEQUENCE vulnerability_finding_fingerprints_id_seq +CREATE SEQUENCE vulnerability_finding_evidence_headers_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -ALTER SEQUENCE vulnerability_finding_fingerprints_id_seq OWNED BY vulnerability_finding_fingerprints.id; +ALTER SEQUENCE vulnerability_finding_evidence_headers_id_seq OWNED BY vulnerability_finding_evidence_headers.id; + +CREATE TABLE vulnerability_finding_evidence_requests ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + vulnerability_finding_evidence_id bigint NOT NULL, + method text, + url text, + body text, + CONSTRAINT check_7e37f2d01a CHECK ((char_length(body) <= 2048)), + CONSTRAINT check_8152fbb236 CHECK ((char_length(url) <= 2048)), + CONSTRAINT check_d9d11300f4 CHECK ((char_length(method) <= 32)) +); + +CREATE SEQUENCE vulnerability_finding_evidence_requests_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_evidence_requests_id_seq OWNED BY vulnerability_finding_evidence_requests.id; + +CREATE TABLE vulnerability_finding_evidence_responses ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + vulnerability_finding_evidence_id bigint NOT NULL, + status_code integer, + reason_phrase text, + body text, + CONSTRAINT check_58b124ab48 CHECK ((char_length(reason_phrase) <= 2048)), + CONSTRAINT check_76bac0c32b CHECK ((char_length(body) <= 2048)) +); + +CREATE SEQUENCE vulnerability_finding_evidence_responses_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_evidence_responses_id_seq OWNED BY vulnerability_finding_evidence_responses.id; + +CREATE TABLE vulnerability_finding_evidences ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + vulnerability_occurrence_id bigint NOT NULL, + summary text, + CONSTRAINT check_5773b236fb CHECK ((char_length(summary) <= 8000000)) +); + +CREATE SEQUENCE vulnerability_finding_evidences_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_evidences_id_seq OWNED BY vulnerability_finding_evidences.id; CREATE TABLE vulnerability_finding_links ( id bigint NOT NULL, @@ -18552,6 +19613,24 @@ CREATE SEQUENCE vulnerability_finding_links_id_seq ALTER SEQUENCE vulnerability_finding_links_id_seq OWNED BY vulnerability_finding_links.id; +CREATE TABLE vulnerability_finding_signatures ( + id bigint NOT NULL, + finding_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + algorithm_type smallint NOT NULL, + signature_sha bytea NOT NULL +); + +CREATE SEQUENCE vulnerability_finding_signatures_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_signatures_id_seq OWNED BY vulnerability_finding_signatures.id; + CREATE TABLE vulnerability_findings_remediations ( id bigint NOT NULL, vulnerability_occurrence_id bigint, @@ -18760,7 +19839,8 @@ CREATE TABLE vulnerability_statistics ( low integer DEFAULT 0 NOT NULL, unknown integer DEFAULT 0 NOT NULL, info integer DEFAULT 0 NOT NULL, - letter_grade smallint NOT NULL + letter_grade smallint NOT NULL, + latest_pipeline_id bigint ); CREATE SEQUENCE vulnerability_statistics_id_seq @@ -18790,7 +19870,7 @@ CREATE SEQUENCE vulnerability_user_mentions_id_seq ALTER SEQUENCE vulnerability_user_mentions_id_seq OWNED BY vulnerability_user_mentions.id; -CREATE TABLE web_hook_logs ( +CREATE TABLE web_hook_logs_archived ( id integer NOT NULL, web_hook_id integer NOT NULL, trigger character varying, @@ -18806,16 +19886,6 @@ CREATE TABLE web_hook_logs ( updated_at timestamp without time zone NOT NULL ); -CREATE SEQUENCE web_hook_logs_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE web_hook_logs_id_seq OWNED BY web_hook_logs.id; - CREATE TABLE web_hooks ( id integer NOT NULL, project_id integer, @@ -18845,7 +19915,10 @@ CREATE TABLE web_hooks ( feature_flag_events boolean DEFAULT false NOT NULL, releases_events boolean DEFAULT false NOT NULL, member_events boolean DEFAULT false NOT NULL, - subgroup_events boolean DEFAULT false NOT NULL + subgroup_events boolean DEFAULT false NOT NULL, + recent_failures smallint DEFAULT 0 NOT NULL, + backoff_count smallint DEFAULT 0 NOT NULL, + disabled_until timestamp with time zone ); CREATE SEQUENCE web_hooks_id_seq @@ -19013,13 +20086,13 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_value_streams ALTER COLUMN id S ALTER TABLE ONLY analytics_cycle_analytics_project_stages ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_project_stages_id_seq'::regclass); -ALTER TABLE ONLY analytics_devops_adoption_segment_selections ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_segment_selections_id_seq'::regclass); +ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_project_value_streams_id_seq'::regclass); ALTER TABLE ONLY analytics_devops_adoption_segments ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_segments_id_seq'::regclass); ALTER TABLE ONLY analytics_devops_adoption_snapshots ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_snapshots_id_seq'::regclass); -ALTER TABLE ONLY analytics_instance_statistics_measurements ALTER COLUMN id SET DEFAULT nextval('analytics_instance_statistics_measurements_id_seq'::regclass); +ALTER TABLE ONLY analytics_usage_trends_measurements ALTER COLUMN id SET DEFAULT nextval('analytics_usage_trends_measurements_id_seq'::regclass); ALTER TABLE ONLY appearances ALTER COLUMN id SET DEFAULT nextval('appearances_id_seq'::regclass); @@ -19081,6 +20154,8 @@ ALTER TABLE ONLY boards_epic_board_labels ALTER COLUMN id SET DEFAULT nextval('b ALTER TABLE ONLY boards_epic_board_positions ALTER COLUMN id SET DEFAULT nextval('boards_epic_board_positions_id_seq'::regclass); +ALTER TABLE ONLY boards_epic_board_recent_visits ALTER COLUMN id SET DEFAULT nextval('boards_epic_board_recent_visits_id_seq'::regclass); + ALTER TABLE ONLY boards_epic_boards ALTER COLUMN id SET DEFAULT nextval('boards_epic_boards_id_seq'::regclass); ALTER TABLE ONLY boards_epic_list_user_preferences ALTER COLUMN id SET DEFAULT nextval('boards_epic_list_user_preferences_id_seq'::regclass); @@ -19095,6 +20170,10 @@ ALTER TABLE ONLY bulk_import_configurations ALTER COLUMN id SET DEFAULT nextval( ALTER TABLE ONLY bulk_import_entities ALTER COLUMN id SET DEFAULT nextval('bulk_import_entities_id_seq'::regclass); +ALTER TABLE ONLY bulk_import_export_uploads ALTER COLUMN id SET DEFAULT nextval('bulk_import_export_uploads_id_seq'::regclass); + +ALTER TABLE ONLY bulk_import_exports ALTER COLUMN id SET DEFAULT nextval('bulk_import_exports_id_seq'::regclass); + ALTER TABLE ONLY bulk_import_failures ALTER COLUMN id SET DEFAULT nextval('bulk_import_failures_id_seq'::regclass); ALTER TABLE ONLY bulk_import_trackers ALTER COLUMN id SET DEFAULT nextval('bulk_import_trackers_id_seq'::regclass); @@ -19133,10 +20212,16 @@ ALTER TABLE ONLY ci_instance_variables ALTER COLUMN id SET DEFAULT nextval('ci_i ALTER TABLE ONLY ci_job_artifacts ALTER COLUMN id SET DEFAULT nextval('ci_job_artifacts_id_seq'::regclass); +ALTER TABLE ONLY ci_job_token_project_scope_links ALTER COLUMN id SET DEFAULT nextval('ci_job_token_project_scope_links_id_seq'::regclass); + ALTER TABLE ONLY ci_job_variables ALTER COLUMN id SET DEFAULT nextval('ci_job_variables_id_seq'::regclass); +ALTER TABLE ONLY ci_minutes_additional_packs ALTER COLUMN id SET DEFAULT nextval('ci_minutes_additional_packs_id_seq'::regclass); + ALTER TABLE ONLY ci_namespace_monthly_usages ALTER COLUMN id SET DEFAULT nextval('ci_namespace_monthly_usages_id_seq'::regclass); +ALTER TABLE ONLY ci_pending_builds ALTER COLUMN id SET DEFAULT nextval('ci_pending_builds_id_seq'::regclass); + ALTER TABLE ONLY ci_pipeline_artifacts ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_artifacts_id_seq'::regclass); ALTER TABLE ONLY ci_pipeline_chat_data ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_chat_data_id_seq'::regclass); @@ -19169,6 +20254,8 @@ ALTER TABLE ONLY ci_runner_projects ALTER COLUMN id SET DEFAULT nextval('ci_runn ALTER TABLE ONLY ci_runners ALTER COLUMN id SET DEFAULT nextval('ci_runners_id_seq'::regclass); +ALTER TABLE ONLY ci_running_builds ALTER COLUMN id SET DEFAULT nextval('ci_running_builds_id_seq'::regclass); + ALTER TABLE ONLY ci_sources_pipelines ALTER COLUMN id SET DEFAULT nextval('ci_sources_pipelines_id_seq'::regclass); ALTER TABLE ONLY ci_sources_projects ALTER COLUMN id SET DEFAULT nextval('ci_sources_projects_id_seq'::regclass); @@ -19185,6 +20272,10 @@ ALTER TABLE ONLY ci_trigger_requests ALTER COLUMN id SET DEFAULT nextval('ci_tri ALTER TABLE ONLY ci_triggers ALTER COLUMN id SET DEFAULT nextval('ci_triggers_id_seq'::regclass); +ALTER TABLE ONLY ci_unit_test_failures ALTER COLUMN id SET DEFAULT nextval('ci_unit_test_failures_id_seq'::regclass); + +ALTER TABLE ONLY ci_unit_tests ALTER COLUMN id SET DEFAULT nextval('ci_unit_tests_id_seq'::regclass); + ALTER TABLE ONLY ci_variables ALTER COLUMN id SET DEFAULT nextval('ci_variables_id_seq'::regclass); ALTER TABLE ONLY cluster_agent_tokens ALTER COLUMN id SET DEFAULT nextval('cluster_agent_tokens_id_seq'::regclass); @@ -19243,6 +20334,8 @@ ALTER TABLE ONLY dast_profiles ALTER COLUMN id SET DEFAULT nextval('dast_profile ALTER TABLE ONLY dast_scanner_profiles ALTER COLUMN id SET DEFAULT nextval('dast_scanner_profiles_id_seq'::regclass); +ALTER TABLE ONLY dast_site_profile_secret_variables ALTER COLUMN id SET DEFAULT nextval('dast_site_profile_secret_variables_id_seq'::regclass); + ALTER TABLE ONLY dast_site_profiles ALTER COLUMN id SET DEFAULT nextval('dast_site_profiles_id_seq'::regclass); ALTER TABLE ONLY dast_site_tokens ALTER COLUMN id SET DEFAULT nextval('dast_site_tokens_id_seq'::regclass); @@ -19279,6 +20372,10 @@ ALTER TABLE ONLY dora_daily_metrics ALTER COLUMN id SET DEFAULT nextval('dora_da ALTER TABLE ONLY draft_notes ALTER COLUMN id SET DEFAULT nextval('draft_notes_id_seq'::regclass); +ALTER TABLE ONLY elastic_index_settings ALTER COLUMN id SET DEFAULT nextval('elastic_index_settings_id_seq'::regclass); + +ALTER TABLE ONLY elastic_reindexing_slices ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_slices_id_seq'::regclass); + ALTER TABLE ONLY elastic_reindexing_subtasks ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_subtasks_id_seq'::regclass); ALTER TABLE ONLY elastic_reindexing_tasks ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_tasks_id_seq'::regclass); @@ -19389,6 +20486,12 @@ ALTER TABLE ONLY import_export_uploads ALTER COLUMN id SET DEFAULT nextval('impo ALTER TABLE ONLY import_failures ALTER COLUMN id SET DEFAULT nextval('import_failures_id_seq'::regclass); +ALTER TABLE ONLY in_product_marketing_emails ALTER COLUMN id SET DEFAULT nextval('in_product_marketing_emails_id_seq'::regclass); + +ALTER TABLE ONLY incident_management_escalation_policies ALTER COLUMN id SET DEFAULT nextval('incident_management_escalation_policies_id_seq'::regclass); + +ALTER TABLE ONLY incident_management_escalation_rules ALTER COLUMN id SET DEFAULT nextval('incident_management_escalation_rules_id_seq'::regclass); + ALTER TABLE ONLY incident_management_oncall_participants ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_participants_id_seq'::regclass); ALTER TABLE ONLY incident_management_oncall_rotations ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_rotations_id_seq'::regclass); @@ -19465,6 +20568,8 @@ ALTER TABLE ONLY merge_request_cleanup_schedules ALTER COLUMN merge_request_id S ALTER TABLE ONLY merge_request_context_commits ALTER COLUMN id SET DEFAULT nextval('merge_request_context_commits_id_seq'::regclass); +ALTER TABLE ONLY merge_request_diff_commit_users ALTER COLUMN id SET DEFAULT nextval('merge_request_diff_commit_users_id_seq'::regclass); + ALTER TABLE ONLY merge_request_diff_details ALTER COLUMN merge_request_diff_id SET DEFAULT nextval('merge_request_diff_details_merge_request_diff_id_seq'::regclass); ALTER TABLE ONLY merge_request_diffs ALTER COLUMN id SET DEFAULT nextval('merge_request_diffs_id_seq'::regclass); @@ -19545,6 +20650,8 @@ ALTER TABLE ONLY packages_debian_group_component_files ALTER COLUMN id SET DEFAU ALTER TABLE ONLY packages_debian_group_components ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_components_id_seq'::regclass); +ALTER TABLE ONLY packages_debian_group_distribution_keys ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_distribution_keys_id_seq'::regclass); + ALTER TABLE ONLY packages_debian_group_distributions ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_distributions_id_seq'::regclass); ALTER TABLE ONLY packages_debian_project_architectures ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_architectures_id_seq'::regclass); @@ -19553,6 +20660,8 @@ ALTER TABLE ONLY packages_debian_project_component_files ALTER COLUMN id SET DEF ALTER TABLE ONLY packages_debian_project_components ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_components_id_seq'::regclass); +ALTER TABLE ONLY packages_debian_project_distribution_keys ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_distribution_keys_id_seq'::regclass); + ALTER TABLE ONLY packages_debian_project_distributions ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_distributions_id_seq'::regclass); ALTER TABLE ONLY packages_debian_publications ALTER COLUMN id SET DEFAULT nextval('packages_debian_publications_id_seq'::regclass); @@ -19701,6 +20810,8 @@ ALTER TABLE ONLY security_findings ALTER COLUMN id SET DEFAULT nextval('security ALTER TABLE ONLY security_orchestration_policy_configurations ALTER COLUMN id SET DEFAULT nextval('security_orchestration_policy_configurations_id_seq'::regclass); +ALTER TABLE ONLY security_orchestration_policy_rule_schedules ALTER COLUMN id SET DEFAULT nextval('security_orchestration_policy_rule_schedules_id_seq'::regclass); + ALTER TABLE ONLY security_scans ALTER COLUMN id SET DEFAULT nextval('security_scans_id_seq'::regclass); ALTER TABLE ONLY self_managed_prometheus_alert_events ALTER COLUMN id SET DEFAULT nextval('self_managed_prometheus_alert_events_id_seq'::regclass); @@ -19731,6 +20842,8 @@ ALTER TABLE ONLY spam_logs ALTER COLUMN id SET DEFAULT nextval('spam_logs_id_seq ALTER TABLE ONLY sprints ALTER COLUMN id SET DEFAULT nextval('sprints_id_seq'::regclass); +ALTER TABLE ONLY status_check_responses ALTER COLUMN id SET DEFAULT nextval('status_check_responses_id_seq'::regclass); + ALTER TABLE ONLY status_page_published_incidents ALTER COLUMN id SET DEFAULT nextval('status_page_published_incidents_id_seq'::regclass); ALTER TABLE ONLY status_page_settings ALTER COLUMN project_id SET DEFAULT nextval('status_page_settings_project_id_seq'::regclass); @@ -19761,6 +20874,8 @@ ALTER TABLE ONLY trending_projects ALTER COLUMN id SET DEFAULT nextval('trending ALTER TABLE ONLY u2f_registrations ALTER COLUMN id SET DEFAULT nextval('u2f_registrations_id_seq'::regclass); +ALTER TABLE ONLY upcoming_reconciliations ALTER COLUMN id SET DEFAULT nextval('upcoming_reconciliations_id_seq'::regclass); + ALTER TABLE ONLY uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass); ALTER TABLE ONLY user_agent_details ALTER COLUMN id SET DEFAULT nextval('user_agent_details_id_seq'::regclass); @@ -19797,10 +20912,18 @@ ALTER TABLE ONLY vulnerability_external_issue_links ALTER COLUMN id SET DEFAULT ALTER TABLE ONLY vulnerability_feedback ALTER COLUMN id SET DEFAULT nextval('vulnerability_feedback_id_seq'::regclass); -ALTER TABLE ONLY vulnerability_finding_fingerprints ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_fingerprints_id_seq'::regclass); +ALTER TABLE ONLY vulnerability_finding_evidence_headers ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_headers_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_finding_evidence_requests ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_requests_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_finding_evidence_responses ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_responses_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_finding_evidences ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidences_id_seq'::regclass); ALTER TABLE ONLY vulnerability_finding_links ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_links_id_seq'::regclass); +ALTER TABLE ONLY vulnerability_finding_signatures ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_signatures_id_seq'::regclass); + ALTER TABLE ONLY vulnerability_findings_remediations ALTER COLUMN id SET DEFAULT nextval('vulnerability_findings_remediations_id_seq'::regclass); ALTER TABLE ONLY vulnerability_historical_statistics ALTER COLUMN id SET DEFAULT nextval('vulnerability_historical_statistics_id_seq'::regclass); @@ -19841,6 +20964,60 @@ ALTER TABLE ONLY x509_issuers ALTER COLUMN id SET DEFAULT nextval('x509_issuers_ ALTER TABLE ONLY zoom_meetings ALTER COLUMN id SET DEFAULT nextval('zoom_meetings_id_seq'::regclass); +ALTER TABLE ONLY audit_events + ADD CONSTRAINT audit_events_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_000000 + ADD CONSTRAINT audit_events_000000_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202212 + ADD CONSTRAINT audit_events_202212_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202301 + ADD CONSTRAINT audit_events_202301_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202302 + ADD CONSTRAINT audit_events_202302_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202303 + ADD CONSTRAINT audit_events_202303_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202304 + ADD CONSTRAINT audit_events_202304_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202305 + ADD CONSTRAINT audit_events_202305_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202306 + ADD CONSTRAINT audit_events_202306_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY web_hook_logs + ADD CONSTRAINT web_hook_logs_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_000000 + ADD CONSTRAINT web_hook_logs_000000_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202212 + ADD CONSTRAINT web_hook_logs_202212_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202301 + ADD CONSTRAINT web_hook_logs_202301_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202302 + ADD CONSTRAINT web_hook_logs_202302_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202303 + ADD CONSTRAINT web_hook_logs_202303_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202304 + ADD CONSTRAINT web_hook_logs_202304_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202305 + ADD CONSTRAINT web_hook_logs_202305_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202306 + ADD CONSTRAINT web_hook_logs_202306_pkey PRIMARY KEY (id, created_at); + ALTER TABLE ONLY product_analytics_events_experimental ADD CONSTRAINT product_analytics_events_experimental_pkey PRIMARY KEY (id, project_id); @@ -20063,8 +21240,8 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_value_streams ALTER TABLE ONLY analytics_cycle_analytics_project_stages ADD CONSTRAINT analytics_cycle_analytics_project_stages_pkey PRIMARY KEY (id); -ALTER TABLE ONLY analytics_devops_adoption_segment_selections - ADD CONSTRAINT analytics_devops_adoption_segment_selections_pkey PRIMARY KEY (id); +ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams + ADD CONSTRAINT analytics_cycle_analytics_project_value_streams_pkey PRIMARY KEY (id); ALTER TABLE ONLY analytics_devops_adoption_segments ADD CONSTRAINT analytics_devops_adoption_segments_pkey PRIMARY KEY (id); @@ -20072,12 +21249,12 @@ ALTER TABLE ONLY analytics_devops_adoption_segments ALTER TABLE ONLY analytics_devops_adoption_snapshots ADD CONSTRAINT analytics_devops_adoption_snapshots_pkey PRIMARY KEY (id); -ALTER TABLE ONLY analytics_instance_statistics_measurements - ADD CONSTRAINT analytics_instance_statistics_measurements_pkey PRIMARY KEY (id); - ALTER TABLE ONLY analytics_language_trend_repository_languages ADD CONSTRAINT analytics_language_trend_repository_languages_pkey PRIMARY KEY (programming_language_id, project_id, snapshot_date); +ALTER TABLE ONLY analytics_usage_trends_measurements + ADD CONSTRAINT analytics_usage_trends_measurements_pkey PRIMARY KEY (id); + ALTER TABLE ONLY appearances ADD CONSTRAINT appearances_pkey PRIMARY KEY (id); @@ -20126,12 +21303,6 @@ ALTER TABLE ONLY approvers ALTER TABLE ONLY atlassian_identities ADD CONSTRAINT atlassian_identities_pkey PRIMARY KEY (user_id); -ALTER TABLE ONLY audit_events_archived - ADD CONSTRAINT audit_events_archived_pkey PRIMARY KEY (id); - -ALTER TABLE ONLY audit_events - ADD CONSTRAINT audit_events_pkey PRIMARY KEY (id, created_at); - ALTER TABLE ONLY authentication_events ADD CONSTRAINT authentication_events_pkey PRIMARY KEY (id); @@ -20174,6 +21345,9 @@ ALTER TABLE ONLY boards_epic_board_labels ALTER TABLE ONLY boards_epic_board_positions ADD CONSTRAINT boards_epic_board_positions_pkey PRIMARY KEY (id); +ALTER TABLE ONLY boards_epic_board_recent_visits + ADD CONSTRAINT boards_epic_board_recent_visits_pkey PRIMARY KEY (id); + ALTER TABLE ONLY boards_epic_boards ADD CONSTRAINT boards_epic_boards_pkey PRIMARY KEY (id); @@ -20198,6 +21372,12 @@ ALTER TABLE ONLY bulk_import_configurations ALTER TABLE ONLY bulk_import_entities ADD CONSTRAINT bulk_import_entities_pkey PRIMARY KEY (id); +ALTER TABLE ONLY bulk_import_export_uploads + ADD CONSTRAINT bulk_import_export_uploads_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY bulk_import_exports + ADD CONSTRAINT bulk_import_exports_pkey PRIMARY KEY (id); + ALTER TABLE ONLY bulk_import_failures ADD CONSTRAINT bulk_import_failures_pkey PRIMARY KEY (id); @@ -20270,12 +21450,21 @@ ALTER TABLE ONLY ci_instance_variables ALTER TABLE ONLY ci_job_artifacts ADD CONSTRAINT ci_job_artifacts_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_job_token_project_scope_links + ADD CONSTRAINT ci_job_token_project_scope_links_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_job_variables ADD CONSTRAINT ci_job_variables_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_minutes_additional_packs + ADD CONSTRAINT ci_minutes_additional_packs_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_namespace_monthly_usages ADD CONSTRAINT ci_namespace_monthly_usages_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_pending_builds + ADD CONSTRAINT ci_pending_builds_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_pipeline_artifacts ADD CONSTRAINT ci_pipeline_artifacts_pkey PRIMARY KEY (id); @@ -20324,6 +21513,9 @@ ALTER TABLE ONLY ci_runner_projects ALTER TABLE ONLY ci_runners ADD CONSTRAINT ci_runners_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_running_builds + ADD CONSTRAINT ci_running_builds_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_sources_pipelines ADD CONSTRAINT ci_sources_pipelines_pkey PRIMARY KEY (id); @@ -20348,6 +21540,12 @@ ALTER TABLE ONLY ci_trigger_requests ALTER TABLE ONLY ci_triggers ADD CONSTRAINT ci_triggers_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_unit_test_failures + ADD CONSTRAINT ci_unit_test_failures_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_unit_tests + ADD CONSTRAINT ci_unit_tests_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_variables ADD CONSTRAINT ci_variables_pkey PRIMARY KEY (id); @@ -20405,6 +21603,12 @@ ALTER TABLE ONLY clusters_applications_prometheus ALTER TABLE ONLY clusters_applications_runners ADD CONSTRAINT clusters_applications_runners_pkey PRIMARY KEY (id); +ALTER TABLE ONLY clusters_integration_elasticstack + ADD CONSTRAINT clusters_integration_elasticstack_pkey PRIMARY KEY (cluster_id); + +ALTER TABLE ONLY clusters_integration_prometheus + ADD CONSTRAINT clusters_integration_prometheus_pkey PRIMARY KEY (cluster_id); + ALTER TABLE ONLY clusters_kubernetes_namespaces ADD CONSTRAINT clusters_kubernetes_namespaces_pkey PRIMARY KEY (id); @@ -20432,12 +21636,21 @@ ALTER TABLE ONLY csv_issue_imports ALTER TABLE ONLY custom_emoji ADD CONSTRAINT custom_emoji_pkey PRIMARY KEY (id); +ALTER TABLE ONLY dast_profiles_pipelines + ADD CONSTRAINT dast_profiles_pipelines_pkey PRIMARY KEY (dast_profile_id, ci_pipeline_id); + ALTER TABLE ONLY dast_profiles ADD CONSTRAINT dast_profiles_pkey PRIMARY KEY (id); ALTER TABLE ONLY dast_scanner_profiles ADD CONSTRAINT dast_scanner_profiles_pkey PRIMARY KEY (id); +ALTER TABLE ONLY dast_site_profile_secret_variables + ADD CONSTRAINT dast_site_profile_secret_variables_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY dast_site_profiles_pipelines + ADD CONSTRAINT dast_site_profiles_pipelines_pkey PRIMARY KEY (dast_site_profile_id, ci_pipeline_id); + ALTER TABLE ONLY dast_site_profiles ADD CONSTRAINT dast_site_profiles_pkey PRIMARY KEY (id); @@ -20498,6 +21711,12 @@ ALTER TABLE ONLY dora_daily_metrics ALTER TABLE ONLY draft_notes ADD CONSTRAINT draft_notes_pkey PRIMARY KEY (id); +ALTER TABLE ONLY elastic_index_settings + ADD CONSTRAINT elastic_index_settings_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY elastic_reindexing_slices + ADD CONSTRAINT elastic_reindexing_slices_pkey PRIMARY KEY (id); + ALTER TABLE ONLY elastic_reindexing_subtasks ADD CONSTRAINT elastic_reindexing_subtasks_pkey PRIMARY KEY (id); @@ -20678,9 +21897,18 @@ ALTER TABLE ONLY import_export_uploads ALTER TABLE ONLY import_failures ADD CONSTRAINT import_failures_pkey PRIMARY KEY (id); +ALTER TABLE ONLY in_product_marketing_emails + ADD CONSTRAINT in_product_marketing_emails_pkey PRIMARY KEY (id); + ALTER TABLE ONLY incident_management_oncall_shifts ADD CONSTRAINT inc_mgmnt_no_overlapping_oncall_shifts EXCLUDE USING gist (rotation_id WITH =, tstzrange(starts_at, ends_at, '[)'::text) WITH &&); +ALTER TABLE ONLY incident_management_escalation_policies + ADD CONSTRAINT incident_management_escalation_policies_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY incident_management_escalation_rules + ADD CONSTRAINT incident_management_escalation_rules_pkey PRIMARY KEY (id); + ALTER TABLE ONLY incident_management_oncall_participants ADD CONSTRAINT incident_management_oncall_participants_pkey PRIMARY KEY (id); @@ -20813,6 +22041,9 @@ ALTER TABLE ONLY merge_request_context_commit_diff_files ALTER TABLE ONLY merge_request_context_commits ADD CONSTRAINT merge_request_context_commits_pkey PRIMARY KEY (id); +ALTER TABLE ONLY merge_request_diff_commit_users + ADD CONSTRAINT merge_request_diff_commit_users_pkey PRIMARY KEY (id); + ALTER TABLE ONLY merge_request_diff_commits ADD CONSTRAINT merge_request_diff_commits_pkey PRIMARY KEY (merge_request_diff_id, relative_order); @@ -20957,6 +22188,9 @@ ALTER TABLE ONLY packages_debian_group_component_files ALTER TABLE ONLY packages_debian_group_components ADD CONSTRAINT packages_debian_group_components_pkey PRIMARY KEY (id); +ALTER TABLE ONLY packages_debian_group_distribution_keys + ADD CONSTRAINT packages_debian_group_distribution_keys_pkey PRIMARY KEY (id); + ALTER TABLE ONLY packages_debian_group_distributions ADD CONSTRAINT packages_debian_group_distributions_pkey PRIMARY KEY (id); @@ -20969,6 +22203,9 @@ ALTER TABLE ONLY packages_debian_project_component_files ALTER TABLE ONLY packages_debian_project_components ADD CONSTRAINT packages_debian_project_components_pkey PRIMARY KEY (id); +ALTER TABLE ONLY packages_debian_project_distribution_keys + ADD CONSTRAINT packages_debian_project_distribution_keys_pkey PRIMARY KEY (id); + ALTER TABLE ONLY packages_debian_project_distributions ADD CONSTRAINT packages_debian_project_distributions_pkey PRIMARY KEY (id); @@ -20984,6 +22221,9 @@ ALTER TABLE ONLY packages_dependency_links ALTER TABLE ONLY packages_events ADD CONSTRAINT packages_events_pkey PRIMARY KEY (id); +ALTER TABLE ONLY packages_helm_file_metadata + ADD CONSTRAINT packages_helm_file_metadata_pkey PRIMARY KEY (package_file_id); + ALTER TABLE ONLY packages_maven_metadata ADD CONSTRAINT packages_maven_metadata_pkey PRIMARY KEY (id); @@ -21233,6 +22473,9 @@ ALTER TABLE ONLY security_findings ALTER TABLE ONLY security_orchestration_policy_configurations ADD CONSTRAINT security_orchestration_policy_configurations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY security_orchestration_policy_rule_schedules + ADD CONSTRAINT security_orchestration_policy_rule_schedules_pkey PRIMARY KEY (id); + ALTER TABLE ONLY security_scans ADD CONSTRAINT security_scans_pkey PRIMARY KEY (id); @@ -21290,6 +22533,9 @@ ALTER TABLE ONLY spam_logs ALTER TABLE ONLY sprints ADD CONSTRAINT sprints_pkey PRIMARY KEY (id); +ALTER TABLE ONLY status_check_responses + ADD CONSTRAINT status_check_responses_pkey PRIMARY KEY (id); + ALTER TABLE ONLY status_page_published_incidents ADD CONSTRAINT status_page_published_incidents_pkey PRIMARY KEY (id); @@ -21335,6 +22581,9 @@ ALTER TABLE ONLY trending_projects ALTER TABLE ONLY u2f_registrations ADD CONSTRAINT u2f_registrations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY upcoming_reconciliations + ADD CONSTRAINT upcoming_reconciliations_pkey PRIMARY KEY (id); + ALTER TABLE ONLY uploads ADD CONSTRAINT uploads_pkey PRIMARY KEY (id); @@ -21347,6 +22596,9 @@ ALTER TABLE ONLY user_callouts ALTER TABLE ONLY user_canonical_emails ADD CONSTRAINT user_canonical_emails_pkey PRIMARY KEY (id); +ALTER TABLE ONLY user_credit_card_validations + ADD CONSTRAINT user_credit_card_validations_pkey PRIMARY KEY (user_id); + ALTER TABLE ONLY user_custom_attributes ADD CONSTRAINT user_custom_attributes_pkey PRIMARY KEY (id); @@ -21401,12 +22653,24 @@ ALTER TABLE ONLY vulnerability_external_issue_links ALTER TABLE ONLY vulnerability_feedback ADD CONSTRAINT vulnerability_feedback_pkey PRIMARY KEY (id); -ALTER TABLE ONLY vulnerability_finding_fingerprints - ADD CONSTRAINT vulnerability_finding_fingerprints_pkey PRIMARY KEY (id); +ALTER TABLE ONLY vulnerability_finding_evidence_headers + ADD CONSTRAINT vulnerability_finding_evidence_headers_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_finding_evidence_requests + ADD CONSTRAINT vulnerability_finding_evidence_requests_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_finding_evidence_responses + ADD CONSTRAINT vulnerability_finding_evidence_responses_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_finding_evidences + ADD CONSTRAINT vulnerability_finding_evidences_pkey PRIMARY KEY (id); ALTER TABLE ONLY vulnerability_finding_links ADD CONSTRAINT vulnerability_finding_links_pkey PRIMARY KEY (id); +ALTER TABLE ONLY vulnerability_finding_signatures + ADD CONSTRAINT vulnerability_finding_signatures_pkey PRIMARY KEY (id); + ALTER TABLE ONLY vulnerability_findings_remediations ADD CONSTRAINT vulnerability_findings_remediations_pkey PRIMARY KEY (id); @@ -21440,8 +22704,8 @@ ALTER TABLE ONLY vulnerability_statistics ALTER TABLE ONLY vulnerability_user_mentions ADD CONSTRAINT vulnerability_user_mentions_pkey PRIMARY KEY (id); -ALTER TABLE ONLY web_hook_logs - ADD CONSTRAINT web_hook_logs_pkey PRIMARY KEY (id); +ALTER TABLE ONLY web_hook_logs_archived + ADD CONSTRAINT web_hook_logs_archived_pkey PRIMARY KEY (id); ALTER TABLE ONLY web_hooks ADD CONSTRAINT web_hooks_pkey PRIMARY KEY (id); @@ -21467,6 +22731,78 @@ ALTER TABLE ONLY x509_issuers ALTER TABLE ONLY zoom_meetings ADD CONSTRAINT zoom_meetings_pkey PRIMARY KEY (id); +CREATE INDEX analytics_index_audit_events_part_on_created_at_and_author_id ON ONLY audit_events USING btree (created_at, author_id); + +CREATE INDEX audit_events_000000_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_000000 USING btree (created_at, author_id); + +CREATE INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ON ONLY audit_events USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_000000_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_000000 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202212_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202212 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202212_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202212 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202301_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202301 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202301_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202301 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202302_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202302 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202302_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202302 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202303_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202303 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202303_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202303 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202304_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202304 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202304_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202304 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202305_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202305 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202305_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202305 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202306_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202306 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202306_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202306 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX index_web_hook_logs_part_on_web_hook_id ON ONLY web_hook_logs USING btree (web_hook_id); + +CREATE INDEX index_1554dc6f11 ON gitlab_partitions_dynamic.web_hook_logs_202301 USING btree (web_hook_id); + +CREATE INDEX index_719c6187cb ON gitlab_partitions_dynamic.web_hook_logs_202212 USING btree (web_hook_id); + +CREATE INDEX index_80bf138a51 ON gitlab_partitions_dynamic.web_hook_logs_000000 USING btree (web_hook_id); + +CREATE INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ON ONLY web_hook_logs USING btree (created_at, web_hook_id); + +CREATE INDEX index_962081978f ON gitlab_partitions_dynamic.web_hook_logs_202212 USING btree (created_at, web_hook_id); + +CREATE INDEX index_eecfac613f ON gitlab_partitions_dynamic.web_hook_logs_000000 USING btree (created_at, web_hook_id); + +CREATE INDEX index_fdb8d5eeea ON gitlab_partitions_dynamic.web_hook_logs_202301 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202302_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202302 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202302_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202302 USING btree (web_hook_id); + +CREATE INDEX web_hook_logs_202303_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202303 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202303_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202303 USING btree (web_hook_id); + +CREATE INDEX web_hook_logs_202304_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202304 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202304_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202304 USING btree (web_hook_id); + +CREATE INDEX web_hook_logs_202305_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202305 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202305_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202305 USING btree (web_hook_id); + +CREATE INDEX web_hook_logs_202306_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202306 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202306_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202306 USING btree (web_hook_id); + CREATE INDEX index_product_analytics_events_experimental_project_and_time ON ONLY product_analytics_events_experimental USING btree (project_id, collector_tstamp); CREATE INDEX product_analytics_events_expe_project_id_collector_tstamp_idx10 ON gitlab_partitions_static.product_analytics_events_experimental_10 USING btree (project_id, collector_tstamp); @@ -21599,10 +22935,6 @@ CREATE INDEX product_analytics_events_experi_project_id_collector_tstamp_idx ON CREATE INDEX active_billable_users ON users USING btree (id) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[NULL::integer, 6, 4]))) AND ((user_type IS NULL) OR (user_type <> ALL ('{2,6,1,3,7,8}'::smallint[])))); -CREATE INDEX analytics_index_audit_events_on_created_at_and_author_id ON audit_events_archived USING btree (created_at, author_id); - -CREATE INDEX analytics_index_audit_events_part_on_created_at_and_author_id ON ONLY audit_events USING btree (created_at, author_id); - CREATE INDEX analytics_index_events_on_created_at_and_author_id ON events USING btree (created_at, author_id); CREATE INDEX analytics_repository_languages_on_project_id ON analytics_language_trend_repository_languages USING btree (project_id); @@ -21631,22 +22963,44 @@ CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_and_note_id_index ON epic_user CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_index ON epic_user_mentions USING btree (epic_id) WHERE (note_id IS NULL); +CREATE INDEX finding_evidence_header_on_finding_evidence_request_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_request_id); + +CREATE INDEX finding_evidence_header_on_finding_evidence_response_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_response_id); + +CREATE INDEX finding_evidence_requests_on_finding_evidence_id ON vulnerability_finding_evidence_requests USING btree (vulnerability_finding_evidence_id); + +CREATE INDEX finding_evidence_responses_on_finding_evidences_id ON vulnerability_finding_evidence_responses USING btree (vulnerability_finding_evidence_id); + +CREATE INDEX finding_evidences_on_vulnerability_occurrence_id ON vulnerability_finding_evidences USING btree (vulnerability_occurrence_id); + CREATE INDEX finding_links_on_vulnerability_occurrence_id ON vulnerability_finding_links USING btree (vulnerability_occurrence_id); -CREATE INDEX idx_audit_events_on_entity_id_desc_author_id_created_at ON audit_events_archived USING btree (entity_id, entity_type, id DESC, author_id, created_at); +CREATE UNIQUE INDEX i_ci_job_token_project_scope_links_on_source_and_target_project ON ci_job_token_project_scope_links USING btree (source_project_id, target_project_id); -CREATE INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ON ONLY audit_events USING btree (entity_id, entity_type, id DESC, author_id, created_at); +CREATE INDEX idx_analytics_devops_adoption_segments_on_namespace_id ON analytics_devops_adoption_segments USING btree (namespace_id); + +CREATE INDEX idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id ON award_emoji USING btree (user_id, name, awardable_type, awardable_id); CREATE INDEX idx_ci_pipelines_artifacts_locked ON ci_pipelines USING btree (ci_ref_id, id) WHERE (locked = 1); +CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at ON container_expiration_policies USING btree (project_id, next_run_at) WHERE (enabled = true); + CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at_enabled ON container_expiration_policies USING btree (project_id, next_run_at, enabled); CREATE INDEX idx_container_repositories_on_exp_cleanup_status_and_start_date ON container_repositories USING btree (expiration_policy_cleanup_status, expiration_policy_started_at); CREATE INDEX idx_deployment_clusters_on_cluster_id_and_kubernetes_namespace ON deployment_clusters USING btree (cluster_id, kubernetes_namespace); +CREATE INDEX idx_devops_adoption_segments_namespace_end_time ON analytics_devops_adoption_snapshots USING btree (namespace_id, end_time); + +CREATE INDEX idx_devops_adoption_segments_namespace_recorded_at ON analytics_devops_adoption_snapshots USING btree (namespace_id, recorded_at); + +CREATE UNIQUE INDEX idx_devops_adoption_segments_namespaces_pair ON analytics_devops_adoption_segments USING btree (display_namespace_id, namespace_id); + CREATE INDEX idx_eaprpb_external_approval_rule_id ON external_approval_rules_protected_branches USING btree (external_approval_rule_id); +CREATE INDEX idx_elastic_reindexing_slices_on_elastic_reindexing_subtask_id ON elastic_reindexing_slices USING btree (elastic_reindexing_subtask_id); + CREATE UNIQUE INDEX idx_environment_merge_requests_unique_index ON deployment_merge_requests USING btree (environment_id, merge_request_id); CREATE INDEX idx_geo_con_rep_updated_events_on_container_repository_id ON geo_container_repository_updated_events USING btree (container_repository_id); @@ -21657,6 +23011,8 @@ CREATE INDEX idx_issues_on_project_id_and_created_at_and_id_and_state_id ON issu CREATE INDEX idx_issues_on_project_id_and_due_date_and_id_and_state_id ON issues USING btree (project_id, due_date, id, state_id) WHERE (due_date IS NOT NULL); +CREATE INDEX idx_issues_on_project_id_and_rel_asc_and_id ON issues USING btree (project_id, relative_position, id); + CREATE INDEX idx_issues_on_project_id_and_rel_position_and_state_id_and_id ON issues USING btree (project_id, relative_position, state_id, id DESC); CREATE INDEX idx_issues_on_project_id_and_updated_at_and_id_and_state_id ON issues USING btree (project_id, updated_at, id, state_id); @@ -21667,6 +23023,8 @@ CREATE INDEX idx_jira_connect_subscriptions_on_installation_id ON jira_connect_s CREATE UNIQUE INDEX idx_jira_connect_subscriptions_on_installation_id_namespace_id ON jira_connect_subscriptions USING btree (jira_connect_installation_id, namespace_id); +CREATE INDEX idx_keys_expires_at_and_before_expiry_notification_undelivered ON keys USING btree (date(timezone('UTC'::text, expires_at)), before_expiry_notification_delivered_at) WHERE (before_expiry_notification_delivered_at IS NULL); + CREATE INDEX idx_members_created_at_user_id_invite_token ON members USING btree (created_at) WHERE ((invite_token IS NOT NULL) AND (user_id IS NULL)); CREATE INDEX idx_merge_requests_on_id_and_merge_jid ON merge_requests USING btree (id, merge_jid) WHERE ((merge_jid IS NOT NULL) AND (state_id = 4)); @@ -21685,6 +23043,8 @@ CREATE UNIQUE INDEX idx_metrics_users_starred_dashboard_on_user_project_dashboar CREATE INDEX idx_mr_cc_diff_files_on_mr_cc_id_and_sha ON merge_request_context_commit_diff_files USING btree (merge_request_context_commit_id, sha); +CREATE INDEX idx_mrs_on_target_id_and_created_at_and_state_id ON merge_requests USING btree (target_project_id, state_id, created_at, id); + CREATE UNIQUE INDEX idx_on_compliance_management_frameworks_namespace_id_name ON compliance_management_frameworks USING btree (namespace_id, name); CREATE UNIQUE INDEX idx_on_external_approval_rules_project_id_external_url ON external_approval_rules USING btree (project_id, external_url); @@ -21699,9 +23059,9 @@ CREATE INDEX idx_packages_debian_project_component_files_on_architecture_id ON p CREATE INDEX idx_packages_packages_on_project_id_name_version_package_type ON packages_packages USING btree (project_id, name, version, package_type); -CREATE INDEX idx_pkgs_deb_grp_architectures_on_distribution_id ON packages_debian_group_architectures USING btree (distribution_id); +CREATE INDEX idx_pkgs_debian_group_distribution_keys_on_distribution_id ON packages_debian_group_distribution_keys USING btree (distribution_id); -CREATE INDEX idx_pkgs_deb_proj_architectures_on_distribution_id ON packages_debian_project_architectures USING btree (distribution_id); +CREATE INDEX idx_pkgs_debian_project_distribution_keys_on_distribution_id ON packages_debian_project_distribution_keys USING btree (distribution_id); CREATE UNIQUE INDEX idx_pkgs_dep_links_on_pkg_id_dependency_id_dependency_type ON packages_dependency_links USING btree (package_id, dependency_id, dependency_type); @@ -21737,9 +23097,9 @@ CREATE INDEX idx_security_scans_on_scan_type ON security_scans USING btree (scan CREATE UNIQUE INDEX idx_serverless_domain_cluster_on_clusters_applications_knative ON serverless_domain_cluster USING btree (clusters_applications_knative_id); -CREATE UNIQUE INDEX idx_vuln_fingerprints_on_occurrences_id_and_fingerprint ON vulnerability_finding_fingerprints USING btree (finding_id, fingerprint_sha256); +CREATE UNIQUE INDEX idx_vuln_signatures_on_occurrences_id_and_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, signature_sha); -CREATE UNIQUE INDEX idx_vuln_fingerprints_uniqueness ON vulnerability_finding_fingerprints USING btree (finding_id, algorithm_type, fingerprint_sha256); +CREATE UNIQUE INDEX idx_vuln_signatures_uniqueness_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, algorithm_type, signature_sha); CREATE UNIQUE INDEX idx_vulnerability_ext_issue_links_on_vulne_id_and_ext_issue ON vulnerability_external_issue_links USING btree (vulnerability_id, external_type, external_project_key, external_issue_key); @@ -21797,9 +23157,11 @@ CREATE INDEX index_analytics_ca_project_stages_on_relative_position ON analytics CREATE INDEX index_analytics_ca_project_stages_on_start_event_label_id ON analytics_cycle_analytics_project_stages USING btree (start_event_label_id); -CREATE INDEX index_analytics_cycle_analytics_group_stages_custom_only ON analytics_cycle_analytics_group_stages USING btree (id) WHERE (custom = true); +CREATE INDEX index_analytics_ca_project_stages_on_value_stream_id ON analytics_cycle_analytics_project_stages USING btree (project_value_stream_id); -CREATE UNIQUE INDEX index_analytics_devops_adoption_segments_on_namespace_id ON analytics_devops_adoption_segments USING btree (namespace_id); +CREATE UNIQUE INDEX index_analytics_ca_project_value_streams_on_project_id_and_name ON analytics_cycle_analytics_project_value_streams USING btree (project_id, name); + +CREATE INDEX index_analytics_cycle_analytics_group_stages_custom_only ON analytics_cycle_analytics_group_stages USING btree (id) WHERE (custom = true); CREATE INDEX index_application_settings_on_custom_project_templates_group_id ON application_settings USING btree (custom_project_templates_group_id); @@ -21877,8 +23239,6 @@ CREATE INDEX index_authentication_events_on_user_id ON authentication_events USI CREATE INDEX index_award_emoji_on_awardable_type_and_awardable_id ON award_emoji USING btree (awardable_type, awardable_id); -CREATE INDEX index_award_emoji_on_user_id_and_name ON award_emoji USING btree (user_id, name); - CREATE UNIQUE INDEX index_aws_roles_on_role_external_id ON aws_roles USING btree (role_external_id); CREATE UNIQUE INDEX index_aws_roles_on_user_id ON aws_roles USING btree (user_id); @@ -21895,6 +23255,8 @@ CREATE INDEX index_badges_on_project_id ON badges USING btree (project_id); CREATE INDEX index_batched_jobs_by_batched_migration_id_and_id ON batched_background_migration_jobs USING btree (batched_background_migration_id, id); +CREATE INDEX index_batched_jobs_on_batched_migration_id_and_status ON batched_background_migration_jobs USING btree (batched_background_migration_id, status); + CREATE INDEX index_batched_migrations_on_job_table_and_column_name ON batched_background_migrations USING btree (job_class_name, table_name, column_name); CREATE INDEX index_board_assignees_on_assignee_id ON board_assignees USING btree (assignee_id); @@ -21937,6 +23299,12 @@ CREATE INDEX index_boards_epic_board_positions_on_epic_id ON boards_epic_board_p CREATE INDEX index_boards_epic_board_positions_on_scoped_relative_position ON boards_epic_board_positions USING btree (epic_board_id, epic_id, relative_position); +CREATE INDEX index_boards_epic_board_recent_visits_on_epic_board_id ON boards_epic_board_recent_visits USING btree (epic_board_id); + +CREATE INDEX index_boards_epic_board_recent_visits_on_group_id ON boards_epic_board_recent_visits USING btree (group_id); + +CREATE INDEX index_boards_epic_board_recent_visits_on_user_id ON boards_epic_board_recent_visits USING btree (user_id); + CREATE INDEX index_boards_epic_boards_on_group_id ON boards_epic_boards USING btree (group_id); CREATE INDEX index_boards_epic_list_user_preferences_on_epic_list_id ON boards_epic_list_user_preferences USING btree (epic_list_id); @@ -21975,6 +23343,8 @@ CREATE INDEX index_bulk_import_entities_on_parent_id ON bulk_import_entities USI CREATE INDEX index_bulk_import_entities_on_project_id ON bulk_import_entities USING btree (project_id); +CREATE INDEX index_bulk_import_export_uploads_on_export_id ON bulk_import_export_uploads USING btree (export_id); + CREATE INDEX index_bulk_import_failures_on_bulk_import_entity_id ON bulk_import_failures USING btree (bulk_import_entity_id); CREATE INDEX index_bulk_import_failures_on_correlation_id_value ON bulk_import_failures USING btree (correlation_id_value); @@ -22051,6 +23421,10 @@ CREATE INDEX index_ci_builds_on_user_id_and_created_at_and_type_eq_ci_build ON c CREATE INDEX index_ci_builds_project_id_and_status_for_live_jobs_partial2 ON ci_builds USING btree (project_id, status) WHERE (((type)::text = 'Ci::Build'::text) AND ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text]))); +CREATE INDEX index_ci_builds_runner_id_pending_covering ON ci_builds USING btree (runner_id, id) INCLUDE (project_id) WHERE (((status)::text = 'pending'::text) AND ((type)::text = 'Ci::Build'::text)); + +CREATE INDEX index_ci_builds_runner_id_running ON ci_builds USING btree (runner_id) WHERE (((status)::text = 'running'::text) AND ((type)::text = 'Ci::Build'::text)); + CREATE UNIQUE INDEX index_ci_builds_runner_session_on_build_id ON ci_builds_runner_session USING btree (build_id); CREATE INDEX index_ci_daily_build_group_report_results_on_group_id ON ci_daily_build_group_report_results USING btree (group_id); @@ -22081,12 +23455,26 @@ CREATE INDEX index_ci_job_artifacts_on_project_id ON ci_job_artifacts USING btre CREATE INDEX index_ci_job_artifacts_on_project_id_for_security_reports ON ci_job_artifacts USING btree (project_id) WHERE (file_type = ANY (ARRAY[5, 6, 7, 8])); +CREATE INDEX index_ci_job_token_project_scope_links_on_added_by_id ON ci_job_token_project_scope_links USING btree (added_by_id); + +CREATE INDEX index_ci_job_token_project_scope_links_on_target_project_id ON ci_job_token_project_scope_links USING btree (target_project_id); + CREATE INDEX index_ci_job_variables_on_job_id ON ci_job_variables USING btree (job_id); CREATE UNIQUE INDEX index_ci_job_variables_on_key_and_job_id ON ci_job_variables USING btree (key, job_id); +CREATE INDEX index_ci_minutes_additional_packs_on_namespace_id_purchase_xid ON ci_minutes_additional_packs USING btree (namespace_id, purchase_xid); + CREATE UNIQUE INDEX index_ci_namespace_monthly_usages_on_namespace_id_and_date ON ci_namespace_monthly_usages USING btree (namespace_id, date); +CREATE UNIQUE INDEX index_ci_pending_builds_on_build_id ON ci_pending_builds USING btree (build_id); + +CREATE INDEX index_ci_pending_builds_on_project_id ON ci_pending_builds USING btree (project_id); + +CREATE INDEX index_ci_pipeline_artifacts_failed_verification ON ci_pipeline_artifacts USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_ci_pipeline_artifacts_needs_verification ON ci_pipeline_artifacts USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + CREATE INDEX index_ci_pipeline_artifacts_on_expire_at ON ci_pipeline_artifacts USING btree (expire_at); CREATE INDEX index_ci_pipeline_artifacts_on_pipeline_id ON ci_pipeline_artifacts USING btree (pipeline_id); @@ -22095,6 +23483,10 @@ CREATE UNIQUE INDEX index_ci_pipeline_artifacts_on_pipeline_id_and_file_type ON CREATE INDEX index_ci_pipeline_artifacts_on_project_id ON ci_pipeline_artifacts USING btree (project_id); +CREATE INDEX index_ci_pipeline_artifacts_pending_verification ON ci_pipeline_artifacts USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + +CREATE INDEX index_ci_pipeline_artifacts_verification_state ON ci_pipeline_artifacts USING btree (verification_state); + CREATE INDEX index_ci_pipeline_chat_data_on_chat_name_id ON ci_pipeline_chat_data USING btree (chat_name_id); CREATE UNIQUE INDEX index_ci_pipeline_chat_data_on_pipeline_id ON ci_pipeline_chat_data USING btree (pipeline_id); @@ -22107,6 +23499,8 @@ CREATE INDEX index_ci_pipeline_schedules_on_next_run_at_and_active ON ci_pipelin CREATE INDEX index_ci_pipeline_schedules_on_owner_id ON ci_pipeline_schedules USING btree (owner_id); +CREATE INDEX index_ci_pipeline_schedules_on_owner_id_and_id_and_active ON ci_pipeline_schedules USING btree (owner_id, id) WHERE (active = true); + CREATE INDEX index_ci_pipeline_schedules_on_project_id ON ci_pipeline_schedules USING btree (project_id); CREATE UNIQUE INDEX index_ci_pipeline_variables_on_pipeline_id_and_key ON ci_pipeline_variables USING btree (pipeline_id, key); @@ -22151,6 +23545,8 @@ CREATE INDEX index_ci_pipelines_on_user_id_and_created_at_and_config_source ON c CREATE INDEX index_ci_pipelines_on_user_id_and_created_at_and_source ON ci_pipelines USING btree (user_id, created_at, source); +CREATE INDEX index_ci_pipelines_on_user_id_and_id_and_cancelable_status ON ci_pipelines USING btree (user_id, id) WHERE ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('waiting_for_resource'::character varying)::text, ('preparing'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text, ('scheduled'::character varying)::text])); + CREATE UNIQUE INDEX index_ci_project_monthly_usages_on_project_id_and_date ON ci_project_monthly_usages USING btree (project_id, date); CREATE UNIQUE INDEX index_ci_refs_on_project_id_and_ref_path ON ci_refs USING btree (project_id, ref_path); @@ -22169,7 +23565,15 @@ CREATE INDEX index_ci_runner_projects_on_project_id ON ci_runner_projects USING CREATE INDEX index_ci_runner_projects_on_runner_id ON ci_runner_projects USING btree (runner_id); -CREATE INDEX index_ci_runners_on_contacted_at ON ci_runners USING btree (contacted_at); +CREATE INDEX index_ci_runners_on_contacted_at_and_id_desc ON ci_runners USING btree (contacted_at, id DESC); + +CREATE INDEX index_ci_runners_on_contacted_at_desc_and_id_desc ON ci_runners USING btree (contacted_at DESC, id DESC); + +CREATE INDEX index_ci_runners_on_created_at_and_id_desc ON ci_runners USING btree (created_at, id DESC); + +CREATE INDEX index_ci_runners_on_created_at_desc_and_id_desc ON ci_runners USING btree (created_at DESC, id DESC); + +CREATE INDEX index_ci_runners_on_description_trigram ON ci_runners USING gin (description gin_trgm_ops); CREATE INDEX index_ci_runners_on_locked ON ci_runners USING btree (locked); @@ -22179,6 +23583,12 @@ CREATE INDEX index_ci_runners_on_token ON ci_runners USING btree (token); CREATE INDEX index_ci_runners_on_token_encrypted ON ci_runners USING btree (token_encrypted); +CREATE UNIQUE INDEX index_ci_running_builds_on_build_id ON ci_running_builds USING btree (build_id); + +CREATE INDEX index_ci_running_builds_on_project_id ON ci_running_builds USING btree (project_id); + +CREATE INDEX index_ci_running_builds_on_runner_id ON ci_running_builds USING btree (runner_id); + CREATE INDEX index_ci_sources_pipelines_on_pipeline_id ON ci_sources_pipelines USING btree (pipeline_id); CREATE INDEX index_ci_sources_pipelines_on_project_id ON ci_sources_pipelines USING btree (project_id); @@ -22195,6 +23605,8 @@ CREATE UNIQUE INDEX index_ci_sources_projects_on_source_project_id_and_pipeline_ CREATE INDEX index_ci_stages_on_pipeline_id ON ci_stages USING btree (pipeline_id); +CREATE INDEX index_ci_stages_on_pipeline_id_and_id ON ci_stages USING btree (pipeline_id, id) WHERE (status = ANY (ARRAY[0, 1, 2, 8, 9, 10])); + CREATE UNIQUE INDEX index_ci_stages_on_pipeline_id_and_name ON ci_stages USING btree (pipeline_id, name); CREATE INDEX index_ci_stages_on_pipeline_id_and_position ON ci_stages USING btree (pipeline_id, "position"); @@ -22217,11 +23629,15 @@ CREATE INDEX index_ci_triggers_on_owner_id ON ci_triggers USING btree (owner_id) CREATE INDEX index_ci_triggers_on_project_id ON ci_triggers USING btree (project_id); +CREATE INDEX index_ci_unit_test_failures_on_build_id ON ci_unit_test_failures USING btree (build_id); + +CREATE UNIQUE INDEX index_ci_unit_tests_on_project_id_and_key_hash ON ci_unit_tests USING btree (project_id, key_hash); + CREATE INDEX index_ci_variables_on_key ON ci_variables USING btree (key); CREATE UNIQUE INDEX index_ci_variables_on_project_id_and_key_and_environment_scope ON ci_variables USING btree (project_id, key, environment_scope); -CREATE INDEX index_cluster_agent_tokens_on_agent_id ON cluster_agent_tokens USING btree (agent_id); +CREATE INDEX index_cluster_agent_tokens_on_agent_id_and_last_used_at ON cluster_agent_tokens USING btree (agent_id, last_used_at DESC NULLS LAST); CREATE INDEX index_cluster_agent_tokens_on_created_by_user_id ON cluster_agent_tokens USING btree (created_by_user_id); @@ -22325,12 +23741,16 @@ CREATE INDEX index_dast_profiles_on_dast_site_profile_id ON dast_profiles USING CREATE UNIQUE INDEX index_dast_profiles_on_project_id_and_name ON dast_profiles USING btree (project_id, name); +CREATE UNIQUE INDEX index_dast_profiles_pipelines_on_ci_pipeline_id ON dast_profiles_pipelines USING btree (ci_pipeline_id); + CREATE UNIQUE INDEX index_dast_scanner_profiles_on_project_id_and_name ON dast_scanner_profiles USING btree (project_id, name); CREATE INDEX index_dast_site_profiles_on_dast_site_id ON dast_site_profiles USING btree (dast_site_id); CREATE UNIQUE INDEX index_dast_site_profiles_on_project_id_and_name ON dast_site_profiles USING btree (project_id, name); +CREATE UNIQUE INDEX index_dast_site_profiles_pipelines_on_ci_pipeline_id ON dast_site_profiles_pipelines USING btree (ci_pipeline_id); + CREATE INDEX index_dast_site_tokens_on_project_id ON dast_site_tokens USING btree (project_id); CREATE INDEX index_dast_site_validations_on_dast_site_token_id ON dast_site_validations USING btree (dast_site_token_id); @@ -22373,12 +23793,18 @@ CREATE INDEX index_deployments_on_environment_id_and_id ON deployments USING btr CREATE INDEX index_deployments_on_environment_id_and_iid_and_project_id ON deployments USING btree (environment_id, iid, project_id); +CREATE INDEX index_deployments_on_environment_id_status_and_finished_at ON deployments USING btree (environment_id, status, finished_at); + +CREATE INDEX index_deployments_on_environment_id_status_and_id ON deployments USING btree (environment_id, status, id); + CREATE INDEX index_deployments_on_environment_status_sha ON deployments USING btree (environment_id, status, sha); CREATE INDEX index_deployments_on_id_and_status_and_created_at ON deployments USING btree (id, status, created_at); CREATE INDEX index_deployments_on_id_where_cluster_id_present ON deployments USING btree (id) WHERE (cluster_id IS NOT NULL); +CREATE INDEX index_deployments_on_project_and_environment_and_updated_at_id ON deployments USING btree (project_id, environment_id, updated_at, id); + CREATE INDEX index_deployments_on_project_and_finished ON deployments USING btree (project_id, finished_at) WHERE (status = 2); CREATE INDEX index_deployments_on_project_id_and_id ON deployments USING btree (project_id, id DESC); @@ -22435,6 +23861,8 @@ CREATE INDEX index_draft_notes_on_discussion_id ON draft_notes USING btree (disc CREATE INDEX index_draft_notes_on_merge_request_id ON draft_notes USING btree (merge_request_id); +CREATE UNIQUE INDEX index_elastic_index_settings_on_alias_name ON elastic_index_settings USING btree (alias_name); + CREATE INDEX index_elastic_reindexing_subtasks_on_elastic_reindexing_task_id ON elastic_reindexing_subtasks USING btree (elastic_reindexing_task_id); CREATE UNIQUE INDEX index_elastic_reindexing_tasks_on_in_progress ON elastic_reindexing_tasks USING btree (in_progress) WHERE in_progress; @@ -22457,12 +23885,16 @@ CREATE UNIQUE INDEX index_environments_on_project_id_and_name ON environments US CREATE UNIQUE INDEX index_environments_on_project_id_and_slug ON environments USING btree (project_id, slug); +CREATE INDEX index_environments_on_project_id_and_tier ON environments USING btree (project_id, tier) WHERE (tier IS NOT NULL); + CREATE INDEX index_environments_on_project_id_state_environment_type ON environments USING btree (project_id, state, environment_type); CREATE INDEX index_environments_on_state_and_auto_stop_at ON environments USING btree (state, auto_stop_at) WHERE ((auto_stop_at IS NOT NULL) AND ((state)::text = 'available'::text)); CREATE UNIQUE INDEX index_epic_board_list_preferences_on_user_and_list ON boards_epic_list_user_preferences USING btree (user_id, epic_list_id); +CREATE UNIQUE INDEX index_epic_board_recent_visits_on_user_group_and_board ON boards_epic_board_recent_visits USING btree (user_id, group_id, epic_board_id); + CREATE INDEX index_epic_issues_on_epic_id ON epic_issues USING btree (epic_id); CREATE INDEX index_epic_issues_on_epic_id_and_issue_id ON epic_issues USING btree (epic_id, issue_id); @@ -22487,8 +23919,6 @@ CREATE INDEX index_epics_on_due_date_sourcing_milestone_id ON epics USING btree CREATE INDEX index_epics_on_end_date ON epics USING btree (end_date); -CREATE INDEX index_epics_on_group_id ON epics USING btree (group_id); - CREATE UNIQUE INDEX index_epics_on_group_id_and_external_key ON epics USING btree (group_id, external_key) WHERE (external_key IS NOT NULL); CREATE UNIQUE INDEX index_epics_on_group_id_and_iid ON epics USING btree (group_id, iid); @@ -22533,7 +23963,7 @@ CREATE INDEX index_evidences_on_release_id ON evidences USING btree (release_id) CREATE INDEX index_experiment_subjects_on_experiment_id ON experiment_subjects USING btree (experiment_id); -CREATE INDEX index_experiment_subjects_on_group_id ON experiment_subjects USING btree (group_id); +CREATE INDEX index_experiment_subjects_on_namespace_id ON experiment_subjects USING btree (namespace_id); CREATE INDEX index_experiment_subjects_on_project_id ON experiment_subjects USING btree (project_id); @@ -22731,6 +24161,10 @@ CREATE INDEX index_import_failures_on_project_id_not_null ON import_failures USI CREATE INDEX index_imported_projects_on_import_type_creator_id_created_at ON projects USING btree (import_type, creator_id, created_at) WHERE (import_type IS NOT NULL); +CREATE INDEX index_in_product_marketing_emails_on_user_id ON in_product_marketing_emails USING btree (user_id); + +CREATE UNIQUE INDEX index_in_product_marketing_emails_on_user_track_series ON in_product_marketing_emails USING btree (user_id, track, series); + CREATE INDEX index_inc_mgmnt_oncall_participants_on_oncall_user_id ON incident_management_oncall_participants USING btree (user_id); CREATE UNIQUE INDEX index_inc_mgmnt_oncall_participants_on_user_id_and_rotation_id ON incident_management_oncall_participants USING btree (user_id, oncall_rotation_id); @@ -22839,6 +24273,8 @@ CREATE INDEX index_jira_imports_on_user_id ON jira_imports USING btree (user_id) CREATE INDEX index_jira_tracker_data_on_service_id ON jira_tracker_data USING btree (service_id); +CREATE INDEX index_keys_on_expires_at_and_expiry_notification_undelivered ON keys USING btree (date(timezone('UTC'::text, expires_at)), expiry_notification_delivered_at) WHERE (expiry_notification_delivered_at IS NULL); + CREATE UNIQUE INDEX index_keys_on_fingerprint ON keys USING btree (fingerprint); CREATE INDEX index_keys_on_fingerprint_sha256 ON keys USING btree (fingerprint_sha256); @@ -22917,10 +24353,12 @@ CREATE INDEX index_members_on_requested_at ON members USING btree (requested_at) CREATE INDEX index_members_on_source_id_and_source_type ON members USING btree (source_id, source_type); -CREATE INDEX index_members_on_user_id ON members USING btree (user_id); +CREATE INDEX index_members_on_user_id_and_access_level_requested_at_is_null ON members USING btree (user_id, access_level) WHERE (requested_at IS NULL); CREATE INDEX index_members_on_user_id_created_at ON members USING btree (user_id, created_at) WHERE ((ldap = true) AND ((type)::text = 'GroupMember'::text) AND ((source_type)::text = 'Namespace'::text)); +CREATE INDEX index_members_on_user_id_source_id_source_type ON members USING btree (user_id, source_id, source_type); + CREATE INDEX index_merge_request_assignees_on_merge_request_id ON merge_request_assignees USING btree (merge_request_id); CREATE UNIQUE INDEX index_merge_request_assignees_on_merge_request_id_and_user_id ON merge_request_assignees USING btree (merge_request_id, user_id); @@ -22933,10 +24371,20 @@ CREATE UNIQUE INDEX index_merge_request_cleanup_schedules_on_merge_request_id ON CREATE INDEX index_merge_request_context_commits_on_merge_request_id ON merge_request_context_commits USING btree (merge_request_id); +CREATE UNIQUE INDEX index_merge_request_diff_commit_users_on_name_and_email ON merge_request_diff_commit_users USING btree (name, email); + CREATE INDEX index_merge_request_diff_commits_on_sha ON merge_request_diff_commits USING btree (sha); +CREATE INDEX index_merge_request_diff_details_failed_verification ON merge_request_diff_details USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_merge_request_diff_details_needs_verification ON merge_request_diff_details USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + CREATE INDEX index_merge_request_diff_details_on_merge_request_diff_id ON merge_request_diff_details USING btree (merge_request_diff_id); +CREATE INDEX index_merge_request_diff_details_on_verification_state ON merge_request_diff_details USING btree (verification_state); + +CREATE INDEX index_merge_request_diff_details_pending_verification ON merge_request_diff_details USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + CREATE INDEX index_merge_request_diffs_by_id_partial ON merge_request_diffs USING btree (id) WHERE ((files_count > 0) AND ((NOT stored_externally) OR (stored_externally IS NULL))); CREATE INDEX index_merge_request_diffs_on_external_diff_store ON merge_request_diffs USING btree (external_diff_store); @@ -23005,6 +24453,8 @@ CREATE INDEX index_merge_requests_on_target_project_id_and_iid_and_state_id ON m CREATE INDEX index_merge_requests_on_target_project_id_and_iid_jira_title ON merge_requests USING btree (target_project_id, iid) WHERE ((title)::text ~ '[A-Z][A-Z_0-9]+-\d+'::text); +CREATE INDEX index_merge_requests_on_target_project_id_and_source_branch ON merge_requests USING btree (target_project_id, source_branch); + CREATE INDEX index_merge_requests_on_target_project_id_and_squash_commit_sha ON merge_requests USING btree (target_project_id, squash_commit_sha); CREATE INDEX index_merge_requests_on_target_project_id_and_target_branch ON merge_requests USING btree (target_project_id, target_branch) WHERE ((state_id = 1) AND (merge_when_pipeline_succeeds = true)); @@ -23033,6 +24483,8 @@ CREATE INDEX index_metrics_dashboard_annotations_on_timespan_end ON metrics_dash CREATE INDEX index_metrics_users_starred_dashboards_on_project_id ON metrics_users_starred_dashboards USING btree (project_id); +CREATE INDEX index_migration_jobs_on_migration_id_and_finished_at ON batched_background_migration_jobs USING btree (batched_background_migration_id, finished_at); + CREATE INDEX index_milestone_releases_on_release_id ON milestone_releases USING btree (release_id); CREATE INDEX index_milestones_on_description_trigram ON milestones USING gin (description gin_trgm_ops); @@ -23047,7 +24499,7 @@ CREATE INDEX index_milestones_on_title ON milestones USING btree (title); CREATE INDEX index_milestones_on_title_trigram ON milestones USING gin (title gin_trgm_ops); -CREATE INDEX index_mirror_data_on_next_execution_and_retry_count ON project_mirror_data USING btree (next_execution_timestamp, retry_count); +CREATE INDEX index_mirror_data_non_scheduled_or_started ON project_mirror_data USING btree (next_execution_timestamp, retry_count) WHERE ((status)::text <> ALL ('{scheduled,started}'::text[])); CREATE UNIQUE INDEX index_mr_blocks_on_blocking_and_blocked_mr_ids ON merge_request_blocks USING btree (blocking_merge_request_id, blocked_merge_request_id); @@ -23067,6 +24519,10 @@ CREATE UNIQUE INDEX index_namespace_root_storage_statistics_on_namespace_id ON n CREATE UNIQUE INDEX index_namespace_statistics_on_namespace_id ON namespace_statistics USING btree (namespace_id); +CREATE INDEX index_namespaces_id_parent_id_is_not_null ON namespaces USING btree (id) WHERE (parent_id IS NOT NULL); + +CREATE INDEX index_namespaces_id_parent_id_is_null ON namespaces USING btree (id) WHERE (parent_id IS NULL); + CREATE INDEX index_namespaces_on_created_at ON namespaces USING btree (created_at); CREATE INDEX index_namespaces_on_custom_project_templates_group_id_and_type ON namespaces USING btree (custom_project_templates_group_id, type) WHERE (custom_project_templates_group_id IS NOT NULL); @@ -23099,12 +24555,16 @@ CREATE UNIQUE INDEX index_namespaces_on_runners_token_encrypted ON namespaces US CREATE INDEX index_namespaces_on_shared_and_extra_runners_minutes_limit ON namespaces USING btree (shared_runners_minutes_limit, extra_shared_runners_minutes_limit); +CREATE INDEX index_namespaces_on_traversal_ids ON namespaces USING gin (traversal_ids); + CREATE INDEX index_namespaces_on_type_and_id_partial ON namespaces USING btree (type, id) WHERE (type IS NOT NULL); CREATE INDEX index_non_requested_project_members_on_source_id_and_type ON members USING btree (source_id, source_type) WHERE ((requested_at IS NULL) AND ((type)::text = 'ProjectMember'::text)); CREATE UNIQUE INDEX index_note_diff_files_on_diff_note_id ON note_diff_files USING btree (diff_note_id); +CREATE INDEX index_notes_for_cherry_picked_merge_requests ON notes USING btree (project_id, commit_id) WHERE ((noteable_type)::text = 'MergeRequest'::text); + CREATE INDEX index_notes_on_author_id_and_created_at_and_id ON notes USING btree (author_id, created_at, id); CREATE INDEX index_notes_on_commit_id ON notes USING btree (commit_id); @@ -23125,9 +24585,7 @@ CREATE INDEX index_notes_on_project_id_and_noteable_type ON notes USING btree (p CREATE INDEX index_notes_on_review_id ON notes USING btree (review_id); -CREATE INDEX index_notification_settings_on_source_id_and_source_type ON notification_settings USING btree (source_id, source_type); - -CREATE INDEX index_notification_settings_on_user_id ON notification_settings USING btree (user_id); +CREATE INDEX index_notification_settings_on_source_and_level_and_user ON notification_settings USING btree (source_id, source_type, level, user_id); CREATE UNIQUE INDEX index_notifications_on_user_id_and_source_id_and_source_type ON notification_settings USING btree (user_id, source_id, source_type); @@ -23151,11 +24609,9 @@ CREATE INDEX index_oauth_openid_requests_on_access_grant_id ON oauth_openid_requ CREATE UNIQUE INDEX index_on_deploy_keys_id_and_type_and_public ON keys USING btree (id, type) WHERE (public = true); -CREATE INDEX index_on_id_partial_with_legacy_storage ON projects USING btree (id) WHERE ((storage_version < 2) OR (storage_version IS NULL)); - CREATE INDEX index_on_identities_lower_extern_uid_and_provider ON identities USING btree (lower((extern_uid)::text), provider); -CREATE UNIQUE INDEX index_on_instance_statistics_recorded_at_and_identifier ON analytics_instance_statistics_measurements USING btree (identifier, recorded_at); +CREATE UNIQUE INDEX index_on_instance_statistics_recorded_at_and_identifier ON analytics_usage_trends_measurements USING btree (identifier, recorded_at); CREATE INDEX index_on_label_links_all_columns ON label_links USING btree (target_id, label_id, target_type); @@ -23167,16 +24623,18 @@ CREATE INDEX index_on_namespaces_lower_name ON namespaces USING btree (lower((na CREATE INDEX index_on_namespaces_lower_path ON namespaces USING btree (lower((path)::text)); +CREATE INDEX index_on_oncall_schedule_escalation_rule ON incident_management_escalation_rules USING btree (oncall_schedule_id); + +CREATE INDEX index_on_pages_metadata_not_migrated ON project_pages_metadata USING btree (project_id) WHERE ((deployed = true) AND (pages_deployment_id IS NULL)); + +CREATE UNIQUE INDEX index_on_policy_schedule_status_elapsed_time_escalation_rules ON incident_management_escalation_rules USING btree (policy_id, oncall_schedule_id, status, elapsed_time_seconds); + +CREATE UNIQUE INDEX index_on_project_id_escalation_policy_name_unique ON incident_management_escalation_policies USING btree (project_id, name); + CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path)::text)); CREATE INDEX index_on_routes_lower_path ON routes USING btree (lower((path)::text)); -CREATE UNIQUE INDEX index_on_segment_selections_group_id_segment_id ON analytics_devops_adoption_segment_selections USING btree (group_id, segment_id); - -CREATE UNIQUE INDEX index_on_segment_selections_project_id_segment_id ON analytics_devops_adoption_segment_selections USING btree (project_id, segment_id); - -CREATE INDEX index_on_segment_selections_segment_id ON analytics_devops_adoption_segment_selections USING btree (segment_id); - CREATE INDEX index_on_snapshots_segment_id_end_time ON analytics_devops_adoption_snapshots USING btree (segment_id, end_time); CREATE INDEX index_on_snapshots_segment_id_recorded_at ON analytics_devops_adoption_snapshots USING btree (segment_id, recorded_at); @@ -23253,8 +24711,12 @@ CREATE INDEX index_packages_dependency_links_on_dependency_id ON packages_depend CREATE INDEX index_packages_events_on_package_id ON packages_events USING btree (package_id); +CREATE INDEX index_packages_helm_file_metadata_on_channel ON packages_helm_file_metadata USING btree (channel); + CREATE INDEX index_packages_maven_metadata_on_package_id_and_path ON packages_maven_metadata USING btree (package_id, path); +CREATE INDEX index_packages_maven_metadata_on_path ON packages_maven_metadata USING btree (path); + CREATE INDEX index_packages_nuget_dl_metadata_on_dependency_link_id ON packages_nuget_dependency_link_metadata USING btree (dependency_link_id); CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_generic ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 7); @@ -23293,6 +24755,8 @@ CREATE INDEX index_packages_tags_on_package_id_and_updated_at ON packages_tags U CREATE INDEX index_pages_deployments_on_ci_build_id ON pages_deployments USING btree (ci_build_id); +CREATE INDEX index_pages_deployments_on_file_store_and_id ON pages_deployments USING btree (file_store, id); + CREATE INDEX index_pages_deployments_on_project_id ON pages_deployments USING btree (project_id); CREATE INDEX index_pages_domain_acme_orders_on_challenge_token ON pages_domain_acme_orders USING btree (challenge_token); @@ -23581,6 +25045,8 @@ CREATE INDEX index_protected_environment_deploy_access_levels_on_group_id ON pro CREATE INDEX index_protected_environment_deploy_access_levels_on_user_id ON protected_environment_deploy_access_levels USING btree (user_id); +CREATE UNIQUE INDEX index_protected_environments_on_group_id_and_name ON protected_environments USING btree (group_id, name) WHERE (group_id IS NOT NULL); + CREATE INDEX index_protected_environments_on_project_id ON protected_environments USING btree (project_id); CREATE UNIQUE INDEX index_protected_environments_on_project_id_and_name ON protected_environments USING btree (project_id, name); @@ -23757,6 +25223,8 @@ CREATE INDEX index_service_desk_enabled_projects_on_id_creator_id_created_at ON CREATE INDEX index_services_on_inherit_from_id ON services USING btree (inherit_from_id); +CREATE INDEX index_services_on_project_and_type_where_inherit_null ON services USING btree (project_id, type) WHERE (inherit_from_id IS NULL); + CREATE UNIQUE INDEX index_services_on_project_id_and_type_unique ON services USING btree (project_id, type); CREATE INDEX index_services_on_template ON services USING btree (template); @@ -23773,6 +25241,8 @@ CREATE UNIQUE INDEX index_services_on_unique_group_id_and_type ON services USING CREATE UNIQUE INDEX index_shards_on_name ON shards USING btree (name); +CREATE UNIQUE INDEX index_site_profile_secret_variables_on_site_profile_id_and_key ON dast_site_profile_secret_variables USING btree (dast_site_profile_id, key); + CREATE INDEX index_slack_integrations_on_service_id ON slack_integrations USING btree (service_id); CREATE UNIQUE INDEX index_slack_integrations_on_team_id_and_alias ON slack_integrations USING btree (team_id, alias); @@ -23783,10 +25253,18 @@ CREATE INDEX index_smartcard_identities_on_user_id ON smartcard_identities USING CREATE INDEX index_snippet_on_id_and_project_id ON snippets USING btree (id, project_id); +CREATE INDEX index_snippet_repositories_failed_verification ON snippet_repositories USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_snippet_repositories_needs_verification ON snippet_repositories USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + CREATE UNIQUE INDEX index_snippet_repositories_on_disk_path ON snippet_repositories USING btree (disk_path); CREATE INDEX index_snippet_repositories_on_shard_id ON snippet_repositories USING btree (shard_id); +CREATE INDEX index_snippet_repositories_pending_verification ON snippet_repositories USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + +CREATE INDEX index_snippet_repositories_verification_state ON snippet_repositories USING btree (verification_state); + CREATE INDEX index_snippet_repository_storage_moves_on_snippet_id ON snippet_repository_storage_moves USING btree (snippet_id); CREATE UNIQUE INDEX index_snippet_user_mentions_on_note_id ON snippet_user_mentions USING btree (note_id) WHERE (note_id IS NOT NULL); @@ -23823,7 +25301,13 @@ CREATE UNIQUE INDEX index_software_licenses_on_unique_name ON software_licenses CREATE UNIQUE INDEX index_sop_configs_on_project_id ON security_orchestration_policy_configurations USING btree (project_id); -CREATE UNIQUE INDEX index_sop_configs_on_security_policy_management_project_id ON security_orchestration_policy_configurations USING btree (security_policy_management_project_id); +CREATE INDEX index_sop_configurations_project_id_policy_project_id ON security_orchestration_policy_configurations USING btree (security_policy_management_project_id, project_id); + +CREATE INDEX index_sop_schedules_on_sop_configuration_id ON security_orchestration_policy_rule_schedules USING btree (security_orchestration_policy_configuration_id); + +CREATE INDEX index_sop_schedules_on_user_id ON security_orchestration_policy_rule_schedules USING btree (user_id); + +CREATE INDEX index_spam_logs_on_user_id ON spam_logs USING btree (user_id); CREATE INDEX index_sprints_iterations_cadence_id ON sprints USING btree (iterations_cadence_id); @@ -23833,7 +25317,7 @@ CREATE INDEX index_sprints_on_due_date ON sprints USING btree (due_date); CREATE INDEX index_sprints_on_group_id ON sprints USING btree (group_id); -CREATE UNIQUE INDEX index_sprints_on_group_id_and_title ON sprints USING btree (group_id, title) WHERE (group_id IS NOT NULL); +CREATE UNIQUE INDEX index_sprints_on_iterations_cadence_id_and_title ON sprints USING btree (iterations_cadence_id, title); CREATE UNIQUE INDEX index_sprints_on_project_id_and_iid ON sprints USING btree (project_id, iid); @@ -23843,6 +25327,10 @@ CREATE INDEX index_sprints_on_title ON sprints USING btree (title); CREATE INDEX index_sprints_on_title_trigram ON sprints USING gin (title gin_trgm_ops); +CREATE INDEX index_status_check_responses_on_external_approval_rule_id ON status_check_responses USING btree (external_approval_rule_id); + +CREATE INDEX index_status_check_responses_on_merge_request_id ON status_check_responses USING btree (merge_request_id); + CREATE UNIQUE INDEX index_status_page_published_incidents_on_issue_id ON status_page_published_incidents USING btree (issue_id); CREATE INDEX index_status_page_settings_on_project_id ON status_page_settings USING btree (project_id); @@ -23875,12 +25363,20 @@ CREATE INDEX index_term_agreements_on_term_id ON term_agreements USING btree (te CREATE INDEX index_term_agreements_on_user_id ON term_agreements USING btree (user_id); +CREATE INDEX index_terraform_state_versions_failed_verification ON terraform_state_versions USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_terraform_state_versions_needs_verification ON terraform_state_versions USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + CREATE INDEX index_terraform_state_versions_on_ci_build_id ON terraform_state_versions USING btree (ci_build_id); CREATE INDEX index_terraform_state_versions_on_created_by_user_id ON terraform_state_versions USING btree (created_by_user_id); CREATE UNIQUE INDEX index_terraform_state_versions_on_state_id_and_version ON terraform_state_versions USING btree (terraform_state_id, version); +CREATE INDEX index_terraform_state_versions_on_verification_state ON terraform_state_versions USING btree (verification_state); + +CREATE INDEX index_terraform_state_versions_pending_verification ON terraform_state_versions USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + CREATE INDEX index_terraform_states_on_file_store ON terraform_states USING btree (file_store); CREATE INDEX index_terraform_states_on_locked_by_user_id ON terraform_states USING btree (locked_by_user_id); @@ -23897,6 +25393,8 @@ CREATE INDEX index_timelogs_on_merge_request_id ON timelogs USING btree (merge_r CREATE INDEX index_timelogs_on_note_id ON timelogs USING btree (note_id); +CREATE INDEX index_timelogs_on_project_id_and_spent_at ON timelogs USING btree (project_id, spent_at); + CREATE INDEX index_timelogs_on_spent_at ON timelogs USING btree (spent_at) WHERE (spent_at IS NOT NULL); CREATE INDEX index_timelogs_on_user_id ON timelogs USING btree (user_id); @@ -23933,6 +25431,12 @@ CREATE INDEX index_u2f_registrations_on_user_id ON u2f_registrations USING btree CREATE UNIQUE INDEX index_unique_issue_metrics_issue_id ON issue_metrics USING btree (issue_id); +CREATE INDEX index_unit_test_failures_failed_at ON ci_unit_test_failures USING btree (failed_at DESC); + +CREATE UNIQUE INDEX index_unit_test_failures_unique_columns ON ci_unit_test_failures USING btree (unit_test_id, failed_at DESC, build_id); + +CREATE UNIQUE INDEX index_upcoming_reconciliations_on_namespace_id ON upcoming_reconciliations USING btree (namespace_id); + CREATE INDEX index_uploads_on_checksum ON uploads USING btree (checksum); CREATE INDEX index_uploads_on_model_id_and_model_type ON uploads USING btree (model_id, model_type); @@ -23993,6 +25497,8 @@ CREATE INDEX index_users_on_feed_token ON users USING btree (feed_token); CREATE INDEX index_users_on_group_view ON users USING btree (group_view); +CREATE INDEX index_users_on_id_and_last_activity_on_for_non_internal_active ON users USING btree (id, last_activity_on) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[NULL::integer, 6, 4])))); + CREATE INDEX index_users_on_incoming_email_token ON users USING btree (incoming_email_token); CREATE INDEX index_users_on_managing_group_id ON users USING btree (managing_group_id); @@ -24027,6 +25533,8 @@ CREATE INDEX index_users_ops_dashboard_projects_on_project_id ON users_ops_dashb CREATE UNIQUE INDEX index_users_ops_dashboard_projects_on_user_id_and_project_id ON users_ops_dashboard_projects USING btree (user_id, project_id); +CREATE INDEX index_users_require_two_factor_authentication_from_group_false ON users USING btree (require_two_factor_authentication_from_group) WHERE (require_two_factor_authentication_from_group = false); + CREATE INDEX index_users_security_dashboard_projects_on_user_id ON users_security_dashboard_projects USING btree (user_id); CREATE INDEX index_users_star_projects_on_project_id ON users_star_projects USING btree (project_id); @@ -24085,7 +25593,7 @@ CREATE INDEX index_vulnerability_feedback_on_merge_request_id ON vulnerability_f CREATE INDEX index_vulnerability_feedback_on_pipeline_id ON vulnerability_feedback USING btree (pipeline_id); -CREATE INDEX index_vulnerability_finding_fingerprints_on_finding_id ON vulnerability_finding_fingerprints USING btree (finding_id); +CREATE INDEX index_vulnerability_finding_signatures_on_finding_id ON vulnerability_finding_signatures USING btree (finding_id); CREATE INDEX index_vulnerability_findings_remediations_on_remediation_id ON vulnerability_findings_remediations USING btree (vulnerability_remediation_id); @@ -24103,6 +25611,8 @@ CREATE UNIQUE INDEX index_vulnerability_occurrence_identifiers_on_unique_keys ON CREATE INDEX index_vulnerability_occurrence_pipelines_on_pipeline_id ON vulnerability_occurrence_pipelines USING btree (pipeline_id); +CREATE INDEX index_vulnerability_occurrences_deduplication ON vulnerability_occurrences USING btree (project_id, report_type, project_fingerprint); + CREATE INDEX index_vulnerability_occurrences_for_issue_links_migration ON vulnerability_occurrences USING btree (project_id, report_type, encode(project_fingerprint, 'hex'::text)); CREATE INDEX index_vulnerability_occurrences_on_primary_identifier_id ON vulnerability_occurrences USING btree (primary_identifier_id); @@ -24121,6 +25631,8 @@ CREATE UNIQUE INDEX index_vulnerability_remediations_on_project_id_and_checksum CREATE UNIQUE INDEX index_vulnerability_scanners_on_project_id_and_external_id ON vulnerability_scanners USING btree (project_id, external_id); +CREATE INDEX index_vulnerability_statistics_on_latest_pipeline_id ON vulnerability_statistics USING btree (latest_pipeline_id); + CREATE INDEX index_vulnerability_statistics_on_letter_grade ON vulnerability_statistics USING btree (letter_grade); CREATE UNIQUE INDEX index_vulnerability_statistics_on_unique_project_id ON vulnerability_statistics USING btree (project_id); @@ -24131,14 +25643,16 @@ CREATE UNIQUE INDEX index_vulns_user_mentions_on_vulnerability_id ON vulnerabili CREATE UNIQUE INDEX index_vulns_user_mentions_on_vulnerability_id_and_note_id ON vulnerability_user_mentions USING btree (vulnerability_id, note_id); -CREATE INDEX index_web_hook_logs_on_created_at_and_web_hook_id ON web_hook_logs USING btree (created_at, web_hook_id); +CREATE INDEX index_web_hook_logs_on_created_at_and_web_hook_id ON web_hook_logs_archived USING btree (created_at, web_hook_id); -CREATE INDEX index_web_hook_logs_on_web_hook_id ON web_hook_logs USING btree (web_hook_id); +CREATE INDEX index_web_hook_logs_on_web_hook_id ON web_hook_logs_archived USING btree (web_hook_id); CREATE INDEX index_web_hooks_on_group_id ON web_hooks USING btree (group_id) WHERE ((type)::text = 'GroupHook'::text); CREATE INDEX index_web_hooks_on_project_id ON web_hooks USING btree (project_id); +CREATE INDEX index_web_hooks_on_project_id_recent_failures ON web_hooks USING btree (project_id, recent_failures); + CREATE INDEX index_web_hooks_on_service_id ON web_hooks USING btree (service_id); CREATE INDEX index_web_hooks_on_type ON web_hooks USING btree (type); @@ -24205,6 +25719,10 @@ CREATE INDEX packages_packages_needs_verification ON packages_package_files USIN CREATE INDEX packages_packages_pending_verification ON packages_package_files USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); +CREATE UNIQUE INDEX partial_index_bulk_import_exports_on_group_id_and_relation ON bulk_import_exports USING btree (group_id, relation) WHERE (group_id IS NOT NULL); + +CREATE UNIQUE INDEX partial_index_bulk_import_exports_on_project_id_and_relation ON bulk_import_exports USING btree (project_id, relation) WHERE (project_id IS NOT NULL); + CREATE INDEX partial_index_ci_builds_on_scheduled_at_with_scheduled_jobs ON ci_builds USING btree (scheduled_at) WHERE ((scheduled_at IS NOT NULL) AND ((type)::text = 'Ci::Build'::text) AND ((status)::text = 'scheduled'::text)); CREATE INDEX partial_index_deployments_for_legacy_successful_deployments ON deployments USING btree (id) WHERE ((finished_at IS NULL) AND (status = 2)); @@ -24217,8 +25735,6 @@ CREATE UNIQUE INDEX snippet_user_mentions_on_snippet_id_index ON snippet_user_me CREATE UNIQUE INDEX taggings_idx ON taggings USING btree (tag_id, taggable_id, taggable_type, context, tagger_id, tagger_type); -CREATE INDEX temporary_index_vulnerabilities_on_id ON vulnerabilities USING btree (id) WHERE ((state = 2) AND ((dismissed_at IS NULL) OR (dismissed_by_id IS NULL))); - CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree (user_id, term_id); CREATE INDEX tmp_idx_deduplicate_vulnerability_occurrences ON vulnerability_occurrences USING btree (project_id, report_type, location_fingerprint, primary_identifier_id, id); @@ -24259,6 +25775,102 @@ CREATE UNIQUE INDEX vulnerability_feedback_unique_idx ON vulnerability_feedback CREATE UNIQUE INDEX vulnerability_occurrence_pipelines_on_unique_keys ON vulnerability_occurrence_pipelines USING btree (occurrence_id, pipeline_id); +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_1554dc6f11; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_719c6187cb; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_80bf138a51; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_962081978f; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_eecfac613f; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_fdb8d5eeea; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_000000_pkey; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202212_pkey; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202301_pkey; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302_web_hook_id_idx; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303_web_hook_id_idx; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304_web_hook_id_idx; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305_web_hook_id_idx; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306_web_hook_id_idx; + ALTER INDEX index_product_analytics_events_experimental_project_and_time ATTACH PARTITION gitlab_partitions_static.product_analytics_events_expe_project_id_collector_tstamp_idx10; ALTER INDEX index_product_analytics_events_experimental_project_and_time ATTACH PARTITION gitlab_partitions_static.product_analytics_events_expe_project_id_collector_tstamp_idx11; @@ -24515,7 +26127,33 @@ ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_p ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_63_pkey; -CREATE TRIGGER table_sync_trigger_ee39a25f9d AFTER INSERT OR DELETE OR UPDATE ON audit_events FOR EACH ROW EXECUTE FUNCTION table_sync_function_2be879775d(); +CREATE TRIGGER table_sync_trigger_b99eb6998c AFTER INSERT OR DELETE OR UPDATE ON web_hook_logs FOR EACH ROW EXECUTE FUNCTION table_sync_function_29bc99d6db(); + +CREATE TRIGGER trigger_07c94931164e BEFORE INSERT OR UPDATE ON push_event_payloads FOR EACH ROW EXECUTE FUNCTION trigger_07c94931164e(); + +CREATE TRIGGER trigger_21e7a2602957 BEFORE INSERT OR UPDATE ON ci_build_needs FOR EACH ROW EXECUTE FUNCTION trigger_21e7a2602957(); + +CREATE TRIGGER trigger_3f6129be01d2 BEFORE INSERT OR UPDATE ON ci_builds FOR EACH ROW EXECUTE FUNCTION trigger_3f6129be01d2(); + +CREATE TRIGGER trigger_51ab7cef8934 BEFORE INSERT OR UPDATE ON ci_builds_runner_session FOR EACH ROW EXECUTE FUNCTION trigger_51ab7cef8934(); + +CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE FUNCTION trigger_69523443cc10(); + +CREATE TRIGGER trigger_77f5e1d20482 BEFORE INSERT OR UPDATE ON deployments FOR EACH ROW EXECUTE FUNCTION trigger_77f5e1d20482(); + +CREATE TRIGGER trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipelines FOR EACH ROW EXECUTE FUNCTION trigger_8485e97c00e3(); + +CREATE TRIGGER trigger_8487d4de3e7b BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_8487d4de3e7b(); + +CREATE TRIGGER trigger_91dc388a5fe6 BEFORE INSERT OR UPDATE ON ci_build_trace_sections FOR EACH ROW EXECUTE FUNCTION trigger_91dc388a5fe6(); + +CREATE TRIGGER trigger_aebe8b822ad3 BEFORE INSERT OR UPDATE ON taggings FOR EACH ROW EXECUTE FUNCTION trigger_aebe8b822ad3(); + +CREATE TRIGGER trigger_be1804f21693 BEFORE INSERT OR UPDATE ON ci_job_artifacts FOR EACH ROW EXECUTE FUNCTION trigger_be1804f21693(); + +CREATE TRIGGER trigger_cf2f9e35f002 BEFORE INSERT OR UPDATE ON ci_build_trace_chunks FOR EACH ROW EXECUTE FUNCTION trigger_cf2f9e35f002(); + +CREATE TRIGGER trigger_f1ca8ec18d78 BEFORE INSERT OR UPDATE ON geo_job_artifact_deleted_events FOR EACH ROW EXECUTE FUNCTION trigger_f1ca8ec18d78(); CREATE TRIGGER trigger_has_external_issue_tracker_on_delete AFTER DELETE ON services FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker(); @@ -24568,9 +26206,15 @@ ALTER TABLE ONLY notification_settings ALTER TABLE ONLY lists ADD CONSTRAINT fk_0d3f677137 FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_unit_test_failures + ADD CONSTRAINT fk_0f09856e1f FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_pages_metadata ADD CONSTRAINT fk_0fd5b22688 FOREIGN KEY (pages_deployment_id) REFERENCES pages_deployments(id) ON DELETE SET NULL; +ALTER TABLE ONLY status_check_responses + ADD CONSTRAINT fk_116e7e7369 FOREIGN KEY (external_approval_rule_id) REFERENCES external_approval_rules(id) ON DELETE CASCADE; + ALTER TABLE ONLY group_deletion_schedules ADD CONSTRAINT fk_11e3ebfcdd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -24598,6 +26242,9 @@ ALTER TABLE ONLY project_features ALTER TABLE ONLY ci_pipelines ADD CONSTRAINT fk_190998ef09 FOREIGN KEY (external_pull_request_id) REFERENCES external_pull_requests(id) ON DELETE SET NULL; +ALTER TABLE ONLY analytics_devops_adoption_segments + ADD CONSTRAINT fk_190a24754d FOREIGN KEY (display_namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY user_details ADD CONSTRAINT fk_190e4fcc88 FOREIGN KEY (provisioned_by_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; @@ -24649,6 +26296,9 @@ ALTER TABLE ONLY notes ALTER TABLE ONLY members ADD CONSTRAINT fk_2e88fb7ce9 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY lfs_objects_projects + ADD CONSTRAINT fk_2eb33f7a78 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE NOT VALID; + ALTER TABLE ONLY lists ADD CONSTRAINT fk_30f2a831f4 FOREIGN KEY (iteration_id) REFERENCES sprints(id) ON DELETE CASCADE; @@ -24658,15 +26308,15 @@ ALTER TABLE ONLY approvals ALTER TABLE ONLY namespaces ADD CONSTRAINT fk_319256d87a FOREIGN KEY (file_template_project_id) REFERENCES projects(id) ON DELETE SET NULL; -ALTER TABLE ONLY merge_requests - ADD CONSTRAINT fk_3308fe130c FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE SET NULL; - ALTER TABLE ONLY ci_group_variables ADD CONSTRAINT fk_33ae4d58d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY namespaces ADD CONSTRAINT fk_3448c97865 FOREIGN KEY (push_rule_id) REFERENCES push_rules(id) ON DELETE SET NULL; +ALTER TABLE ONLY in_product_marketing_emails + ADD CONSTRAINT fk_35c9101b63 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY epics ADD CONSTRAINT fk_3654b61b03 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; @@ -24676,11 +26326,14 @@ ALTER TABLE ONLY sprints ALTER TABLE ONLY push_event_payloads ADD CONSTRAINT fk_36c74129da FOREIGN KEY (event_id) REFERENCES events(id) ON DELETE CASCADE; +ALTER TABLE ONLY bulk_import_exports + ADD CONSTRAINT fk_39c726d3b5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_builds ADD CONSTRAINT fk_3a9eaa254d FOREIGN KEY (stage_id) REFERENCES ci_stages(id) ON DELETE CASCADE; ALTER TABLE ONLY issues - ADD CONSTRAINT fk_3b8c72ea56 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE CASCADE; + ADD CONSTRAINT fk_3b8c72ea56 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE SET NULL; ALTER TABLE ONLY epics ADD CONSTRAINT fk_3c1fd1cccc FOREIGN KEY (due_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; @@ -24715,6 +26368,12 @@ ALTER TABLE ONLY alert_management_alerts ALTER TABLE ONLY path_locks ADD CONSTRAINT fk_5265c98f24 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY dast_site_profiles_pipelines + ADD CONSTRAINT fk_53849b0ad5 FOREIGN KEY (ci_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + +ALTER TABLE ONLY terraform_states + ADD CONSTRAINT fk_558901b030 FOREIGN KEY (locked_by_user_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY merge_request_metrics ADD CONSTRAINT fk_56067dcb44 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -24796,9 +26455,15 @@ ALTER TABLE ONLY users ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_78a6492f68 FOREIGN KEY (repository_updated_event_id) REFERENCES geo_repository_updated_events(id) ON DELETE CASCADE; +ALTER TABLE ONLY analytics_devops_adoption_snapshots + ADD CONSTRAINT fk_78c9eac821 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY lists ADD CONSTRAINT fk_7a5553d60f FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_unit_tests + ADD CONSTRAINT fk_7a8fabf0a8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY protected_branches ADD CONSTRAINT fk_7a9c6d93e7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -24812,7 +26477,7 @@ ALTER TABLE ONLY labels ADD CONSTRAINT fk_7de4989a69 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY merge_requests - ADD CONSTRAINT fk_7e85395a64 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE CASCADE; + ADD CONSTRAINT fk_7e85395a64 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE SET NULL; ALTER TABLE ONLY merge_request_metrics ADD CONSTRAINT fk_7f28d925f3 FOREIGN KEY (merged_by_id) REFERENCES users(id) ON DELETE SET NULL; @@ -24829,6 +26494,9 @@ ALTER TABLE ONLY import_export_uploads ALTER TABLE ONLY push_rules ADD CONSTRAINT fk_83b29894de FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY experiment_subjects + ADD CONSTRAINT fk_842649f2f5 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_request_diffs ADD CONSTRAINT fk_8483f3258f FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; @@ -24844,9 +26512,6 @@ ALTER TABLE ONLY packages_package_files ALTER TABLE ONLY ci_builds ADD CONSTRAINT fk_87f4cefcda FOREIGN KEY (upstream_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; -ALTER TABLE ONLY experiment_subjects - ADD CONSTRAINT fk_88489af1b1 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; - ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_88b4d546ef FOREIGN KEY (start_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; @@ -24859,8 +26524,8 @@ ALTER TABLE ONLY issues ALTER TABLE ONLY protected_branch_merge_access_levels ADD CONSTRAINT fk_8a3072ccb3 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE; -ALTER TABLE ONLY timelogs - ADD CONSTRAINT fk_8d058cd571 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; +ALTER TABLE ONLY bulk_import_exports + ADD CONSTRAINT fk_8c6f33cebe FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY releases ADD CONSTRAINT fk_8e4456f90f FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -24913,6 +26578,9 @@ ALTER TABLE ONLY issues ALTER TABLE ONLY epics ADD CONSTRAINT fk_9d480c64b2 FOREIGN KEY (start_date_sourcing_epic_id) REFERENCES epics(id) ON DELETE SET NULL; +ALTER TABLE ONLY protected_environments + ADD CONSTRAINT fk_9e112565b7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY alert_management_alerts ADD CONSTRAINT fk_9e49e5c2b7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -24946,6 +26614,12 @@ ALTER TABLE ONLY bulk_import_entities ALTER TABLE ONLY users ADD CONSTRAINT fk_a4b8fefe3e FOREIGN KEY (managing_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; +ALTER TABLE ONLY lfs_objects_projects + ADD CONSTRAINT fk_a56e02279c FOREIGN KEY (lfs_object_id) REFERENCES lfs_objects(id) ON DELETE RESTRICT NOT VALID; + +ALTER TABLE ONLY dast_profiles_pipelines + ADD CONSTRAINT fk_a60cad829d FOREIGN KEY (ci_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_a6963e8447 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -25036,6 +26710,9 @@ ALTER TABLE ONLY geo_event_log ALTER TABLE ONLY vulnerability_exports ADD CONSTRAINT fk_c3d3cb5d0f FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY timelogs + ADD CONSTRAINT fk_c49c83dd77 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_c4b1c1f66e FOREIGN KEY (repository_deleted_event_id) REFERENCES geo_repository_deleted_events(id) ON DELETE CASCADE; @@ -25051,12 +26728,18 @@ ALTER TABLE ONLY external_approval_rules_protected_branches ALTER TABLE ONLY external_approval_rules_protected_branches ADD CONSTRAINT fk_ca2ffb55e6 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE; +ALTER TABLE ONLY dast_profiles_pipelines + ADD CONSTRAINT fk_cc206a8c13 FOREIGN KEY (dast_profile_id) REFERENCES dast_profiles(id) ON DELETE CASCADE; + ALTER TABLE ONLY experiment_subjects ADD CONSTRAINT fk_ccc28f8ceb FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY todos ADD CONSTRAINT fk_ccf0373936 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY dast_site_profiles_pipelines + ADD CONSTRAINT fk_cf05cf8fe1 FOREIGN KEY (dast_site_profile_id) REFERENCES dast_site_profiles(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_cff7185ad2 FOREIGN KEY (reset_checksum_event_id) REFERENCES geo_reset_checksum_events(id) ON DELETE CASCADE; @@ -25073,7 +26756,7 @@ ALTER TABLE ONLY ci_builds ADD CONSTRAINT fk_d3130c9a7f FOREIGN KEY (commit_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; ALTER TABLE ONLY web_hooks - ADD CONSTRAINT fk_d47999a98a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE NOT VALID; + ADD CONSTRAINT fk_d47999a98a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_sources_pipelines ADD CONSTRAINT fk_d4e29af7d7 FOREIGN KEY (source_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; @@ -25108,9 +26791,6 @@ ALTER TABLE ONLY dependency_proxy_blobs ALTER TABLE ONLY epics ADD CONSTRAINT fk_dccd3f98fc FOREIGN KEY (assignee_id) REFERENCES users(id) ON DELETE SET NULL; -ALTER TABLE ONLY analytics_devops_adoption_segment_selections - ADD CONSTRAINT fk_ded7fe0344 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; - ALTER TABLE ONLY issues ADD CONSTRAINT fk_df75a7c8b8 FOREIGN KEY (promoted_to_epic_id) REFERENCES epics(id) ON DELETE SET NULL; @@ -25150,6 +26830,9 @@ ALTER TABLE ONLY sprints ALTER TABLE ONLY application_settings ADD CONSTRAINT fk_e8a145f3a7 FOREIGN KEY (instance_administrators_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; +ALTER TABLE ONLY vulnerability_statistics + ADD CONSTRAINT fk_e8b13c928f FOREIGN KEY (latest_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; + ALTER TABLE ONLY ci_triggers ADD CONSTRAINT fk_e8e10d1964 FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE; @@ -25180,9 +26863,6 @@ ALTER TABLE ONLY vulnerability_external_issue_links ALTER TABLE ONLY epics ADD CONSTRAINT fk_f081aa4489 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY analytics_devops_adoption_segment_selections - ADD CONSTRAINT fk_f1472b95f3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; - ALTER TABLE ONLY boards ADD CONSTRAINT fk_f15266b5f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -25192,6 +26872,9 @@ ALTER TABLE ONLY jira_connect_subscriptions ALTER TABLE ONLY ci_pipeline_variables ADD CONSTRAINT fk_f29c5f4380 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; +ALTER TABLE ONLY status_check_responses + ADD CONSTRAINT fk_f3953d86c6 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + ALTER TABLE ONLY design_management_designs_versions ADD CONSTRAINT fk_f4d25ba00c FOREIGN KEY (version_id) REFERENCES design_management_versions(id) ON DELETE CASCADE; @@ -25273,9 +26956,6 @@ ALTER TABLE ONLY ip_restrictions ALTER TABLE ONLY terraform_state_versions ADD CONSTRAINT fk_rails_04f176e239 FOREIGN KEY (terraform_state_id) REFERENCES terraform_states(id) ON DELETE CASCADE; -ALTER TABLE ONLY analytics_devops_adoption_segment_selections - ADD CONSTRAINT fk_rails_053f00a9da FOREIGN KEY (segment_id) REFERENCES analytics_devops_adoption_segments(id) ON DELETE CASCADE; - ALTER TABLE ONLY ci_build_report_results ADD CONSTRAINT fk_rails_056d298d48 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -25381,6 +27061,12 @@ ALTER TABLE ONLY analytics_cycle_analytics_project_stages ALTER TABLE ONLY packages_build_infos ADD CONSTRAINT fk_rails_17a9a0dffc FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; +ALTER TABLE ONLY security_orchestration_policy_rule_schedules + ADD CONSTRAINT fk_rails_17ade83f17 FOREIGN KEY (security_orchestration_policy_configuration_id) REFERENCES security_orchestration_policy_configurations(id) ON DELETE CASCADE; + +ALTER TABLE ONLY incident_management_escalation_rules + ADD CONSTRAINT fk_rails_17dbea07a6 FOREIGN KEY (policy_id) REFERENCES incident_management_escalation_policies(id) ON DELETE CASCADE; + ALTER TABLE ONLY clusters_applications_jupyter ADD CONSTRAINT fk_rails_17df21c98c FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; @@ -25459,6 +27145,9 @@ ALTER TABLE ONLY service_desk_settings ALTER TABLE ONLY saml_group_links ADD CONSTRAINT fk_rails_22e312c530 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_responses + ADD CONSTRAINT fk_rails_2390a09723 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE; + ALTER TABLE ONLY dast_profiles ADD CONSTRAINT fk_rails_23cae5abe1 FOREIGN KEY (dast_scanner_profile_id) REFERENCES dast_scanner_profiles(id) ON DELETE CASCADE; @@ -25468,6 +27157,9 @@ ALTER TABLE ONLY group_custom_attributes ALTER TABLE ONLY incident_management_oncall_rotations ADD CONSTRAINT fk_rails_256e0bc604 FOREIGN KEY (oncall_schedule_id) REFERENCES incident_management_oncall_schedules(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_unit_test_failures + ADD CONSTRAINT fk_rails_259da3e79c FOREIGN KEY (unit_test_id) REFERENCES ci_unit_tests(id) ON DELETE CASCADE; + ALTER TABLE ONLY analytics_devops_adoption_snapshots ADD CONSTRAINT fk_rails_25da9a92c0 FOREIGN KEY (segment_id) REFERENCES analytics_devops_adoption_segments(id) ON DELETE CASCADE; @@ -25486,6 +27178,9 @@ ALTER TABLE ONLY lfs_file_locks ALTER TABLE ONLY project_alerting_settings ADD CONSTRAINT fk_rails_27a84b407d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY user_credit_card_validations + ADD CONSTRAINT fk_rails_27ebc03cbf FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY dast_site_validations ADD CONSTRAINT fk_rails_285c617324 FOREIGN KEY (dast_site_token_id) REFERENCES dast_site_tokens(id) ON DELETE CASCADE; @@ -25564,6 +27259,9 @@ ALTER TABLE ONLY metrics_dashboard_annotations ALTER TABLE ONLY wiki_page_slugs ADD CONSTRAINT fk_rails_358b46be14 FOREIGN KEY (wiki_page_meta_id) REFERENCES wiki_page_meta(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_job_token_project_scope_links + ADD CONSTRAINT fk_rails_35f7f506ce FOREIGN KEY (added_by_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY board_labels ADD CONSTRAINT fk_rails_362b0600a3 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; @@ -25579,6 +27277,9 @@ ALTER TABLE ONLY group_merge_request_approval_settings ALTER TABLE ONLY analytics_cycle_analytics_project_stages ADD CONSTRAINT fk_rails_3829e49b66 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_debian_project_distribution_keys + ADD CONSTRAINT fk_rails_3834a11264 FOREIGN KEY (distribution_id) REFERENCES packages_debian_project_distributions(id) ON DELETE CASCADE; + ALTER TABLE ONLY issue_user_mentions ADD CONSTRAINT fk_rails_3861d9fefa FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; @@ -25660,6 +27361,9 @@ ALTER TABLE ONLY remote_mirrors ALTER TABLE ONLY lfs_file_locks ADD CONSTRAINT fk_rails_43df7a0412 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY dast_site_profile_secret_variables + ADD CONSTRAINT fk_rails_43e2897950 FOREIGN KEY (dast_site_profile_id) REFERENCES dast_site_profiles(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_request_assignees ADD CONSTRAINT fk_rails_443443ce6f FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; @@ -25687,9 +27391,18 @@ ALTER TABLE ONLY vulnerability_feedback ALTER TABLE ONLY user_custom_attributes ADD CONSTRAINT fk_rails_47b91868a8 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_pending_builds + ADD CONSTRAINT fk_rails_480669c3b3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY upcoming_reconciliations + ADD CONSTRAINT fk_rails_497b4938ac FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_pipeline_artifacts ADD CONSTRAINT fk_rails_4a70390ca6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_job_token_project_scope_links + ADD CONSTRAINT fk_rails_4b2ee3290b FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY group_deletion_schedules ADD CONSTRAINT fk_rails_4b8c694a6c FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -25762,9 +27475,6 @@ ALTER TABLE ONLY clusters_applications_knative ALTER TABLE ONLY clusters_applications_prometheus ADD CONSTRAINT fk_rails_557e773639 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; -ALTER TABLE ONLY terraform_states - ADD CONSTRAINT fk_rails_558901b030 FOREIGN KEY (locked_by_user_id) REFERENCES users(id); - ALTER TABLE ONLY issuable_metric_images ADD CONSTRAINT fk_rails_56417a5a7f FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -25819,6 +27529,9 @@ ALTER TABLE ONLY vulnerability_scanners ALTER TABLE ONLY reviews ADD CONSTRAINT fk_rails_5ca11d8c31 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_running_builds + ADD CONSTRAINT fk_rails_5ca491d360 FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE CASCADE; + ALTER TABLE ONLY epic_issues ADD CONSTRAINT fk_rails_5d942936b4 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; @@ -25888,9 +27601,12 @@ ALTER TABLE ONLY operations_feature_flags_clients ALTER TABLE ONLY namespace_admin_notes ADD CONSTRAINT fk_rails_666166ea7b FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY web_hook_logs +ALTER TABLE ONLY web_hook_logs_archived ADD CONSTRAINT fk_rails_666826e111 FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE; +ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams + ADD CONSTRAINT fk_rails_669f4ba293 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY jira_imports ADD CONSTRAINT fk_rails_675d38c03b FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE SET NULL; @@ -25900,9 +27616,15 @@ ALTER TABLE ONLY vulnerability_findings_remediations ALTER TABLE ONLY resource_iteration_events ADD CONSTRAINT fk_rails_6830c13ac1 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_headers + ADD CONSTRAINT fk_rails_683b8e000c FOREIGN KEY (vulnerability_finding_evidence_response_id) REFERENCES vulnerability_finding_evidence_responses(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_hashed_storage_migrated_events ADD CONSTRAINT fk_rails_687ed7d7c5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_job_token_project_scope_links + ADD CONSTRAINT fk_rails_6904b38465 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY plan_limits ADD CONSTRAINT fk_rails_69f8b6184f FOREIGN KEY (plan_id) REFERENCES plans(id) ON DELETE CASCADE; @@ -25936,6 +27658,9 @@ ALTER TABLE ONLY project_custom_attributes ALTER TABLE ONLY user_interacted_projects ADD CONSTRAINT fk_rails_722ceba4f7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_pending_builds + ADD CONSTRAINT fk_rails_725a2644a3 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + ALTER TABLE ONLY security_findings ADD CONSTRAINT fk_rails_729b763a54 FOREIGN KEY (scanner_id) REFERENCES vulnerability_scanners(id) ON DELETE CASCADE; @@ -25945,6 +27670,9 @@ ALTER TABLE ONLY dast_scanner_profiles ALTER TABLE ONLY vulnerability_historical_statistics ADD CONSTRAINT fk_rails_72b73ed023 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_requests + ADD CONSTRAINT fk_rails_72c87c8eb6 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE; + ALTER TABLE ONLY slack_integrations ADD CONSTRAINT fk_rails_73db19721a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE; @@ -25987,12 +27715,18 @@ ALTER TABLE ONLY packages_debian_publications ALTER TABLE ONLY boards_epic_user_preferences ADD CONSTRAINT fk_rails_76c4e9732d FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_debian_group_distribution_keys + ADD CONSTRAINT fk_rails_779438f163 FOREIGN KEY (distribution_id) REFERENCES packages_debian_group_distributions(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_subscriptions_projects ADD CONSTRAINT fk_rails_7871f9a97b FOREIGN KEY (upstream_project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY terraform_states ADD CONSTRAINT fk_rails_78f54ca485 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY analytics_cycle_analytics_project_stages + ADD CONSTRAINT fk_rails_796a7dbc9c FOREIGN KEY (project_value_stream_id) REFERENCES analytics_cycle_analytics_project_value_streams(id) ON DELETE CASCADE; + ALTER TABLE ONLY software_license_policies ADD CONSTRAINT fk_rails_7a7a2a92de FOREIGN KEY (software_license_id) REFERENCES software_licenses(id) ON DELETE CASCADE; @@ -26134,6 +27868,9 @@ ALTER TABLE ONLY packages_rubygems_metadata ALTER TABLE ONLY packages_pypi_metadata ADD CONSTRAINT fk_rails_9698717cdd FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; +ALTER TABLE ONLY boards_epic_board_recent_visits + ADD CONSTRAINT fk_rails_96c2c18642 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY packages_dependency_links ADD CONSTRAINT fk_rails_96ef1c00d3 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; @@ -26176,6 +27913,9 @@ ALTER TABLE ONLY analytics_language_trend_repository_languages ALTER TABLE ONLY badges ADD CONSTRAINT fk_rails_9df4a56538 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_signatures + ADD CONSTRAINT fk_rails_9e0baf9dcd FOREIGN KEY (finding_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; + ALTER TABLE ONLY clusters_applications_cert_managers ADD CONSTRAINT fk_rails_9e4f2cb4b2 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; @@ -26185,6 +27925,9 @@ ALTER TABLE ONLY resource_milestone_events ALTER TABLE ONLY namespace_root_storage_statistics ADD CONSTRAINT fk_rails_a0702c430b FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY elastic_reindexing_slices + ADD CONSTRAINT fk_rails_a17d86aeb9 FOREIGN KEY (elastic_reindexing_subtask_id) REFERENCES elastic_reindexing_subtasks(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_aliases ADD CONSTRAINT fk_rails_a1804f74a7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -26203,6 +27946,9 @@ ALTER TABLE ONLY fork_network_members ALTER TABLE ONLY operations_feature_flag_scopes ADD CONSTRAINT fk_rails_a50a04d0a4 FOREIGN KEY (feature_flag_id) REFERENCES operations_feature_flags(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_helm_file_metadata + ADD CONSTRAINT fk_rails_a559865345 FOREIGN KEY (package_file_id) REFERENCES packages_package_files(id) ON DELETE CASCADE; + ALTER TABLE ONLY cluster_projects ADD CONSTRAINT fk_rails_a5a958bca1 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; @@ -26293,6 +28039,9 @@ ALTER TABLE ONLY issues_prometheus_alert_events ALTER TABLE ONLY merge_trains ADD CONSTRAINT fk_rails_b374b5225d FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY incident_management_escalation_rules + ADD CONSTRAINT fk_rails_b3c9c17bd4 FOREIGN KEY (oncall_schedule_id) REFERENCES incident_management_oncall_schedules(id) ON DELETE CASCADE; + ALTER TABLE ONLY application_settings ADD CONSTRAINT fk_rails_b53e481273 FOREIGN KEY (custom_project_templates_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; @@ -26317,6 +28066,9 @@ ALTER TABLE ONLY approval_project_rules_users ALTER TABLE ONLY lists ADD CONSTRAINT fk_rails_baed5f39b7 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE CASCADE; +ALTER TABLE web_hook_logs + ADD CONSTRAINT fk_rails_bb3355782d FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE; + ALTER TABLE ONLY security_findings ADD CONSTRAINT fk_rails_bb63863cf1 FOREIGN KEY (scan_id) REFERENCES security_scans(id) ON DELETE CASCADE; @@ -26380,6 +28132,9 @@ ALTER TABLE ONLY pages_deployments ALTER TABLE ONLY merge_request_user_mentions ADD CONSTRAINT fk_rails_c440b9ea31 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; +ALTER TABLE ONLY boards_epic_board_recent_visits + ADD CONSTRAINT fk_rails_c4dcba4a3e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_job_artifacts ADD CONSTRAINT fk_rails_c5137cb2c1 FOREIGN KEY (job_id) REFERENCES ci_builds(id) ON DELETE CASCADE; @@ -26422,6 +28177,9 @@ ALTER TABLE ONLY boards_epic_board_positions ALTER TABLE ONLY vulnerability_finding_links ADD CONSTRAINT fk_rails_cbdfde27ce FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; +ALTER TABLE ONLY clusters_integration_elasticstack + ADD CONSTRAINT fk_rails_cc5ba8f658 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + ALTER TABLE ONLY issues_self_managed_prometheus_alert_events ADD CONSTRAINT fk_rails_cc5d88bbb0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -26431,6 +28189,9 @@ ALTER TABLE ONLY operations_strategies_user_lists ALTER TABLE ONLY issue_tracker_data ADD CONSTRAINT fk_rails_ccc0840427 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_headers + ADD CONSTRAINT fk_rails_ce7f121a03 FOREIGN KEY (vulnerability_finding_evidence_request_id) REFERENCES vulnerability_finding_evidence_requests(id) ON DELETE CASCADE; + ALTER TABLE ONLY resource_milestone_events ADD CONSTRAINT fk_rails_cedf8cce4d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -26458,6 +28219,9 @@ ALTER TABLE ONLY requirements_management_test_reports ALTER TABLE ONLY pool_repositories ADD CONSTRAINT fk_rails_d2711daad4 FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE SET NULL; +ALTER TABLE ONLY web_hooks + ADD CONSTRAINT fk_rails_d35697648e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY group_group_links ADD CONSTRAINT fk_rails_d3a0488427 FOREIGN KEY (shared_group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -26473,6 +28237,9 @@ ALTER TABLE ONLY geo_hashed_storage_attachments_events ALTER TABLE ONLY merge_request_reviewers ADD CONSTRAINT fk_rails_d9fec24b9d FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_running_builds + ADD CONSTRAINT fk_rails_da45cfa165 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + ALTER TABLE ONLY jira_imports ADD CONSTRAINT fk_rails_da617096ce FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -26482,6 +28249,9 @@ ALTER TABLE ONLY issues_prometheus_alert_events ALTER TABLE ONLY board_user_preferences ADD CONSTRAINT fk_rails_dbebdaa8fe FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_running_builds + ADD CONSTRAINT fk_rails_dc1d0801e8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_occurrence_pipelines ADD CONSTRAINT fk_rails_dc3ae04693 FOREIGN KEY (occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; @@ -26506,6 +28276,12 @@ ALTER TABLE ONLY incident_management_oncall_shifts ALTER TABLE ONLY analytics_cycle_analytics_group_stages ADD CONSTRAINT fk_rails_dfb37c880d FOREIGN KEY (end_event_label_id) REFERENCES labels(id) ON DELETE CASCADE; +ALTER TABLE ONLY bulk_import_export_uploads + ADD CONSTRAINT fk_rails_dfbfb45eca FOREIGN KEY (export_id) REFERENCES bulk_import_exports(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_minutes_additional_packs + ADD CONSTRAINT fk_rails_e0e0c4e4b1 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY label_priorities ADD CONSTRAINT fk_rails_e161058b0f FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; @@ -26518,12 +28294,21 @@ ALTER TABLE ONLY cluster_platforms_kubernetes ALTER TABLE ONLY ci_builds_metadata ADD CONSTRAINT fk_rails_e20479742e FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidences + ADD CONSTRAINT fk_rails_e3205a0c65 FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters_integration_prometheus + ADD CONSTRAINT fk_rails_e44472034c FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_occurrence_identifiers ADD CONSTRAINT fk_rails_e4ef6d027c FOREIGN KEY (occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; ALTER TABLE ONLY serverless_domain_cluster ADD CONSTRAINT fk_rails_e59e868733 FOREIGN KEY (clusters_applications_knative_id) REFERENCES clusters_applications_knative(id) ON DELETE CASCADE; +ALTER TABLE ONLY incident_management_escalation_policies + ADD CONSTRAINT fk_rails_e5b513daa7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_external_issue_links ADD CONSTRAINT fk_rails_e5ba7f7b13 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -26545,6 +28330,9 @@ ALTER TABLE ONLY draft_notes ALTER TABLE ONLY namespace_package_settings ADD CONSTRAINT fk_rails_e773444769 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY boards_epic_board_recent_visits + ADD CONSTRAINT fk_rails_e77911cf03 FOREIGN KEY (epic_board_id) REFERENCES boards_epic_boards(id) ON DELETE CASCADE; + ALTER TABLE ONLY dast_site_tokens ADD CONSTRAINT fk_rails_e84f721a8e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -26599,6 +28387,9 @@ ALTER TABLE ONLY label_priorities ALTER TABLE ONLY fork_network_members ADD CONSTRAINT fk_rails_efccadc4ec FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY security_orchestration_policy_rule_schedules + ADD CONSTRAINT fk_rails_efe1d9b133 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY prometheus_alerts ADD CONSTRAINT fk_rails_f0e8db86aa FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -26656,9 +28447,6 @@ ALTER TABLE ONLY merge_trains ALTER TABLE ONLY ci_runner_namespaces ADD CONSTRAINT fk_rails_f9d9ed3308 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY vulnerability_finding_fingerprints - ADD CONSTRAINT fk_rails_fa411253b2 FOREIGN KEY (finding_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; - ALTER TABLE ONLY requirements_management_test_reports ADD CONSTRAINT fk_rails_fb3308ad55 FOREIGN KEY (requirement_id) REFERENCES requirements(id) ON DELETE CASCADE; @@ -26698,12 +28486,18 @@ ALTER TABLE ONLY ci_builds_metadata ALTER TABLE ONLY services ADD CONSTRAINT fk_services_inherit_from_id FOREIGN KEY (inherit_from_id) REFERENCES services(id) ON DELETE CASCADE; +ALTER TABLE ONLY merge_requests + ADD CONSTRAINT fk_source_project FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE SET NULL; + ALTER TABLE ONLY timelogs ADD CONSTRAINT fk_timelogs_issues_issue_id FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; ALTER TABLE ONLY timelogs ADD CONSTRAINT fk_timelogs_merge_requests_merge_request_id FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY timelogs + ADD CONSTRAINT fk_timelogs_note_id FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE SET NULL; + ALTER TABLE ONLY u2f_registrations ADD CONSTRAINT fk_u2f_registrations_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; diff --git a/db/migrate/20210302025305_add_excluded_urls_and_request_headers_to_dast_site_profiles.rb b/db/migrate/20210302025305_add_excluded_urls_and_request_headers_to_dast_site_profiles.rb deleted file mode 100644 index 167b8d2c509..00000000000 --- a/db/migrate/20210302025305_add_excluded_urls_and_request_headers_to_dast_site_profiles.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddExcludedUrlsAndRequestHeadersToDastSiteProfiles < ActiveRecord::Migration[6.0] - DOWNTIME = false - - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20210311022012_add_text_limits_to_dast_site_profiles - def change - add_column :dast_site_profiles, :excluded_urls, :text, array: true, default: [], null: false - add_column :dast_site_profiles, :auth_enabled, :boolean, default: false, null: false - add_column :dast_site_profiles, :auth_url, :text - add_column :dast_site_profiles, :auth_username_field, :text - add_column :dast_site_profiles, :auth_password_field, :text - add_column :dast_site_profiles, :auth_username, :text - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20210302103851_add_deployed_deployment_id_index_to_project_pages_metadata.rb b/db/migrate/20210302103851_add_deployed_deployment_id_index_to_project_pages_metadata.rb deleted file mode 100644 index e10e9a912cc..00000000000 --- a/db/migrate/20210302103851_add_deployed_deployment_id_index_to_project_pages_metadata.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddDeployedDeploymentIdIndexToProjectPagesMetadata < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_NAME = 'index_on_pages_metadata_not_migrated' - - def up - add_concurrent_index :project_pages_metadata, :project_id, where: "deployed = TRUE AND pages_deployment_id is NULL", name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :project_pages_metadata, INDEX_NAME - end -end diff --git a/db/migrate/20210302155904_remove_index_for_security_orchestration_policy.rb b/db/migrate/20210302155904_remove_index_for_security_orchestration_policy.rb deleted file mode 100644 index 5d2594f2b9e..00000000000 --- a/db/migrate/20210302155904_remove_index_for_security_orchestration_policy.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class RemoveIndexForSecurityOrchestrationPolicy < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_sop_configs_on_security_policy_management_project_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name(:security_orchestration_policy_configurations, INDEX_NAME) - end - - def down - add_concurrent_index(:security_orchestration_policy_configurations, :security_policy_management_project_id, name: INDEX_NAME) - end -end diff --git a/db/migrate/20210302160544_add_index_to_security_orchestration_policy.rb b/db/migrate/20210302160544_add_index_to_security_orchestration_policy.rb deleted file mode 100644 index 4750e2bdb79..00000000000 --- a/db/migrate/20210302160544_add_index_to_security_orchestration_policy.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToSecurityOrchestrationPolicy < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX = 'index_sop_configurations_project_id_policy_project_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :security_orchestration_policy_configurations, [:security_policy_management_project_id, :project_id], name: INDEX - end - - def down - remove_concurrent_index_by_name :security_orchestration_policy_configurations, INDEX - end -end diff --git a/db/migrate/20210302212623_rename_vuln_fingerprints_indexes.rb b/db/migrate/20210302212623_rename_vuln_fingerprints_indexes.rb deleted file mode 100644 index 0f431fbeda5..00000000000 --- a/db/migrate/20210302212623_rename_vuln_fingerprints_indexes.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -class RenameVulnFingerprintsIndexes < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - FINGERPRINT_IDX = :idx_vuln_fingerprints_on_occurrences_id_and_fingerprint - FINGERPRINT_IDX_RENAMED = :idx_vuln_fingerprints_on_occurrences_id_and_fingerprint_sha256 - UNIQ_IDX = :idx_vuln_fingerprints_uniqueness - UNIQ_IDX_RENAMED = :idx_vuln_fingerprints_uniqueness_fingerprint_sha256 - - disable_ddl_transaction! - - def up - # These `unless` checks are necessary for re-running the migrations multiple times - unless index_exists_by_name?(:vulnerability_finding_fingerprints, FINGERPRINT_IDX_RENAMED) - rename_index :vulnerability_finding_fingerprints, FINGERPRINT_IDX, FINGERPRINT_IDX_RENAMED - end - - unless index_exists_by_name?(:vulnerability_finding_fingerprints, UNIQ_IDX_RENAMED) - rename_index :vulnerability_finding_fingerprints, UNIQ_IDX, UNIQ_IDX_RENAMED - end - end - - def down - unless index_exists_by_name?(:vulnerability_finding_fingerprints, FINGERPRINT_IDX) - rename_index :vulnerability_finding_fingerprints, FINGERPRINT_IDX_RENAMED, FINGERPRINT_IDX - end - - unless index_exists_by_name?(:vulnerability_finding_fingerprints, UNIQ_IDX) - rename_index :vulnerability_finding_fingerprints, UNIQ_IDX_RENAMED, UNIQ_IDX - end - end -end diff --git a/db/migrate/20210303053341_add_last_edited_at_and_last_edited_by_id_to_notes.rb b/db/migrate/20210303053341_add_last_edited_at_and_last_edited_by_id_to_notes.rb deleted file mode 100644 index b6f4da202fa..00000000000 --- a/db/migrate/20210303053341_add_last_edited_at_and_last_edited_by_id_to_notes.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddLastEditedAtAndLastEditedByIdToNotes < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - with_lock_retries do - add_column :notes, :last_edited_at, :datetime_with_timezone - end - end - - def down - with_lock_retries do - remove_column :notes, :last_edited_at - end - end -end diff --git a/db/migrate/20210303091651_add_index_to_environments_tier.rb b/db/migrate/20210303091651_add_index_to_environments_tier.rb deleted file mode 100644 index 0ec876945d9..00000000000 --- a/db/migrate/20210303091651_add_index_to_environments_tier.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToEnvironmentsTier < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_environments_on_project_id_and_tier' - - DOWNTIME = false - - def up - add_concurrent_index :environments, [:project_id, :tier], where: 'tier IS NOT NULL', name: INDEX_NAME - end - - def down - remove_concurrent_index :environments, :state, name: INDEX_NAME - end -end diff --git a/db/migrate/20210303165201_add_index_for_succeeded_deployments.rb b/db/migrate/20210303165201_add_index_for_succeeded_deployments.rb deleted file mode 100644 index 1ae5b36d2f2..00000000000 --- a/db/migrate/20210303165201_add_index_for_succeeded_deployments.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexForSucceededDeployments < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_deployments_on_environment_id_status_and_finished_at' - - disable_ddl_transaction! - - def up - add_concurrent_index(:deployments, %i[environment_id status finished_at], name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:deployments, INDEX_NAME) - end -end diff --git a/db/migrate/20210303165301_add_not_null_constraint_to_cluster_token_name.rb b/db/migrate/20210303165301_add_not_null_constraint_to_cluster_token_name.rb deleted file mode 100644 index 5fc8970b8f9..00000000000 --- a/db/migrate/20210303165301_add_not_null_constraint_to_cluster_token_name.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddNotNullConstraintToClusterTokenName < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - # This will add the `NOT NULL` constraint WITHOUT validating it - add_not_null_constraint :cluster_agent_tokens, :name, validate: false - end - - def down - remove_not_null_constraint :cluster_agent_tokens, :name - end -end diff --git a/db/migrate/20210303193544_add_concurrent_fields_to_bulk_imports_trackers.rb b/db/migrate/20210303193544_add_concurrent_fields_to_bulk_imports_trackers.rb deleted file mode 100644 index a2d3d6daf09..00000000000 --- a/db/migrate/20210303193544_add_concurrent_fields_to_bulk_imports_trackers.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddConcurrentFieldsToBulkImportsTrackers < ActiveRecord::Migration[6.0] - DOWNTIME = false - - # rubocop:disable Migration/AddLimitToTextColumns - # rubocop:disable Rails/NotNullColumn - def up - add_column :bulk_import_trackers, :jid, :text - add_column :bulk_import_trackers, :stage, :smallint, default: 0, null: false - add_column :bulk_import_trackers, :status, :smallint, default: 0, null: false - end - # rubocop:enable Migration/AddLimitToTextColumns - # rubocop:enable Rails/NotNullColumn - - def down - remove_column :bulk_import_trackers, :jid, :text - remove_column :bulk_import_trackers, :stage, :smallint - remove_column :bulk_import_trackers, :status, :smallint - end -end diff --git a/db/migrate/20210303193605_add_text_limits_to_bulk_imports_trackers_jid_and_pipeline_name.rb b/db/migrate/20210303193605_add_text_limits_to_bulk_imports_trackers_jid_and_pipeline_name.rb deleted file mode 100644 index 7686dd0343b..00000000000 --- a/db/migrate/20210303193605_add_text_limits_to_bulk_imports_trackers_jid_and_pipeline_name.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitsToBulkImportsTrackersJidAndPipelineName < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_text_limit :bulk_import_trackers, :jid, 255 - end - - def down - remove_text_limit :bulk_import_trackers, :jid - end -end diff --git a/db/migrate/20210305002016_update_terraform_states_locked_by_user_id_foreign_key.rb b/db/migrate/20210305002016_update_terraform_states_locked_by_user_id_foreign_key.rb deleted file mode 100644 index aa4a4e9c928..00000000000 --- a/db/migrate/20210305002016_update_terraform_states_locked_by_user_id_foreign_key.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class UpdateTerraformStatesLockedByUserIdForeignKey < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - OLD_FOREIGN_KEY = 'fk_rails_558901b030' - NEW_FOREIGN_KEY = 'fk_558901b030' - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :terraform_states, :users, - column: :locked_by_user_id, on_delete: :nullify, name: NEW_FOREIGN_KEY - - with_lock_retries do - remove_foreign_key :terraform_states, :users, name: OLD_FOREIGN_KEY - end - end - - def down - add_concurrent_foreign_key :terraform_states, :users, - column: :locked_by_user_id, on_delete: nil, name: OLD_FOREIGN_KEY - - with_lock_retries do - remove_foreign_key :terraform_states, :users, name: NEW_FOREIGN_KEY - end - end -end diff --git a/db/migrate/20210305013509_add_text_limit_to_group_ci_variables_environment_scope.rb b/db/migrate/20210305013509_add_text_limit_to_group_ci_variables_environment_scope.rb deleted file mode 100644 index f5fa073b954..00000000000 --- a/db/migrate/20210305013509_add_text_limit_to_group_ci_variables_environment_scope.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToGroupCiVariablesEnvironmentScope < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_text_limit :ci_group_variables, :environment_scope, 255 - end - - def down - remove_text_limit :ci_group_variables, :environment_scope - end -end diff --git a/db/migrate/20210305031822_create_dast_site_profile_variables.rb b/db/migrate/20210305031822_create_dast_site_profile_variables.rb deleted file mode 100644 index 4b8fc982d86..00000000000 --- a/db/migrate/20210305031822_create_dast_site_profile_variables.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -class CreateDastSiteProfileVariables < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - table_comment = { owner: 'group::dynamic analysis', description: 'Secret variables used in DAST on-demand scans' } - - encrypted_value_constraint_name = check_constraint_name(:dast_site_profile_secret_variables, 'encrypted_value', 'max_length') - encrypted_value_iv_constraint_name = check_constraint_name(:dast_site_profile_secret_variables, 'encrypted_value_iv', 'max_length') - - create_table_with_constraints :dast_site_profile_secret_variables, comment: Gitlab::Json.dump(table_comment) do |t| - t.references :dast_site_profile, null: false, foreign_key: { on_delete: :cascade }, index: false - - t.timestamps_with_timezone - - t.integer :variable_type, null: false, default: 1, limit: 2 - - t.text :key, null: false - t.binary :encrypted_value, null: false - t.binary :encrypted_value_iv, null: false, unique: true - - t.index [:dast_site_profile_id, :key], unique: true, name: :index_site_profile_secret_variables_on_site_profile_id_and_key - - t.text_limit :key, 255 - - # This does not currently have first-class support via create_table_with_constraints - t.check_constraint encrypted_value_constraint_name, 'length(encrypted_value) <= 13352' - t.check_constraint encrypted_value_iv_constraint_name, 'length(encrypted_value_iv) <= 17' - end - end - - def down - drop_table :dast_site_profile_secret_variables - end -end diff --git a/db/migrate/20210305145622_add_terraform_module_max_file_size_to_plan_limits.rb b/db/migrate/20210305145622_add_terraform_module_max_file_size_to_plan_limits.rb deleted file mode 100644 index d2342a66549..00000000000 --- a/db/migrate/20210305145622_add_terraform_module_max_file_size_to_plan_limits.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddTerraformModuleMaxFileSizeToPlanLimits < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :plan_limits, :terraform_module_max_file_size, :bigint, default: 1.gigabyte, null: false - end -end diff --git a/db/migrate/20210305180331_create_ci_unit_tests.rb b/db/migrate/20210305180331_create_ci_unit_tests.rb deleted file mode 100644 index 970834a025b..00000000000 --- a/db/migrate/20210305180331_create_ci_unit_tests.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class CreateCiUnitTests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - unless table_exists?(:ci_unit_tests) - create_table :ci_unit_tests do |t| - t.bigint :project_id, null: false - t.text :key_hash, null: false - t.text :name, null: false - t.text :suite_name, null: false - - t.index [:project_id, :key_hash], unique: true - # NOTE: FK for projects will be added on a separate migration as per guidelines - end - end - - add_text_limit :ci_unit_tests, :key_hash, 64 - add_text_limit :ci_unit_tests, :name, 255 - add_text_limit :ci_unit_tests, :suite_name, 255 - end - - def down - drop_table :ci_unit_tests - end -end diff --git a/db/migrate/20210305182740_add_projects_fk_to_ci_unit_tests.rb b/db/migrate/20210305182740_add_projects_fk_to_ci_unit_tests.rb deleted file mode 100644 index 5e750d78a24..00000000000 --- a/db/migrate/20210305182740_add_projects_fk_to_ci_unit_tests.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddProjectsFkToCiUnitTests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :ci_unit_tests, :projects, column: :project_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :ci_unit_tests, column: :project_id - end - end -end diff --git a/db/migrate/20210305182855_create_ci_unit_test_failures.rb b/db/migrate/20210305182855_create_ci_unit_test_failures.rb deleted file mode 100644 index b3f68cdba4a..00000000000 --- a/db/migrate/20210305182855_create_ci_unit_test_failures.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class CreateCiUnitTestFailures < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - create_table :ci_unit_test_failures do |t| - t.datetime_with_timezone :failed_at, null: false - t.bigint :unit_test_id, null: false - t.bigint :build_id, null: false - - t.index [:unit_test_id, :failed_at, :build_id], name: 'index_unit_test_failures_unique_columns', unique: true, order: { failed_at: :desc } - t.index :build_id - # NOTE: Adding the index for failed_at now for later use when we do scheduled clean up - t.index :failed_at, order: { failed_at: :desc }, name: 'index_unit_test_failures_failed_at' - t.foreign_key :ci_unit_tests, column: :unit_test_id, on_delete: :cascade - # NOTE: FK for ci_builds will be added on a separate migration as per guidelines - end - end - - def down - drop_table :ci_unit_test_failures - end -end diff --git a/db/migrate/20210305183904_add_ci_builds_fk_to_ci_unit_test_failures.rb b/db/migrate/20210305183904_add_ci_builds_fk_to_ci_unit_test_failures.rb deleted file mode 100644 index 9cf75ba6059..00000000000 --- a/db/migrate/20210305183904_add_ci_builds_fk_to_ci_unit_test_failures.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddCiBuildsFkToCiUnitTestFailures < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :ci_unit_test_failures, :ci_builds, column: :build_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :ci_unit_test_failures, column: :build_id - end - end -end diff --git a/db/migrate/20210306121300_partition_web_hook_logs.rb b/db/migrate/20210306121300_partition_web_hook_logs.rb deleted file mode 100644 index ff35a19648e..00000000000 --- a/db/migrate/20210306121300_partition_web_hook_logs.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class PartitionWebHookLogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - include Gitlab::Database::PartitioningMigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - partition_table_by_date :web_hook_logs, :created_at - end - - def down - drop_partitioned_table_for :web_hook_logs - end -end diff --git a/db/migrate/20210308125742_add_info_column_into_security_scans_table.rb b/db/migrate/20210308125742_add_info_column_into_security_scans_table.rb deleted file mode 100644 index d701fa98259..00000000000 --- a/db/migrate/20210308125742_add_info_column_into_security_scans_table.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddInfoColumnIntoSecurityScansTable < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :security_scans, :info, :jsonb, null: false, default: {} - end -end diff --git a/db/migrate/20210308175224_change_namespace_settings_delayed_project_removal_null.rb b/db/migrate/20210308175224_change_namespace_settings_delayed_project_removal_null.rb deleted file mode 100644 index 5b731b78117..00000000000 --- a/db/migrate/20210308175224_change_namespace_settings_delayed_project_removal_null.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class ChangeNamespaceSettingsDelayedProjectRemovalNull < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - change_column :namespace_settings, :delayed_project_removal, :boolean, null: true, default: nil - end - - def down - change_column_default :namespace_settings, :delayed_project_removal, false - change_column_null :namespace_settings, :delayed_project_removal, false, false - end -end diff --git a/db/migrate/20210308175225_add_lock_delayed_project_removal_to_namespace_settings.rb b/db/migrate/20210308175225_add_lock_delayed_project_removal_to_namespace_settings.rb deleted file mode 100644 index e88f3e7ea0d..00000000000 --- a/db/migrate/20210308175225_add_lock_delayed_project_removal_to_namespace_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddLockDelayedProjectRemovalToNamespaceSettings < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :namespace_settings, :lock_delayed_project_removal, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210308175226_add_delayed_project_removal_to_application_settings.rb b/db/migrate/20210308175226_add_delayed_project_removal_to_application_settings.rb deleted file mode 100644 index 1ccb25878e4..00000000000 --- a/db/migrate/20210308175226_add_delayed_project_removal_to_application_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddDelayedProjectRemovalToApplicationSettings < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :application_settings, :delayed_project_removal, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210308175227_add_lock_delayed_project_removal_to_application_settings.rb b/db/migrate/20210308175227_add_lock_delayed_project_removal_to_application_settings.rb deleted file mode 100644 index c63175493de..00000000000 --- a/db/migrate/20210308175227_add_lock_delayed_project_removal_to_application_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddLockDelayedProjectRemovalToApplicationSettings < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :application_settings, :lock_delayed_project_removal, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210308190413_change_batched_background_migrations_batch_class_name_default.rb b/db/migrate/20210308190413_change_batched_background_migrations_batch_class_name_default.rb deleted file mode 100644 index f841c1e9bd5..00000000000 --- a/db/migrate/20210308190413_change_batched_background_migrations_batch_class_name_default.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class ChangeBatchedBackgroundMigrationsBatchClassNameDefault < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - change_column_default :batched_background_migrations, :batch_class_name, - from: 'Gitlab::Database::BackgroundMigration::PrimaryKeyBatchingStrategy', to: 'PrimaryKeyBatchingStrategy' - end -end diff --git a/db/migrate/20210309160106_add_admin_mode_to_application_setting.rb b/db/migrate/20210309160106_add_admin_mode_to_application_setting.rb deleted file mode 100644 index a7b634596d2..00000000000 --- a/db/migrate/20210309160106_add_admin_mode_to_application_setting.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddAdminModeToApplicationSetting < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :application_settings, :admin_mode, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210309181019_add_last_used_at_to_cluster_agent_token.rb b/db/migrate/20210309181019_add_last_used_at_to_cluster_agent_token.rb deleted file mode 100644 index 2a29ab374e5..00000000000 --- a/db/migrate/20210309181019_add_last_used_at_to_cluster_agent_token.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddLastUsedAtToClusterAgentToken < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :cluster_agent_tokens, :last_used_at, :datetime_with_timezone - end -end diff --git a/db/migrate/20210310000627_add_idx_vulnerability_occurrences_dedup.rb b/db/migrate/20210310000627_add_idx_vulnerability_occurrences_dedup.rb deleted file mode 100644 index 5ffcc005225..00000000000 --- a/db/migrate/20210310000627_add_idx_vulnerability_occurrences_dedup.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -# See https://docs.gitlab.com/ee/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddIdxVulnerabilityOccurrencesDedup < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - TABLE = :vulnerability_occurrences - INDEX_NAME = 'index_vulnerability_occurrences_deduplication' - COLUMNS = %i[project_id report_type project_fingerprint] - - disable_ddl_transaction! - - def up - add_concurrent_index TABLE, COLUMNS, name: INDEX_NAME - end - - def down - remove_concurrent_index TABLE, COLUMNS, name: INDEX_NAME - end -end diff --git a/db/migrate/20210310111009_add_settings_to_group_merge_request_approval_settings.rb b/db/migrate/20210310111009_add_settings_to_group_merge_request_approval_settings.rb deleted file mode 100644 index 088f400efb9..00000000000 --- a/db/migrate/20210310111009_add_settings_to_group_merge_request_approval_settings.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class AddSettingsToGroupMergeRequestApprovalSettings < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - change_table(:group_merge_request_approval_settings, bulk: true) do |t| - t.column :allow_committer_approval, :boolean, null: false, default: false - t.column :allow_overrides_to_approver_list_per_merge_request, :boolean, null: false, default: false - t.column :retain_approvals_on_push, :boolean, null: false, default: false - t.column :require_password_to_approve, :boolean, null: false, default: false - end - end -end diff --git a/db/migrate/20210311022012_add_text_limits_to_dast_site_profiles.rb b/db/migrate/20210311022012_add_text_limits_to_dast_site_profiles.rb deleted file mode 100644 index 7858449be14..00000000000 --- a/db/migrate/20210311022012_add_text_limits_to_dast_site_profiles.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitsToDastSiteProfiles < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_text_limit :dast_site_profiles, :auth_url, 1024 - add_text_limit :dast_site_profiles, :auth_username_field, 255 - add_text_limit :dast_site_profiles, :auth_password_field, 255 - add_text_limit :dast_site_profiles, :auth_username, 255 - end - - def down - remove_text_limit :dast_site_profiles, :auth_username - remove_text_limit :dast_site_profiles, :auth_password_field - remove_text_limit :dast_site_profiles, :auth_username_field - remove_text_limit :dast_site_profiles, :auth_url - end -end diff --git a/db/migrate/20210311120152_add_metrics_to_batched_background_migration_jobs.rb b/db/migrate/20210311120152_add_metrics_to_batched_background_migration_jobs.rb deleted file mode 100644 index 523010a4aea..00000000000 --- a/db/migrate/20210311120152_add_metrics_to_batched_background_migration_jobs.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddMetricsToBatchedBackgroundMigrationJobs < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :batched_background_migration_jobs, :metrics, :jsonb, null: false, default: {} - end -end diff --git a/db/migrate/20210311120153_initialize_conversion_of_events_id_to_bigint.rb b/db/migrate/20210311120153_initialize_conversion_of_events_id_to_bigint.rb deleted file mode 100644 index f5ff0816047..00000000000 --- a/db/migrate/20210311120153_initialize_conversion_of_events_id_to_bigint.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfEventsIdToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - # Initialize the conversion of events.id to bigint - # Primary Key of the Events table - initialize_conversion_of_integer_to_bigint :events, :id - end - - def down - trigger_name = rename_trigger_name(:events, :id, :id_convert_to_bigint) - - remove_rename_triggers :events, trigger_name - - remove_column :events, :id_convert_to_bigint - end -end diff --git a/db/migrate/20210311120154_initialize_conversion_of_push_event_payloads_event_id_to_bigint.rb b/db/migrate/20210311120154_initialize_conversion_of_push_event_payloads_event_id_to_bigint.rb deleted file mode 100644 index 651c9ed993d..00000000000 --- a/db/migrate/20210311120154_initialize_conversion_of_push_event_payloads_event_id_to_bigint.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfPushEventPayloadsEventIdToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - # Foreign key that references events.id - # Also Primary key of the push_event_payloads table - initialize_conversion_of_integer_to_bigint :push_event_payloads, :event_id, primary_key: :event_id - end - - def down - trigger_name = rename_trigger_name(:push_event_payloads, :event_id, :event_id_convert_to_bigint) - - remove_rename_triggers :push_event_payloads, trigger_name - - remove_column :push_event_payloads, :event_id_convert_to_bigint - end -end diff --git a/db/migrate/20210312140029_add_owner_and_id_index_on_active_ci_pipeline_schedules.rb b/db/migrate/20210312140029_add_owner_and_id_index_on_active_ci_pipeline_schedules.rb deleted file mode 100644 index 111486a17ab..00000000000 --- a/db/migrate/20210312140029_add_owner_and_id_index_on_active_ci_pipeline_schedules.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddOwnerAndIdIndexOnActiveCiPipelineSchedules < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_ci_pipeline_schedules_on_owner_id_and_id_and_active' - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_pipeline_schedules, [:owner_id, :id], where: "active = TRUE", name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :ci_pipeline_schedules, INDEX_NAME - end -end diff --git a/db/migrate/20210312174321_add_enforced_git_check_to_saml_provider.rb b/db/migrate/20210312174321_add_enforced_git_check_to_saml_provider.rb deleted file mode 100644 index 89553a53084..00000000000 --- a/db/migrate/20210312174321_add_enforced_git_check_to_saml_provider.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddEnforcedGitCheckToSamlProvider < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - add_column :saml_providers, :git_check_enforced, :boolean, default: false, null: false - end - - def down - remove_column :saml_providers, :git_check_enforced - end -end diff --git a/db/migrate/20210312193532_add_resource_access_token_creation_allowed_to_namespace_settings.rb b/db/migrate/20210312193532_add_resource_access_token_creation_allowed_to_namespace_settings.rb deleted file mode 100644 index 1de9d87cf25..00000000000 --- a/db/migrate/20210312193532_add_resource_access_token_creation_allowed_to_namespace_settings.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true -class AddResourceAccessTokenCreationAllowedToNamespaceSettings < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - DOWNTIME = false - - disable_ddl_transaction! - - def up - with_lock_retries do - add_column :namespace_settings, :resource_access_token_creation_allowed, :boolean, default: true, null: false - end - end - - def down - with_lock_retries do - remove_column :namespace_settings, :resource_access_token_creation_allowed - end - end -end diff --git a/db/migrate/20210313045617_add_verification_state_and_started_at_to_snippet_repositories.rb b/db/migrate/20210313045617_add_verification_state_and_started_at_to_snippet_repositories.rb deleted file mode 100644 index e2d6dff23fa..00000000000 --- a/db/migrate/20210313045617_add_verification_state_and_started_at_to_snippet_repositories.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationStateAndStartedAtToSnippetRepositories < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - change_table(:snippet_repositories) do |t| - t.integer :verification_state, default: 0, limit: 2, null: false - t.column :verification_started_at, :datetime_with_timezone - end - end -end diff --git a/db/migrate/20210313045845_add_verification_indexes_to_snippet_repositories.rb b/db/migrate/20210313045845_add_verification_indexes_to_snippet_repositories.rb deleted file mode 100644 index ebbc1126aa2..00000000000 --- a/db/migrate/20210313045845_add_verification_indexes_to_snippet_repositories.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationIndexesToSnippetRepositories < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - VERIFICATION_STATE_INDEX_NAME = "index_snippet_repositories_verification_state" - PENDING_VERIFICATION_INDEX_NAME = "index_snippet_repositories_pending_verification" - FAILED_VERIFICATION_INDEX_NAME = "index_snippet_repositories_failed_verification" - NEEDS_VERIFICATION_INDEX_NAME = "index_snippet_repositories_needs_verification" - - disable_ddl_transaction! - - def up - add_concurrent_index :snippet_repositories, :verification_state, name: VERIFICATION_STATE_INDEX_NAME - add_concurrent_index :snippet_repositories, :verified_at, where: "(verification_state = 0)", order: { verified_at: 'ASC NULLS FIRST' }, name: PENDING_VERIFICATION_INDEX_NAME - add_concurrent_index :snippet_repositories, :verification_retry_at, where: "(verification_state = 3)", order: { verification_retry_at: 'ASC NULLS FIRST' }, name: FAILED_VERIFICATION_INDEX_NAME - add_concurrent_index :snippet_repositories, :verification_state, where: "(verification_state = 0 OR verification_state = 3)", name: NEEDS_VERIFICATION_INDEX_NAME - end - - def down - remove_concurrent_index_by_name :snippet_repositories, VERIFICATION_STATE_INDEX_NAME - remove_concurrent_index_by_name :snippet_repositories, PENDING_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :snippet_repositories, FAILED_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :snippet_repositories, NEEDS_VERIFICATION_INDEX_NAME - end -end diff --git a/db/migrate/20210316094047_add_trial_extension_type_to_gitlab_subscription_histories.rb b/db/migrate/20210316094047_add_trial_extension_type_to_gitlab_subscription_histories.rb deleted file mode 100644 index 3915689e0af..00000000000 --- a/db/migrate/20210316094047_add_trial_extension_type_to_gitlab_subscription_histories.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddTrialExtensionTypeToGitlabSubscriptionHistories < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :gitlab_subscription_histories, :trial_extension_type, :smallint - end -end diff --git a/db/migrate/20210316094323_add_trial_extension_type_to_gitlab_subscriptions.rb b/db/migrate/20210316094323_add_trial_extension_type_to_gitlab_subscriptions.rb deleted file mode 100644 index fb0ee789277..00000000000 --- a/db/migrate/20210316094323_add_trial_extension_type_to_gitlab_subscriptions.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddTrialExtensionTypeToGitlabSubscriptions < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - with_lock_retries do - add_column :gitlab_subscriptions, :trial_extension_type, :smallint - end - end - - def down - with_lock_retries do - remove_column :gitlab_subscriptions, :trial_extension_type - end - end -end diff --git a/db/migrate/20210316152500_add_index_ci_stages_on_pipeline_id_and_id.rb b/db/migrate/20210316152500_add_index_ci_stages_on_pipeline_id_and_id.rb deleted file mode 100644 index 1128bf586ae..00000000000 --- a/db/migrate/20210316152500_add_index_ci_stages_on_pipeline_id_and_id.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexCiStagesOnPipelineIdAndId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_ci_stages_on_pipeline_id_and_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_stages, %i[pipeline_id id], where: 'status IN (0, 1, 2, 8, 9, 10)', name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :ci_stages, INDEX_NAME - end -end diff --git a/db/migrate/20210316171009_create_packages_helm_file_metadata.rb b/db/migrate/20210316171009_create_packages_helm_file_metadata.rb deleted file mode 100644 index 47a9b808e63..00000000000 --- a/db/migrate/20210316171009_create_packages_helm_file_metadata.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class CreatePackagesHelmFileMetadata < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - create_table_with_constraints :packages_helm_file_metadata, id: false do |t| - t.timestamps_with_timezone - t.references :package_file, primary_key: true, index: false, default: nil, null: false, foreign_key: { to_table: :packages_package_files, on_delete: :cascade }, type: :bigint - t.text :channel, null: false - t.jsonb :metadata - - t.text_limit :channel, 63 - - t.index :channel - end - end - - def down - with_lock_retries do - drop_table :packages_helm_file_metadata - end - end -end diff --git a/db/migrate/20210317035357_create_dast_profiles_pipelines.rb b/db/migrate/20210317035357_create_dast_profiles_pipelines.rb deleted file mode 100644 index f84e1237643..00000000000 --- a/db/migrate/20210317035357_create_dast_profiles_pipelines.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class CreateDastProfilesPipelines < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - table_comment = { owner: 'group::dynamic analysis', description: 'Join table between DAST Profiles and CI Pipelines' } - - create_table :dast_profiles_pipelines, primary_key: [:dast_profile_id, :ci_pipeline_id], comment: Gitlab::Json.dump(table_comment) do |t| - t.bigint :dast_profile_id, null: false - t.bigint :ci_pipeline_id, null: false - - t.index :ci_pipeline_id, unique: true, name: :index_dast_profiles_pipelines_on_ci_pipeline_id - end - end - - def down - drop_table :dast_profiles_pipelines - end -end diff --git a/db/migrate/20210317100520_create_elastic_index_settings.rb b/db/migrate/20210317100520_create_elastic_index_settings.rb deleted file mode 100644 index 61c1cbb3518..00000000000 --- a/db/migrate/20210317100520_create_elastic_index_settings.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class CreateElasticIndexSettings < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - create_table_with_constraints :elastic_index_settings do |t| - t.timestamps_with_timezone null: false - t.integer :number_of_replicas, null: false, default: 1, limit: 2 - t.integer :number_of_shards, null: false, default: 5, limit: 2 - t.text :alias_name, null: false - - t.text_limit :alias_name, 255 - t.index :alias_name, unique: true - end - end - - def down - drop_table :elastic_index_settings - end -end diff --git a/db/migrate/20210317104301_create_in_product_marketing_emails.rb b/db/migrate/20210317104301_create_in_product_marketing_emails.rb deleted file mode 100644 index b8c6b952c97..00000000000 --- a/db/migrate/20210317104301_create_in_product_marketing_emails.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -class CreateInProductMarketingEmails < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - UNIQUE_INDEX_NAME = 'index_in_product_marketing_emails_on_user_track_series' - - disable_ddl_transaction! - - def up - with_lock_retries do - create_table :in_product_marketing_emails do |t| - t.bigint :user_id, null: false - t.datetime_with_timezone :cta_clicked_at - t.integer :track, null: false, limit: 2 - t.integer :series, null: false, limit: 2 - - t.timestamps_with_timezone - end - end - - add_index :in_product_marketing_emails, :user_id - add_index :in_product_marketing_emails, [:user_id, :track, :series], unique: true, name: UNIQUE_INDEX_NAME - end - - def down - with_lock_retries do - drop_table :in_product_marketing_emails - end - end -end diff --git a/db/migrate/20210317105904_add_user_foreign_key_to_in_product_marketing_emails.rb b/db/migrate/20210317105904_add_user_foreign_key_to_in_product_marketing_emails.rb deleted file mode 100644 index f0b4d97d2cf..00000000000 --- a/db/migrate/20210317105904_add_user_foreign_key_to_in_product_marketing_emails.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddUserForeignKeyToInProductMarketingEmails < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :in_product_marketing_emails, :users, column: :user_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :in_product_marketing_emails, column: :user_id - end - end -end diff --git a/db/migrate/20210317123054_add_throttle_package_registry_columns.rb b/db/migrate/20210317123054_add_throttle_package_registry_columns.rb deleted file mode 100644 index 0bb731306c0..00000000000 --- a/db/migrate/20210317123054_add_throttle_package_registry_columns.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class AddThrottlePackageRegistryColumns < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :application_settings, :throttle_unauthenticated_packages_api_requests_per_period, :integer, default: 800, null: false - add_column :application_settings, :throttle_unauthenticated_packages_api_period_in_seconds, :integer, default: 15, null: false - add_column :application_settings, :throttle_authenticated_packages_api_requests_per_period, :integer, default: 1000, null: false - add_column :application_settings, :throttle_authenticated_packages_api_period_in_seconds, :integer, default: 15, null: false - add_column :application_settings, :throttle_unauthenticated_packages_api_enabled, :boolean, default: false, null: false - add_column :application_settings, :throttle_authenticated_packages_api_enabled, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210317192943_add_expiry_notification_delivered_to_keys.rb b/db/migrate/20210317192943_add_expiry_notification_delivered_to_keys.rb deleted file mode 100644 index 15f319b3965..00000000000 --- a/db/migrate/20210317192943_add_expiry_notification_delivered_to_keys.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddExpiryNotificationDeliveredToKeys < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :keys, :expiry_notification_delivered_at, :datetime_with_timezone - end -end diff --git a/db/migrate/20210317210338_add_valid_runner_registrars.rb b/db/migrate/20210317210338_add_valid_runner_registrars.rb deleted file mode 100644 index 61663836d39..00000000000 --- a/db/migrate/20210317210338_add_valid_runner_registrars.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddValidRunnerRegistrars < ActiveRecord::Migration[6.0] - def change - add_column :application_settings, :valid_runner_registrars, :string, array: true, default: %w(project group) - end -end diff --git a/db/migrate/20210318134427_delete_security_findings_without_uuid.rb b/db/migrate/20210318134427_delete_security_findings_without_uuid.rb deleted file mode 100644 index f8e0f0fb32b..00000000000 --- a/db/migrate/20210318134427_delete_security_findings_without_uuid.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class DeleteSecurityFindingsWithoutUuid < ActiveRecord::Migration[6.0] - DOWNTIME = false - - disable_ddl_transaction! - - class SecurityFinding < ActiveRecord::Base - include EachBatch - - self.table_name = 'security_findings' - - scope :without_uuid, -> { where(uuid: nil) } - end - - def up - SecurityFinding.without_uuid.each_batch(of: 10_000) do |relation| - relation.delete_all - end - end - - def down - # no-op - end -end diff --git a/db/migrate/20210319071214_add_helm_max_file_size_to_plan_limits.rb b/db/migrate/20210319071214_add_helm_max_file_size_to_plan_limits.rb deleted file mode 100644 index 9a4789b5c1a..00000000000 --- a/db/migrate/20210319071214_add_helm_max_file_size_to_plan_limits.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddHelmMaxFileSizeToPlanLimits < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :plan_limits, :helm_max_file_size, :bigint, default: 5.megabyte, null: false - end -end diff --git a/db/migrate/20210322063407_add_dast_profile_id_fk_to_dast_profiles_pipelines.rb b/db/migrate/20210322063407_add_dast_profile_id_fk_to_dast_profiles_pipelines.rb deleted file mode 100644 index 4e9b3ddd41c..00000000000 --- a/db/migrate/20210322063407_add_dast_profile_id_fk_to_dast_profiles_pipelines.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddDastProfileIdFkToDastProfilesPipelines < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :dast_profiles_pipelines, :dast_profiles, column: :dast_profile_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :dast_profiles_pipelines, column: :dast_profile_id - end - end -end diff --git a/db/migrate/20210322063450_add_ci_pipeline_id_fk_to_dast_profiles_pipelines.rb b/db/migrate/20210322063450_add_ci_pipeline_id_fk_to_dast_profiles_pipelines.rb deleted file mode 100644 index f1dce7f0cd8..00000000000 --- a/db/migrate/20210322063450_add_ci_pipeline_id_fk_to_dast_profiles_pipelines.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddCiPipelineIdFkToDastProfilesPipelines < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :dast_profiles_pipelines, :ci_pipelines, column: :ci_pipeline_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :dast_profiles_pipelines, column: :ci_pipeline_id - end - end -end diff --git a/db/migrate/20210322182751_add_index_to_keys_on_expires_at_and_expiry_notification_undelivered.rb b/db/migrate/20210322182751_add_index_to_keys_on_expires_at_and_expiry_notification_undelivered.rb deleted file mode 100644 index 6387d8a6a43..00000000000 --- a/db/migrate/20210322182751_add_index_to_keys_on_expires_at_and_expiry_notification_undelivered.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToKeysOnExpiresAtAndExpiryNotificationUndelivered < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_keys_on_expires_at_and_expiry_notification_undelivered' - disable_ddl_transaction! - - def up - add_concurrent_index :keys, - "date(timezone('UTC', expires_at)), expiry_notification_delivered_at", - where: 'expiry_notification_delivered_at IS NULL', name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name(:keys, INDEX_NAME) - end -end diff --git a/db/migrate/20210323064751_add_namespace_traversal_ids_index.rb b/db/migrate/20210323064751_add_namespace_traversal_ids_index.rb deleted file mode 100644 index 162173f6629..00000000000 --- a/db/migrate/20210323064751_add_namespace_traversal_ids_index.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddNamespaceTraversalIdsIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_namespaces_on_traversal_ids' - - disable_ddl_transaction! - - def up - add_concurrent_index :namespaces, :traversal_ids, using: :gin, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :namespaces, INDEX_NAME - end -end diff --git a/db/migrate/20210323125809_create_status_check_responses_table.rb b/db/migrate/20210323125809_create_status_check_responses_table.rb deleted file mode 100644 index 3fa7ff7165c..00000000000 --- a/db/migrate/20210323125809_create_status_check_responses_table.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CreateStatusCheckResponsesTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - create_table :status_check_responses do |t| - t.bigint :merge_request_id, null: false - t.bigint :external_approval_rule_id, null: false - end - - add_index :status_check_responses, :merge_request_id - add_index :status_check_responses, :external_approval_rule_id - end - - def down - drop_table :status_check_responses - end -end diff --git a/db/migrate/20210323130831_add_merge_request_foreign_key_to_status_check_responses.rb b/db/migrate/20210323130831_add_merge_request_foreign_key_to_status_check_responses.rb deleted file mode 100644 index cee0b9a231e..00000000000 --- a/db/migrate/20210323130831_add_merge_request_foreign_key_to_status_check_responses.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddMergeRequestForeignKeyToStatusCheckResponses < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :status_check_responses, :merge_requests, column: :merge_request_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :status_check_responses, column: :merge_request_id - end - end -end diff --git a/db/migrate/20210323131543_add_external_approval_rule_foreign_key_to_status_check_responses.rb b/db/migrate/20210323131543_add_external_approval_rule_foreign_key_to_status_check_responses.rb deleted file mode 100644 index ab28c20dbb1..00000000000 --- a/db/migrate/20210323131543_add_external_approval_rule_foreign_key_to_status_check_responses.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddExternalApprovalRuleForeignKeyToStatusCheckResponses < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :status_check_responses, :external_approval_rules, column: :external_approval_rule_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :status_check_responses, column: :external_approval_rule_id - end - end -end diff --git a/db/migrate/20210323155010_populate_dismissal_information_for_vulnerabilities.rb b/db/migrate/20210323155010_populate_dismissal_information_for_vulnerabilities.rb deleted file mode 100644 index aee6d5484d5..00000000000 --- a/db/migrate/20210323155010_populate_dismissal_information_for_vulnerabilities.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class PopulateDismissalInformationForVulnerabilities < ActiveRecord::Migration[6.0] - DOWNTIME = false - BATCH_SIZE = 100 - UPDATE_QUERY = <<~SQL - UPDATE - vulnerabilities - SET - dismissed_at = COALESCE(dismissed_at, updated_at), - dismissed_by_id = COALESCE(dismissed_by_id, updated_by_id, last_edited_by_id, author_id) - WHERE - vulnerabilities.id IN (%{ids}) - SQL - - class Vulnerability < ActiveRecord::Base - include EachBatch - - self.table_name = 'vulnerabilities' - - enum state: { detected: 1, confirmed: 4, resolved: 3, dismissed: 2 } - - scope :broken, -> { dismissed.where('dismissed_at IS NULL OR dismissed_by_id IS NULL') } - end - - def up - Vulnerability.broken.each_batch(of: BATCH_SIZE) do |batch| - query = format(UPDATE_QUERY, ids: batch.select(:id).to_sql) - - connection.execute(query) - end - end - - def down - # no-op - end -end diff --git a/db/migrate/20210323182846_add_project_status_date_index_to_merge_requests.rb b/db/migrate/20210323182846_add_project_status_date_index_to_merge_requests.rb deleted file mode 100644 index 1ec6bc0bf2e..00000000000 --- a/db/migrate/20210323182846_add_project_status_date_index_to_merge_requests.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddProjectStatusDateIndexToMergeRequests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = "idx_mrs_on_target_id_and_created_at_and_state_id" - - disable_ddl_transaction! - - def up - add_concurrent_index :merge_requests, %i[target_project_id state_id created_at id], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :merge_requests, INDEX_NAME - end -end diff --git a/db/migrate/20210324112439_add_index_mirror_data_on_retry_next_execution_where_status.rb b/db/migrate/20210324112439_add_index_mirror_data_on_retry_next_execution_where_status.rb deleted file mode 100644 index 68ce5363b70..00000000000 --- a/db/migrate/20210324112439_add_index_mirror_data_on_retry_next_execution_where_status.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# See https://docs.gitlab.com/ee/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddIndexMirrorDataOnRetryNextExecutionWhereStatus < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - INDEX_NAME = 'index_mirror_data_non_scheduled_or_started' - - disable_ddl_transaction! - - def up - add_concurrent_index :project_mirror_data, - [:next_execution_timestamp, :retry_count], - where: "(status)::text <> ALL ('{scheduled,started}'::text[])", - name: INDEX_NAME - end - - def down - remove_concurrent_index :project_mirror_data, - [:next_execution_timestamp, :retry_count], - where: "(status)::text <> ALL ('{scheduled,started}'::text[])", - name: INDEX_NAME - end -end diff --git a/db/migrate/20210324131727_migrate_elastic_index_settings.rb b/db/migrate/20210324131727_migrate_elastic_index_settings.rb deleted file mode 100644 index 4dcfc6cf952..00000000000 --- a/db/migrate/20210324131727_migrate_elastic_index_settings.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class MigrateElasticIndexSettings < ActiveRecord::Migration[6.0] - DOWNTIME = false - - ALIAS_NAME = [Rails.application.class.module_parent_name.downcase, Rails.env].join('-') - - class ElasticIndexSetting < ActiveRecord::Base - end - - class ApplicationSetting < ActiveRecord::Base - end - - def up - setting = ApplicationSetting.first - number_of_replicas = setting&.elasticsearch_replicas || 1 - number_of_shards = setting&.elasticsearch_shards || 5 - - return if ElasticIndexSetting.exists?(alias_name: ALIAS_NAME) - - ElasticIndexSetting.create!( - alias_name: ALIAS_NAME, - number_of_replicas: number_of_replicas, - number_of_shards: number_of_shards - ) - end - - def down - ElasticIndexSetting.where(alias_name: ALIAS_NAME).delete_all - end -end diff --git a/db/migrate/20210325092215_add_not_valid_foreign_key_to_group_hooks.rb b/db/migrate/20210325092215_add_not_valid_foreign_key_to_group_hooks.rb deleted file mode 100644 index 2389f90d498..00000000000 --- a/db/migrate/20210325092215_add_not_valid_foreign_key_to_group_hooks.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddNotValidForeignKeyToGroupHooks < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - with_lock_retries do - add_foreign_key :web_hooks, :namespaces, column: :group_id, on_delete: :cascade, validate: false - end - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :web_hooks, column: :group_id - end - end -end diff --git a/db/migrate/20210325113129_validate_foreign_key_on_service_hooks.rb b/db/migrate/20210325113129_validate_foreign_key_on_service_hooks.rb deleted file mode 100644 index 17dd4cad6ae..00000000000 --- a/db/migrate/20210325113129_validate_foreign_key_on_service_hooks.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class ValidateForeignKeyOnServiceHooks < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - CONSTRAINT_NAME = 'fk_d47999a98a' - - def up - validate_foreign_key :web_hooks, :service_id, name: CONSTRAINT_NAME - end - - def down - # no-op - end -end diff --git a/db/migrate/20210325150837_add_verification_state_to_ci_pipeline_artifact.rb b/db/migrate/20210325150837_add_verification_state_to_ci_pipeline_artifact.rb deleted file mode 100644 index f6c506e59b7..00000000000 --- a/db/migrate/20210325150837_add_verification_state_to_ci_pipeline_artifact.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationStateToCiPipelineArtifact < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - change_table(:ci_pipeline_artifacts, bulk: true) do |t| - t.column :verification_started_at, :datetime_with_timezone - t.column :verification_retry_at, :datetime_with_timezone - t.column :verified_at, :datetime_with_timezone - t.integer :verification_state, default: 0, limit: 2, null: false - t.integer :verification_retry_count, limit: 2 - t.binary :verification_checksum, using: 'verification_checksum::bytea' - - t.text :verification_failure # rubocop:disable Migration/AddLimitToTextColumns - end - end -end diff --git a/db/migrate/20210325151758_add_verification_failure_limit_to_ci_pipeline_artifact.rb b/db/migrate/20210325151758_add_verification_failure_limit_to_ci_pipeline_artifact.rb deleted file mode 100644 index bc4dee2181f..00000000000 --- a/db/migrate/20210325151758_add_verification_failure_limit_to_ci_pipeline_artifact.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationFailureLimitToCiPipelineArtifact < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - CONSTRAINT_NAME = 'ci_pipeline_artifacts_verification_failure_text_limit' - - def up - add_text_limit :ci_pipeline_artifacts, :verification_failure, 255, constraint_name: CONSTRAINT_NAME - end - - def down - remove_check_constraint(:ci_pipeline_artifacts, CONSTRAINT_NAME) - end -end diff --git a/db/migrate/20210325152011_add_verification_indexes_to_ci_pipeline_artifacts.rb b/db/migrate/20210325152011_add_verification_indexes_to_ci_pipeline_artifacts.rb deleted file mode 100644 index 0822aee35a4..00000000000 --- a/db/migrate/20210325152011_add_verification_indexes_to_ci_pipeline_artifacts.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationIndexesToCiPipelineArtifacts < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - VERIFICATION_STATE_INDEX_NAME = "index_ci_pipeline_artifacts_verification_state" - PENDING_VERIFICATION_INDEX_NAME = "index_ci_pipeline_artifacts_pending_verification" - FAILED_VERIFICATION_INDEX_NAME = "index_ci_pipeline_artifacts_failed_verification" - NEEDS_VERIFICATION_INDEX_NAME = "index_ci_pipeline_artifacts_needs_verification" - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_pipeline_artifacts, :verification_state, name: VERIFICATION_STATE_INDEX_NAME - add_concurrent_index :ci_pipeline_artifacts, :verified_at, where: "(verification_state = 0)", order: { verified_at: 'ASC NULLS FIRST' }, name: PENDING_VERIFICATION_INDEX_NAME - add_concurrent_index :ci_pipeline_artifacts, :verification_retry_at, where: "(verification_state = 3)", order: { verification_retry_at: 'ASC NULLS FIRST' }, name: FAILED_VERIFICATION_INDEX_NAME - add_concurrent_index :ci_pipeline_artifacts, :verification_state, where: "(verification_state = 0 OR verification_state = 3)", name: NEEDS_VERIFICATION_INDEX_NAME - end - - def down - remove_concurrent_index_by_name :ci_pipeline_artifacts, VERIFICATION_STATE_INDEX_NAME - remove_concurrent_index_by_name :ci_pipeline_artifacts, PENDING_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :ci_pipeline_artifacts, FAILED_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :ci_pipeline_artifacts, NEEDS_VERIFICATION_INDEX_NAME - end -end diff --git a/db/migrate/20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb b/db/migrate/20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb deleted file mode 100644 index d10c9401a31..00000000000 --- a/db/migrate/20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexForProjectDeploymentsWithEnvironmentIdAndUpdatedAt < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_NAME = 'index_deployments_on_project_and_environment_and_updated_at' - - def up - add_concurrent_index :deployments, [:project_id, :environment_id, :updated_at], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :deployments, INDEX_NAME - end -end diff --git a/db/migrate/20210326190903_create_vulnerability_finding_evidences.rb b/db/migrate/20210326190903_create_vulnerability_finding_evidences.rb deleted file mode 100644 index 4de02a6762e..00000000000 --- a/db/migrate/20210326190903_create_vulnerability_finding_evidences.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class CreateVulnerabilityFindingEvidences < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - create_table_with_constraints :vulnerability_finding_evidences do |t| - t.timestamps_with_timezone null: false - - t.references :vulnerability_occurrence, index: { name: 'finding_evidences_on_vulnerability_occurrence_id' }, null: false, foreign_key: { on_delete: :cascade } - t.text :summary - - t.text_limit :summary, 8_000_000 - end - end - - def down - with_lock_retries do - drop_table :vulnerability_finding_evidences - end - end -end diff --git a/db/migrate/20210329095548_add_target_project_and_source_branch_index_to_merge_request.rb b/db/migrate/20210329095548_add_target_project_and_source_branch_index_to_merge_request.rb deleted file mode 100644 index d351de6bd77..00000000000 --- a/db/migrate/20210329095548_add_target_project_and_source_branch_index_to_merge_request.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddTargetProjectAndSourceBranchIndexToMergeRequest < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_merge_requests_on_target_project_id_and_source_branch' - - disable_ddl_transaction! - - def up - add_concurrent_index :merge_requests, [:target_project_id, :source_branch], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :epic_issues, INDEX_NAME - end -end diff --git a/db/migrate/20210329191850_add_finding_signature_table.rb b/db/migrate/20210329191850_add_finding_signature_table.rb deleted file mode 100644 index 74a12d54a8e..00000000000 --- a/db/migrate/20210329191850_add_finding_signature_table.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -class AddFindingSignatureTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - SIGNATURE_IDX = :idx_vuln_signatures_on_occurrences_id_and_signature_sha - UNIQ_IDX = :idx_vuln_signatures_uniqueness_signature_sha - - def up - with_lock_retries do - create_table :vulnerability_finding_signatures do |t| - t.references :finding, - index: true, - null: false, - foreign_key: { to_table: :vulnerability_occurrences, column: :finding_id, on_delete: :cascade } - - t.timestamps_with_timezone null: false - - t.integer :algorithm_type, null: false, limit: 2 - t.binary :signature_sha, null: false - - t.index %i[finding_id signature_sha], - name: SIGNATURE_IDX, - unique: true # only one link should exist between occurrence and the signature - - t.index %i[finding_id algorithm_type signature_sha], - name: UNIQ_IDX, - unique: true # these should be unique - end - end - end - - def down - with_lock_retries do - drop_table :vulnerability_finding_signatures - end - end -end diff --git a/db/migrate/20210329192716_add_composite_index_to_award_emoji.rb b/db/migrate/20210329192716_add_composite_index_to_award_emoji.rb deleted file mode 100644 index ce37afdbc29..00000000000 --- a/db/migrate/20210329192716_add_composite_index_to_award_emoji.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddCompositeIndexToAwardEmoji < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :award_emoji, %i[user_id name awardable_type awardable_id], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :award_emoji, INDEX_NAME - end -end diff --git a/db/migrate/20210330015805_add_cloud_to_licenses.rb b/db/migrate/20210330015805_add_cloud_to_licenses.rb deleted file mode 100644 index d0c7112d0b0..00000000000 --- a/db/migrate/20210330015805_add_cloud_to_licenses.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddCloudToLicenses < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :licenses, :cloud, :boolean, default: false - end -end diff --git a/db/migrate/20210331000934_add_config_to_ci_runners.rb b/db/migrate/20210331000934_add_config_to_ci_runners.rb deleted file mode 100644 index e9a5fadc613..00000000000 --- a/db/migrate/20210331000934_add_config_to_ci_runners.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddConfigToCiRunners < ActiveRecord::Migration[6.0] - def change - add_column :ci_runners, :config, :jsonb, default: {}, null: false - end -end diff --git a/db/migrate/20210331125111_add_default_target_project.rb b/db/migrate/20210331125111_add_default_target_project.rb deleted file mode 100644 index 1a2c5ccca7d..00000000000 --- a/db/migrate/20210331125111_add_default_target_project.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddDefaultTargetProject < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - add_column :project_settings, :mr_default_target_self, :boolean, default: false, null: false - end - end - - def down - with_lock_retries do - remove_column :project_settings, :mr_default_target_self - end - end -end diff --git a/db/migrate/20210331145548_add_index_for_last_deployment.rb b/db/migrate/20210331145548_add_index_for_last_deployment.rb deleted file mode 100644 index a50d8ea403a..00000000000 --- a/db/migrate/20210331145548_add_index_for_last_deployment.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexForLastDeployment < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_deployments_on_environment_id_status_and_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :deployments, [:environment_id, :status, :id], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :deployments, INDEX_NAME - end -end diff --git a/db/migrate/20210331180118_remove_deprecated_index_from_award_emoji.rb b/db/migrate/20210331180118_remove_deprecated_index_from_award_emoji.rb deleted file mode 100644 index b8787eb171c..00000000000 --- a/db/migrate/20210331180118_remove_deprecated_index_from_award_emoji.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveDeprecatedIndexFromAwardEmoji < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_award_emoji_on_user_id_and_name' - - disable_ddl_transaction! - - def up - # Index deprecated in favor of idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id - remove_concurrent_index_by_name(:award_emoji, INDEX_NAME) - end - - def down - add_concurrent_index(:award_emoji, [:user_id, :name], name: INDEX_NAME) - end -end diff --git a/db/migrate/20210401134157_add_index_to_pages_deployments.rb b/db/migrate/20210401134157_add_index_to_pages_deployments.rb deleted file mode 100644 index aef27c7c6f9..00000000000 --- a/db/migrate/20210401134157_add_index_to_pages_deployments.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToPagesDeployments < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_NAME = 'index_pages_deployments_on_file_store_and_id' - - def up - add_concurrent_index :pages_deployments, [:file_store, :id], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :pages_deployments, INDEX_NAME - end -end diff --git a/db/migrate/20210401134455_remove_index_mirror_data_on_next_execution_and_retry_count.rb b/db/migrate/20210401134455_remove_index_mirror_data_on_next_execution_and_retry_count.rb deleted file mode 100644 index ee59e72e398..00000000000 --- a/db/migrate/20210401134455_remove_index_mirror_data_on_next_execution_and_retry_count.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# See https://docs.gitlab.com/ee/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class RemoveIndexMirrorDataOnNextExecutionAndRetryCount < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - INDEX_NAME = 'index_mirror_data_on_next_execution_and_retry_count' - - def up - remove_concurrent_index( - :project_mirror_data, - %i[next_execution_timestamp retry_count], - name: INDEX_NAME - ) - end - - def down - add_concurrent_index( - :project_mirror_data, - %i[next_execution_timestamp retry_count], - name: INDEX_NAME - ) - end -end diff --git a/db/migrate/20210401175134_add_before_expiry_notification_delivered_to_keys.rb b/db/migrate/20210401175134_add_before_expiry_notification_delivered_to_keys.rb deleted file mode 100644 index 6a2ea0e738c..00000000000 --- a/db/migrate/20210401175134_add_before_expiry_notification_delivered_to_keys.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddBeforeExpiryNotificationDeliveredToKeys < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :keys, :before_expiry_notification_delivered_at, :datetime_with_timezone - end -end diff --git a/db/migrate/20210401192808_add_index_to_keys_on_expires_at_and_before_expiry_notification_undelivered.rb b/db/migrate/20210401192808_add_index_to_keys_on_expires_at_and_before_expiry_notification_undelivered.rb deleted file mode 100644 index ff792d2e6e6..00000000000 --- a/db/migrate/20210401192808_add_index_to_keys_on_expires_at_and_before_expiry_notification_undelivered.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToKeysOnExpiresAtAndBeforeExpiryNotificationUndelivered < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'idx_keys_expires_at_and_before_expiry_notification_undelivered' - disable_ddl_transaction! - - def up - add_concurrent_index :keys, - "date(timezone('UTC', expires_at)), before_expiry_notification_delivered_at", - where: 'before_expiry_notification_delivered_at IS NULL', name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name(:keys, INDEX_NAME) - end -end diff --git a/db/migrate/20210406063442_create_namespaces_id_parent_id_partial_index.rb b/db/migrate/20210406063442_create_namespaces_id_parent_id_partial_index.rb deleted file mode 100644 index 073d1ee2bc5..00000000000 --- a/db/migrate/20210406063442_create_namespaces_id_parent_id_partial_index.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreateNamespacesIdParentIdPartialIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - NAME = 'index_namespaces_id_parent_id_is_null' - - disable_ddl_transaction! - - def up - add_concurrent_index :namespaces, :id, where: 'parent_id IS NULL', name: NAME - end - - def down - remove_concurrent_index :namespaces, :id, name: NAME - end -end diff --git a/db/migrate/20210406140057_add_total_tuple_count_to_batched_migrations.rb b/db/migrate/20210406140057_add_total_tuple_count_to_batched_migrations.rb deleted file mode 100644 index 32b5f27a577..00000000000 --- a/db/migrate/20210406140057_add_total_tuple_count_to_batched_migrations.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddTotalTupleCountToBatchedMigrations < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - add_column :batched_background_migrations, :total_tuple_count, :bigint - end - - def down - remove_column :batched_background_migrations, :total_tuple_count - end -end diff --git a/db/migrate/20210407002511_add_type_to_dast_site_profile.rb b/db/migrate/20210407002511_add_type_to_dast_site_profile.rb deleted file mode 100644 index 99d9970a2a8..00000000000 --- a/db/migrate/20210407002511_add_type_to_dast_site_profile.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddTypeToDastSiteProfile < ActiveRecord::Migration[6.0] - def change - add_column :dast_site_profiles, :target_type, :integer, limit: 2, default: 0, null: false - end -end diff --git a/db/migrate/20210407111027_add_whats_new_application_setting.rb b/db/migrate/20210407111027_add_whats_new_application_setting.rb deleted file mode 100644 index 450c26e2199..00000000000 --- a/db/migrate/20210407111027_add_whats_new_application_setting.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddWhatsNewApplicationSetting < ActiveRecord::Migration[6.0] - def change - add_column :application_settings, :whats_new_variant, :integer, limit: 2, default: 0 - end -end diff --git a/db/migrate/20210407140539_add_verification_state_and_started_at_to_terraform_state_version_table.rb b/db/migrate/20210407140539_add_verification_state_and_started_at_to_terraform_state_version_table.rb deleted file mode 100644 index 987be4ab1f0..00000000000 --- a/db/migrate/20210407140539_add_verification_state_and_started_at_to_terraform_state_version_table.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationStateAndStartedAtToTerraformStateVersionTable < ActiveRecord::Migration[6.0] - def change - change_table(:terraform_state_versions) do |t| - t.column :verification_started_at, :datetime_with_timezone - t.integer :verification_state, default: 0, limit: 2, null: false - end - end -end diff --git a/db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb b/db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb deleted file mode 100644 index 2bcdf4c8982..00000000000 --- a/db/migrate/20210409084242_create_index_on_notes_for_cherry_picked_merge_requests.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreateIndexOnNotesForCherryPickedMergeRequests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - NAME = 'index_notes_for_cherry_picked_merge_requests' - - disable_ddl_transaction! - - def up - add_concurrent_index :notes, [:project_id, :commit_id], where: "((noteable_type)::text = 'MergeRequest'::text)", name: NAME - end - - def down - remove_concurrent_index_by_name :notes, name: NAME - end -end diff --git a/db/migrate/20210411212813_add_clusters_integrations_prometheus.rb b/db/migrate/20210411212813_add_clusters_integrations_prometheus.rb deleted file mode 100644 index 7b7894fdcc8..00000000000 --- a/db/migrate/20210411212813_add_clusters_integrations_prometheus.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddClustersIntegrationsPrometheus < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - create_table :clusters_integration_prometheus, id: false do |t| - t.timestamps_with_timezone null: false - t.references :cluster, primary_key: true, default: nil, index: false, foreign_key: { on_delete: :cascade } - t.boolean :enabled, null: false, default: false - end - end - end - - def down - with_lock_retries do - drop_table :clusters_integration_prometheus - end - end -end diff --git a/db/migrate/20210412111213_create_security_orchestration_policy_rule_schedule.rb b/db/migrate/20210412111213_create_security_orchestration_policy_rule_schedule.rb deleted file mode 100644 index 365fa36f11b..00000000000 --- a/db/migrate/20210412111213_create_security_orchestration_policy_rule_schedule.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -class CreateSecurityOrchestrationPolicyRuleSchedule < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_PREFIX = 'index_sop_schedules_' - - disable_ddl_transaction! - - def up - table_comment = { owner: 'group::container security', description: 'Schedules used to store relationship between project and security policy repository' } - - create_table_with_constraints :security_orchestration_policy_rule_schedules, comment: Gitlab::Json.dump(table_comment) do |t| - t.timestamps_with_timezone - t.datetime_with_timezone :next_run_at, null: true - - t.references :security_orchestration_policy_configuration, null: false, foreign_key: { to_table: :security_orchestration_policy_configurations, on_delete: :cascade }, index: { name: INDEX_PREFIX + 'on_sop_configuration_id' } - t.references :user, null: false, foreign_key: { on_delete: :cascade }, index: { name: INDEX_PREFIX + 'on_user_id' } - - t.integer :policy_index, null: false - t.text :cron, null: false - - t.text_limit :cron, 255 - end - end - - def down - with_lock_retries do - drop_table :security_orchestration_policy_rule_schedules - end - end -end diff --git a/db/migrate/20210412132736_add_instance_url_to_jira_connect_installations.rb b/db/migrate/20210412132736_add_instance_url_to_jira_connect_installations.rb deleted file mode 100644 index 78b5e7d5d35..00000000000 --- a/db/migrate/20210412132736_add_instance_url_to_jira_connect_installations.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddInstanceUrlToJiraConnectInstallations < ActiveRecord::Migration[6.0] - DOWNTIME = false - - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in db/migrate/20210216163811_add_text_limit_to_jira_connect_installations_instance_url.rb - def up - add_column :jira_connect_installations, :instance_url, :text - end - # rubocop:enable Migration/AddLimitToTextColumns - - def down - remove_column :jira_connect_installations, :instance_url - end -end diff --git a/db/migrate/20210412132824_add_text_limit_to_jira_connect_installations_instance_url.rb b/db/migrate/20210412132824_add_text_limit_to_jira_connect_installations_instance_url.rb deleted file mode 100644 index 22c82ccd223..00000000000 --- a/db/migrate/20210412132824_add_text_limit_to_jira_connect_installations_instance_url.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToJiraConnectInstallationsInstanceUrl < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_text_limit :jira_connect_installations, :instance_url, 255 - end - - def down - remove_text_limit :jira_connect_installations, :instance_url - end -end diff --git a/db/migrate/20210412142223_add_user_index_on_spam_logs.rb b/db/migrate/20210412142223_add_user_index_on_spam_logs.rb deleted file mode 100644 index 0a12f0f1a87..00000000000 --- a/db/migrate/20210412142223_add_user_index_on_spam_logs.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddUserIndexOnSpamLogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_spam_logs_on_user_id' - - def up - add_concurrent_index :spam_logs, :user_id, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :spam_logs, INDEX_NAME - end -end diff --git a/db/migrate/20210412172030_add_configured_at_to_security_orchestration_policy.rb b/db/migrate/20210412172030_add_configured_at_to_security_orchestration_policy.rb deleted file mode 100644 index 8e21e0f5182..00000000000 --- a/db/migrate/20210412172030_add_configured_at_to_security_orchestration_policy.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddConfiguredAtToSecurityOrchestrationPolicy < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def change - add_column :security_orchestration_policy_configurations, :configured_at, :datetime_with_timezone, null: true - end -end diff --git a/db/migrate/20210413121101_add_created_at_web_hook_id_index_to_partitioned_web_hook_log.rb b/db/migrate/20210413121101_add_created_at_web_hook_id_index_to_partitioned_web_hook_log.rb deleted file mode 100644 index 344f4859b47..00000000000 --- a/db/migrate/20210413121101_add_created_at_web_hook_id_index_to_partitioned_web_hook_log.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddCreatedAtWebHookIdIndexToPartitionedWebHookLog < ActiveRecord::Migration[6.0] - include Gitlab::Database::PartitioningMigrationHelpers - - DOWNTIME = false - - CREATED_AT_WEB_HOOK_ID_INDEX_NAME = 'index_web_hook_logs_part_on_created_at_and_web_hook_id' - - disable_ddl_transaction! - - def up - add_concurrent_partitioned_index :web_hook_logs_part_0c5294f417, - [:created_at, :web_hook_id], - name: CREATED_AT_WEB_HOOK_ID_INDEX_NAME - end - - def down - remove_concurrent_partitioned_index_by_name :web_hook_logs_part_0c5294f417, CREATED_AT_WEB_HOOK_ID_INDEX_NAME - end -end diff --git a/db/migrate/20210413123832_add_index_on_web_hook_id_to_partitioned_web_hook_log.rb b/db/migrate/20210413123832_add_index_on_web_hook_id_to_partitioned_web_hook_log.rb deleted file mode 100644 index 300c19d3e51..00000000000 --- a/db/migrate/20210413123832_add_index_on_web_hook_id_to_partitioned_web_hook_log.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnWebHookIdToPartitionedWebHookLog < ActiveRecord::Migration[6.0] - include Gitlab::Database::PartitioningMigrationHelpers - - DOWNTIME = false - - WEB_HOOK_ID_INDEX_NAME = 'index_web_hook_logs_part_on_web_hook_id' - - disable_ddl_transaction! - - def up - add_concurrent_partitioned_index :web_hook_logs_part_0c5294f417, - :web_hook_id, - name: WEB_HOOK_ID_INDEX_NAME - end - - def down - remove_concurrent_partitioned_index_by_name :web_hook_logs_part_0c5294f417, WEB_HOOK_ID_INDEX_NAME - end -end diff --git a/db/migrate/20210413155324_add_pause_seconds_to_batched_background_migrations.rb b/db/migrate/20210413155324_add_pause_seconds_to_batched_background_migrations.rb deleted file mode 100644 index ca73c85963e..00000000000 --- a/db/migrate/20210413155324_add_pause_seconds_to_batched_background_migrations.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddPauseSecondsToBatchedBackgroundMigrations < ActiveRecord::Migration[6.0] - def change - add_column :batched_background_migrations, :pause_ms, :integer, null: false, default: 100 - end -end diff --git a/db/migrate/20210414045322_add_pause_seconds_to_batched_background_migration_jobs.rb b/db/migrate/20210414045322_add_pause_seconds_to_batched_background_migration_jobs.rb deleted file mode 100644 index d232f9c0305..00000000000 --- a/db/migrate/20210414045322_add_pause_seconds_to_batched_background_migration_jobs.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddPauseSecondsToBatchedBackgroundMigrationJobs < ActiveRecord::Migration[6.0] - def change - add_column :batched_background_migration_jobs, :pause_ms, :integer, null: false, default: 100 - end -end diff --git a/db/migrate/20210414095944_add_index_services_on_project_and_type_where_inherit_null.rb b/db/migrate/20210414095944_add_index_services_on_project_and_type_where_inherit_null.rb deleted file mode 100644 index 395742318e2..00000000000 --- a/db/migrate/20210414095944_add_index_services_on_project_and_type_where_inherit_null.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexServicesOnProjectAndTypeWhereInheritNull < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_services_on_project_and_type_where_inherit_null' - - def up - add_concurrent_index(:services, [:project_id, :type], where: 'inherit_from_id IS NULL', name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:services, INDEX_NAME) - end -end diff --git a/db/migrate/20210414100914_add_bulk_import_exports_table.rb b/db/migrate/20210414100914_add_bulk_import_exports_table.rb deleted file mode 100644 index 14a7421c1e4..00000000000 --- a/db/migrate/20210414100914_add_bulk_import_exports_table.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class AddBulkImportExportsTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - create_table_with_constraints :bulk_import_exports do |t| - t.bigint :group_id - t.bigint :project_id - t.timestamps_with_timezone null: false - t.integer :status, limit: 2, null: false, default: 0 - t.text :relation, null: false - t.text :jid, unique: true - t.text :error - - t.text_limit :relation, 255 - t.text_limit :jid, 255 - t.text_limit :error, 255 - end - end - - def down - drop_table :bulk_import_exports - end -end diff --git a/db/migrate/20210414130017_add_foreign_key_to_bulk_import_exports_on_project.rb b/db/migrate/20210414130017_add_foreign_key_to_bulk_import_exports_on_project.rb deleted file mode 100644 index 2f7d3713302..00000000000 --- a/db/migrate/20210414130017_add_foreign_key_to_bulk_import_exports_on_project.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToBulkImportExportsOnProject < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :bulk_import_exports, :projects, column: :project_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :bulk_import_exports, column: :project_id - end - end -end diff --git a/db/migrate/20210414130526_add_foreign_key_to_bulk_import_exports_on_group.rb b/db/migrate/20210414130526_add_foreign_key_to_bulk_import_exports_on_group.rb deleted file mode 100644 index b7172c6987e..00000000000 --- a/db/migrate/20210414130526_add_foreign_key_to_bulk_import_exports_on_group.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToBulkImportExportsOnGroup < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :bulk_import_exports, :namespaces, column: :group_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :bulk_import_exports, column: :group_id - end - end -end diff --git a/db/migrate/20210414131600_add_external_pipeline_validation_to_application_setting.rb b/db/migrate/20210414131600_add_external_pipeline_validation_to_application_setting.rb deleted file mode 100644 index 537f7727691..00000000000 --- a/db/migrate/20210414131600_add_external_pipeline_validation_to_application_setting.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddExternalPipelineValidationToApplicationSetting < ActiveRecord::Migration[6.0] - def up - add_column :application_settings, :external_pipeline_validation_service_timeout, :integer - # rubocop:disable Migration/AddLimitToTextColumns - add_column :application_settings, :encrypted_external_pipeline_validation_service_token, :text - add_column :application_settings, :encrypted_external_pipeline_validation_service_token_iv, :text - add_column :application_settings, :external_pipeline_validation_service_url, :text - # rubocop:enable Migration/AddLimitToTextColumns - end - - def down - remove_column :application_settings, :external_pipeline_validation_service_timeout - remove_column :application_settings, :encrypted_external_pipeline_validation_service_token - remove_column :application_settings, :encrypted_external_pipeline_validation_service_token_iv - remove_column :application_settings, :external_pipeline_validation_service_url - end -end diff --git a/db/migrate/20210414131807_add_bulk_import_exports_table_indexes.rb b/db/migrate/20210414131807_add_bulk_import_exports_table_indexes.rb deleted file mode 100644 index 1cbd1cadf5e..00000000000 --- a/db/migrate/20210414131807_add_bulk_import_exports_table_indexes.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class AddBulkImportExportsTableIndexes < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - GROUP_INDEX_NAME = 'partial_index_bulk_import_exports_on_group_id_and_relation' - PROJECT_INDEX_NAME = 'partial_index_bulk_import_exports_on_project_id_and_relation' - - def up - add_concurrent_index :bulk_import_exports, - [:group_id, :relation], - unique: true, - where: 'group_id IS NOT NULL', - name: GROUP_INDEX_NAME - - add_concurrent_index :bulk_import_exports, - [:project_id, :relation], - unique: true, - where: 'project_id IS NOT NULL', - name: PROJECT_INDEX_NAME - end - - def down - remove_concurrent_index_by_name(:bulk_import_exports, GROUP_INDEX_NAME) - remove_concurrent_index_by_name(:bulk_import_exports, PROJECT_INDEX_NAME) - end -end diff --git a/db/migrate/20210414133310_add_bulk_import_export_uploads_table.rb b/db/migrate/20210414133310_add_bulk_import_export_uploads_table.rb deleted file mode 100644 index d20e57848e9..00000000000 --- a/db/migrate/20210414133310_add_bulk_import_export_uploads_table.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddBulkImportExportUploadsTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - create_table_with_constraints :bulk_import_export_uploads do |t| - t.references :export, index: true, null: false, foreign_key: { to_table: :bulk_import_exports, on_delete: :cascade } - t.datetime_with_timezone :updated_at, null: false - t.text :export_file - - t.text_limit :export_file, 255 - end - end - - def down - drop_table :bulk_import_export_uploads - end -end diff --git a/db/migrate/20210415100159_initialize_conversion_of_ci_build_needs_to_bigint.rb b/db/migrate/20210415100159_initialize_conversion_of_ci_build_needs_to_bigint.rb deleted file mode 100644 index 068dceda272..00000000000 --- a/db/migrate/20210415100159_initialize_conversion_of_ci_build_needs_to_bigint.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiBuildNeedsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - initialize_conversion_of_integer_to_bigint :ci_build_needs, :build_id - end - - def down - trigger_name = rename_trigger_name(:ci_build_needs, :build_id, :build_id_convert_to_bigint) - - remove_rename_triggers :ci_build_needs, trigger_name - - remove_column :ci_build_needs, :build_id_convert_to_bigint - end -end diff --git a/db/migrate/20210415142700_add_url_limit_to_pipeline_validation.rb b/db/migrate/20210415142700_add_url_limit_to_pipeline_validation.rb deleted file mode 100644 index 9c38e04a96b..00000000000 --- a/db/migrate/20210415142700_add_url_limit_to_pipeline_validation.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddUrlLimitToPipelineValidation < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - CONSTRAINT_NAME = 'app_settings_ext_pipeline_validation_service_url_text_limit' - - def up - add_text_limit :application_settings, :external_pipeline_validation_service_url, 255, constraint_name: CONSTRAINT_NAME - end - - def down - remove_check_constraint(:application_settings, CONSTRAINT_NAME) - end -end diff --git a/db/migrate/20210415144538_remove_index_epics_on_group_id_from_epics.rb b/db/migrate/20210415144538_remove_index_epics_on_group_id_from_epics.rb deleted file mode 100644 index f691af4d8d2..00000000000 --- a/db/migrate/20210415144538_remove_index_epics_on_group_id_from_epics.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RemoveIndexEpicsOnGroupIdFromEpics < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_epics_on_group_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name :epics, INDEX_NAME - end - - def down - add_concurrent_index :epics, :group_id, name: INDEX_NAME - end -end diff --git a/db/migrate/20210415172516_create_vulnerability_finding_evidence_requests.rb b/db/migrate/20210415172516_create_vulnerability_finding_evidence_requests.rb deleted file mode 100644 index 2fe33ff23ba..00000000000 --- a/db/migrate/20210415172516_create_vulnerability_finding_evidence_requests.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class CreateVulnerabilityFindingEvidenceRequests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - create_table_with_constraints :vulnerability_finding_evidence_requests do |t| - t.timestamps_with_timezone null: false - - t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_requests_on_finding_evidence_id' }, null: false, foreign_key: { on_delete: :cascade } - t.text :method - t.text :url - - t.text_limit :method, 32 - t.text_limit :url, 2048 - end - end - - def down - with_lock_retries do - drop_table :vulnerability_finding_evidence_requests - end - end -end diff --git a/db/migrate/20210416172516_create_vulnerability_finding_evidence_responses.rb b/db/migrate/20210416172516_create_vulnerability_finding_evidence_responses.rb deleted file mode 100644 index c9740a48117..00000000000 --- a/db/migrate/20210416172516_create_vulnerability_finding_evidence_responses.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class CreateVulnerabilityFindingEvidenceResponses < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - create_table_with_constraints :vulnerability_finding_evidence_responses do |t| - t.timestamps_with_timezone null: false - - t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_responses_on_finding_evidences_id' }, null: false, foreign_key: { on_delete: :cascade } - t.integer :status_code - t.text :reason_phrase - - t.text_limit :reason_phrase, 2048 - end - end - - def down - with_lock_retries do - drop_table :vulnerability_finding_evidence_responses - end - end -end diff --git a/db/migrate/20210419090412_remove_debian_group_architectures_distribution_id_index.rb b/db/migrate/20210419090412_remove_debian_group_architectures_distribution_id_index.rb deleted file mode 100644 index 1df56742480..00000000000 --- a/db/migrate/20210419090412_remove_debian_group_architectures_distribution_id_index.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveDebianGroupArchitecturesDistributionIdIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - INDEX_NAME = 'idx_pkgs_deb_grp_architectures_on_distribution_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index :packages_debian_group_architectures, :distribution_id, name: INDEX_NAME - end - - def down - add_concurrent_index :packages_debian_group_architectures, :distribution_id, name: INDEX_NAME - end -end diff --git a/db/migrate/20210419090542_remove_debian_project_architectures_distribution_id_index.rb b/db/migrate/20210419090542_remove_debian_project_architectures_distribution_id_index.rb deleted file mode 100644 index 1f918bd4dec..00000000000 --- a/db/migrate/20210419090542_remove_debian_project_architectures_distribution_id_index.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveDebianProjectArchitecturesDistributionIdIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - INDEX_NAME = 'idx_pkgs_deb_proj_architectures_on_distribution_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index :packages_debian_project_architectures, :distribution_id, name: INDEX_NAME - end - - def down - add_concurrent_index :packages_debian_project_architectures, :distribution_id, name: INDEX_NAME - end -end diff --git a/db/migrate/20210419203017_add_remote_import_url_to_import_export_upload.rb b/db/migrate/20210419203017_add_remote_import_url_to_import_export_upload.rb deleted file mode 100644 index 00c5329406e..00000000000 --- a/db/migrate/20210419203017_add_remote_import_url_to_import_export_upload.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -class AddRemoteImportUrlToImportExportUpload < ActiveRecord::Migration[6.0] - # limit is added in 20210419203018_add_remote_text_limit_to_import_url_in_import_export_upload.rb - def change - add_column :import_export_uploads, :remote_import_url, :text # rubocop:disable Migration/AddLimitToTextColumns - end -end diff --git a/db/migrate/20210419203018_add_remote_text_limit_to_import_url_in_import_export_upload.rb b/db/migrate/20210419203018_add_remote_text_limit_to_import_url_in_import_export_upload.rb deleted file mode 100644 index 81b4e76b8d9..00000000000 --- a/db/migrate/20210419203018_add_remote_text_limit_to_import_url_in_import_export_upload.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddRemoteTextLimitToImportUrlInImportExportUpload < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_text_limit :import_export_uploads, :remote_import_url, 512 - end - - def down - remove_text_limit :import_export_uploads, :remote_import_url - end -end diff --git a/db/migrate/20210419224834_update_issues_iteration_foreign_key.rb b/db/migrate/20210419224834_update_issues_iteration_foreign_key.rb deleted file mode 100644 index d071ac8d1d4..00000000000 --- a/db/migrate/20210419224834_update_issues_iteration_foreign_key.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class UpdateIssuesIterationForeignKey < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - with_lock_retries do - remove_foreign_key_if_exists(:issues, column: :sprint_id) - end - - add_concurrent_foreign_key(:issues, :sprints, column: :sprint_id, on_delete: :nullify) - end - - def down - with_lock_retries do - remove_foreign_key_if_exists(:issues, column: :sprint_id) - end - - add_concurrent_foreign_key(:issues, :sprints, column: :sprint_id, on_delete: :cascade) - end -end diff --git a/db/migrate/20210420012444_change_web_hook_events_default.rb b/db/migrate/20210420012444_change_web_hook_events_default.rb deleted file mode 100644 index b5a63a5a2a8..00000000000 --- a/db/migrate/20210420012444_change_web_hook_events_default.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class ChangeWebHookEventsDefault < ActiveRecord::Migration[6.0] - def up - change_column_default :web_hooks, :push_events, true - change_column_default :web_hooks, :issues_events, false - change_column_default :web_hooks, :merge_requests_events, false - change_column_default :web_hooks, :tag_push_events, false - end - - # This is a NOP because this migration is supposed to restore the - # intended schema, not revert it. - def down - end -end diff --git a/db/migrate/20210420012909_index_cluster_agent_tokens_on_last_used_at.rb b/db/migrate/20210420012909_index_cluster_agent_tokens_on_last_used_at.rb deleted file mode 100644 index c1715d8ac29..00000000000 --- a/db/migrate/20210420012909_index_cluster_agent_tokens_on_last_used_at.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class IndexClusterAgentTokensOnLastUsedAt < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - OLD_INDEX = 'index_cluster_agent_tokens_on_agent_id' - NEW_INDEX = 'index_cluster_agent_tokens_on_agent_id_and_last_used_at' - - disable_ddl_transaction! - - def up - add_concurrent_index :cluster_agent_tokens, 'agent_id, last_used_at DESC NULLS LAST', name: NEW_INDEX - remove_concurrent_index_by_name :cluster_agent_tokens, OLD_INDEX - end - - def down - add_concurrent_index :cluster_agent_tokens, :agent_id, name: OLD_INDEX - remove_concurrent_index_by_name :cluster_agent_tokens, NEW_INDEX - end -end diff --git a/db/migrate/20210420120734_initialize_conversion_of_ci_job_artifacts_to_bigint.rb b/db/migrate/20210420120734_initialize_conversion_of_ci_job_artifacts_to_bigint.rb deleted file mode 100644 index cc8f0686841..00000000000 --- a/db/migrate/20210420120734_initialize_conversion_of_ci_job_artifacts_to_bigint.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiJobArtifactsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :ci_job_artifacts - COLUMNS = %i(id job_id) - TARGET_COLUMNS = COLUMNS.map { |col| "#{col}_convert_to_bigint" } - - def up - initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - trigger_name = rename_trigger_name(TABLE, COLUMNS, TARGET_COLUMNS) - remove_rename_triggers TABLE, trigger_name - - TARGET_COLUMNS.each do |column| - remove_column TABLE, column - end - end -end diff --git a/db/migrate/20210420173030_add_verification_indexes_to_terraform_state_versions.rb b/db/migrate/20210420173030_add_verification_indexes_to_terraform_state_versions.rb deleted file mode 100644 index 2c0d0bee39d..00000000000 --- a/db/migrate/20210420173030_add_verification_indexes_to_terraform_state_versions.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationIndexesToTerraformStateVersions < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - VERIFICATION_STATE_INDEX_NAME = "index_terraform_state_versions_on_verification_state" - PENDING_VERIFICATION_INDEX_NAME = "index_terraform_state_versions_pending_verification" - FAILED_VERIFICATION_INDEX_NAME = "index_terraform_state_versions_failed_verification" - NEEDS_VERIFICATION_INDEX_NAME = "index_terraform_state_versions_needs_verification" - - disable_ddl_transaction! - - def up - add_concurrent_index :terraform_state_versions, :verification_state, name: VERIFICATION_STATE_INDEX_NAME - add_concurrent_index :terraform_state_versions, :verified_at, where: "(verification_state = 0)", order: { verified_at: 'ASC NULLS FIRST' }, name: PENDING_VERIFICATION_INDEX_NAME - add_concurrent_index :terraform_state_versions, :verification_retry_at, where: "(verification_state = 3)", order: { verification_retry_at: 'ASC NULLS FIRST' }, name: FAILED_VERIFICATION_INDEX_NAME - add_concurrent_index :terraform_state_versions, :verification_state, where: "(verification_state = 0 OR verification_state = 3)", name: NEEDS_VERIFICATION_INDEX_NAME - end - - def down - remove_concurrent_index_by_name :terraform_state_versions, VERIFICATION_STATE_INDEX_NAME - remove_concurrent_index_by_name :terraform_state_versions, PENDING_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :terraform_state_versions, FAILED_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :terraform_state_versions, NEEDS_VERIFICATION_INDEX_NAME - end -end diff --git a/db/migrate/20210420210642_recreate_index_for_project_deployments_with_environment_id_and_date_at.rb b/db/migrate/20210420210642_recreate_index_for_project_deployments_with_environment_id_and_date_at.rb deleted file mode 100644 index 2674d9e50c8..00000000000 --- a/db/migrate/20210420210642_recreate_index_for_project_deployments_with_environment_id_and_date_at.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# This migration recreates the index that introduced in 20210326035553_add_index_for_project_deployments_with_environment_id_and_updated_at.rb. -class RecreateIndexForProjectDeploymentsWithEnvironmentIdAndDateAt < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - OLD_INDEX_NAME = 'index_deployments_on_project_and_environment_and_updated_at' - NEW_INDEX_NAME = 'index_deployments_on_project_and_environment_and_updated_at_id' - - def up - add_concurrent_index :deployments, [:project_id, :environment_id, :updated_at, :id], name: NEW_INDEX_NAME - remove_concurrent_index_by_name :deployments, OLD_INDEX_NAME - end - - def down - add_concurrent_index :deployments, [:project_id, :environment_id, :updated_at], name: OLD_INDEX_NAME - remove_concurrent_index_by_name :deployments, NEW_INDEX_NAME - end -end diff --git a/db/migrate/20210420221106_update_merge_requests_iteration_foreign_key.rb b/db/migrate/20210420221106_update_merge_requests_iteration_foreign_key.rb deleted file mode 100644 index 64786f0b20c..00000000000 --- a/db/migrate/20210420221106_update_merge_requests_iteration_foreign_key.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class UpdateMergeRequestsIterationForeignKey < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - with_lock_retries do - remove_foreign_key_if_exists(:merge_requests, column: :sprint_id) - end - - add_concurrent_foreign_key(:merge_requests, :sprints, column: :sprint_id, on_delete: :nullify) - end - - def down - with_lock_retries do - remove_foreign_key_if_exists(:merge_requests, column: :sprint_id) - end - - add_concurrent_foreign_key(:merge_requests, :sprints, column: :sprint_id, on_delete: :cascade) - end -end diff --git a/db/migrate/20210421021510_add_deactivate_dormant_users_to_application_settings.rb b/db/migrate/20210421021510_add_deactivate_dormant_users_to_application_settings.rb deleted file mode 100644 index 74d197cd3b8..00000000000 --- a/db/migrate/20210421021510_add_deactivate_dormant_users_to_application_settings.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddDeactivateDormantUsersToApplicationSettings < ActiveRecord::Migration[6.0] - def change - add_column :application_settings, :deactivate_dormant_users, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210421022010_add_index_for_dormant_users.rb b/db/migrate/20210421022010_add_index_for_dormant_users.rb deleted file mode 100644 index 48eff184ca0..00000000000 --- a/db/migrate/20210421022010_add_index_for_dormant_users.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexForDormantUsers < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_users_on_id_and_last_activity_on_for_non_internal_active' - - disable_ddl_transaction! - - def up - index_condition = "state = 'active' AND (users.user_type IS NULL OR users.user_type IN (NULL, 6, 4))" - - add_concurrent_index :users, [:id, :last_activity_on], where: index_condition, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :users, INDEX_NAME - end -end diff --git a/db/migrate/20210421081724_add_codeowners_devops_adoption_snapshot.rb b/db/migrate/20210421081724_add_codeowners_devops_adoption_snapshot.rb deleted file mode 100644 index 3d65abc5608..00000000000 --- a/db/migrate/20210421081724_add_codeowners_devops_adoption_snapshot.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -class AddCodeownersDevopsAdoptionSnapshot < ActiveRecord::Migration[6.0] - def change - add_column :analytics_devops_adoption_snapshots, :total_projects_count, :integer - add_column :analytics_devops_adoption_snapshots, :code_owners_used_count, :integer - end -end diff --git a/db/migrate/20210421190157_remove_elastic_task_null_constraint_from_elastic_reindexing_subtasks.rb b/db/migrate/20210421190157_remove_elastic_task_null_constraint_from_elastic_reindexing_subtasks.rb deleted file mode 100644 index 301e75aa093..00000000000 --- a/db/migrate/20210421190157_remove_elastic_task_null_constraint_from_elastic_reindexing_subtasks.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveElasticTaskNullConstraintFromElasticReindexingSubtasks < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - ELASTIC_TASK = 'elastic_task' - - disable_ddl_transaction! - - def up - remove_not_null_constraint :elastic_reindexing_subtasks, :elastic_task - change_column_null(:elastic_reindexing_subtasks, :elastic_task, true) - end - - def down - # there may be elastic_task values which are null so we fill them with a dummy value - change_column_null(:elastic_reindexing_subtasks, :elastic_task, false, ELASTIC_TASK) - add_not_null_constraint :elastic_reindexing_subtasks, :elastic_task, validate: false - end -end diff --git a/db/migrate/20210422022825_initialize_conversion_of_ci_sources_pipelines_source_job_id_to_bigint.rb b/db/migrate/20210422022825_initialize_conversion_of_ci_sources_pipelines_source_job_id_to_bigint.rb deleted file mode 100644 index ea716afe84b..00000000000 --- a/db/migrate/20210422022825_initialize_conversion_of_ci_sources_pipelines_source_job_id_to_bigint.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiSourcesPipelinesSourceJobIdToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - # Foreign key that references ci_builds.id - initialize_conversion_of_integer_to_bigint :ci_sources_pipelines, :source_job_id - end - - def down - trigger_name = rename_trigger_name(:ci_sources_pipelines, :source_job_id, :source_job_id_convert_to_bigint) - - remove_rename_triggers :ci_sources_pipelines, trigger_name - - remove_column :ci_sources_pipelines, :source_job_id_convert_to_bigint - end -end diff --git a/db/migrate/20210422142647_add_project_id_next_run_at_index_to_container_expiration_policies.rb b/db/migrate/20210422142647_add_project_id_next_run_at_index_to_container_expiration_policies.rb deleted file mode 100644 index bd38b5660b4..00000000000 --- a/db/migrate/20210422142647_add_project_id_next_run_at_index_to_container_expiration_policies.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddProjectIdNextRunAtIndexToContainerExpirationPolicies < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'idx_container_exp_policies_on_project_id_next_run_at' - - def up - add_concurrent_index :container_expiration_policies, [:project_id, :next_run_at], name: INDEX_NAME, where: 'enabled = true' - end - - def down - remove_concurrent_index :container_expiration_policies, [:project_id, :next_run_at], name: INDEX_NAME - end -end diff --git a/db/migrate/20210422181809_add_project_to_timelogs.rb b/db/migrate/20210422181809_add_project_to_timelogs.rb deleted file mode 100644 index 1f98e440d15..00000000000 --- a/db/migrate/20210422181809_add_project_to_timelogs.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddProjectToTimelogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - with_lock_retries do - add_column :timelogs, :project_id, :integer - end - end - - def down - with_lock_retries do - remove_column :timelogs, :project_id - end - end -end diff --git a/db/migrate/20210422195929_create_elastic_reindexing_slices.rb b/db/migrate/20210422195929_create_elastic_reindexing_slices.rb deleted file mode 100644 index a535402186c..00000000000 --- a/db/migrate/20210422195929_create_elastic_reindexing_slices.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -class CreateElasticReindexingSlices < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - class ReindexingSubtask < ActiveRecord::Base - self.table_name = 'elastic_reindexing_subtasks' - end - - class ReindexingSlice < ActiveRecord::Base - self.table_name = 'elastic_reindexing_slices' - end - - def up - unless table_exists?(:elastic_reindexing_slices) - create_table_with_constraints :elastic_reindexing_slices do |t| - t.timestamps_with_timezone null: false - t.references :elastic_reindexing_subtask, foreign_key: { on_delete: :cascade }, null: false, index: { name: 'idx_elastic_reindexing_slices_on_elastic_reindexing_subtask_id' } - t.integer :elastic_slice, null: false, limit: 2, default: 0 - t.integer :elastic_max_slice, null: false, limit: 2, default: 0 - t.integer :retry_attempt, null: false, limit: 2, default: 0 - t.text :elastic_task - - t.text_limit :elastic_task, 255 - end - end - - ReindexingSubtask.find_each do |subtask| - next if ReindexingSlice.where(elastic_reindexing_subtask_id: subtask.id).exists? - - ReindexingSlice.create( - elastic_reindexing_subtask_id: subtask.id, - elastic_task: subtask.elastic_task, - retry_attempt: 0 - ) - end - end - - def down - drop_table :elastic_reindexing_slices - end -end diff --git a/db/migrate/20210423054022_create_dast_site_profiles_pipelines.rb b/db/migrate/20210423054022_create_dast_site_profiles_pipelines.rb deleted file mode 100644 index 80b97ff5afe..00000000000 --- a/db/migrate/20210423054022_create_dast_site_profiles_pipelines.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreateDastSiteProfilesPipelines < ActiveRecord::Migration[6.0] - def up - table_comment = { owner: 'group::dynamic analysis', description: 'Join table between DAST Site Profiles and CI Pipelines' } - - create_table :dast_site_profiles_pipelines, primary_key: [:dast_site_profile_id, :ci_pipeline_id], comment: Gitlab::Json.dump(table_comment) do |t| - t.bigint :dast_site_profile_id, null: false - t.bigint :ci_pipeline_id, null: false - - t.index :ci_pipeline_id, unique: true, name: :index_dast_site_profiles_pipelines_on_ci_pipeline_id - end - end - - def down - drop_table :dast_site_profiles_pipelines - end -end diff --git a/db/migrate/20210423054537_add_dast_site_profile_id_fk_to_dast_site_profiles_pipelines.rb b/db/migrate/20210423054537_add_dast_site_profile_id_fk_to_dast_site_profiles_pipelines.rb deleted file mode 100644 index eb3a5168609..00000000000 --- a/db/migrate/20210423054537_add_dast_site_profile_id_fk_to_dast_site_profiles_pipelines.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddDastSiteProfileIdFkToDastSiteProfilesPipelines < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :dast_site_profiles_pipelines, :dast_site_profiles, column: :dast_site_profile_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :dast_site_profiles_pipelines, column: :dast_site_profile_id - end - end -end diff --git a/db/migrate/20210423054846_add_ci_pipeline_id_fk_to_dast_site_profiles_pipelines.rb b/db/migrate/20210423054846_add_ci_pipeline_id_fk_to_dast_site_profiles_pipelines.rb deleted file mode 100644 index ed2a7ff859c..00000000000 --- a/db/migrate/20210423054846_add_ci_pipeline_id_fk_to_dast_site_profiles_pipelines.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddCiPipelineIdFkToDastSiteProfilesPipelines < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :dast_site_profiles_pipelines, :ci_pipelines, column: :ci_pipeline_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :dast_site_profiles_pipelines, column: :ci_pipeline_id - end - end -end diff --git a/db/migrate/20210423155059_add_runner_registration_to_plan_limits.rb b/db/migrate/20210423155059_add_runner_registration_to_plan_limits.rb deleted file mode 100644 index 5382e596d8c..00000000000 --- a/db/migrate/20210423155059_add_runner_registration_to_plan_limits.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -class AddRunnerRegistrationToPlanLimits < ActiveRecord::Migration[6.0] - def change - add_column(:plan_limits, :ci_registered_group_runners, :integer, default: 1000, null: false) - add_column(:plan_limits, :ci_registered_project_runners, :integer, default: 1000, null: false) - end -end diff --git a/db/migrate/20210423164702_insert_runner_registration_plan_limits.rb b/db/migrate/20210423164702_insert_runner_registration_plan_limits.rb deleted file mode 100644 index 36d13dfa120..00000000000 --- a/db/migrate/20210423164702_insert_runner_registration_plan_limits.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class InsertRunnerRegistrationPlanLimits < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - create_or_update_plan_limit('ci_registered_group_runners', 'free', 50) - create_or_update_plan_limit('ci_registered_group_runners', 'bronze', 1000) - create_or_update_plan_limit('ci_registered_group_runners', 'silver', 1000) - create_or_update_plan_limit('ci_registered_group_runners', 'gold', 1000) - - create_or_update_plan_limit('ci_registered_project_runners', 'free', 50) - create_or_update_plan_limit('ci_registered_project_runners', 'bronze', 1000) - create_or_update_plan_limit('ci_registered_project_runners', 'silver', 1000) - create_or_update_plan_limit('ci_registered_project_runners', 'gold', 1000) - end - - def down - %w[group project].each do |scope| - create_or_update_plan_limit("ci_registered_#{scope}_runners", 'free', 1000) - create_or_update_plan_limit("ci_registered_#{scope}_runners", 'bronze', 1000) - create_or_update_plan_limit("ci_registered_#{scope}_runners", 'silver', 1000) - create_or_update_plan_limit("ci_registered_#{scope}_runners", 'gold', 1000) - end - end -end diff --git a/db/migrate/20210423171304_re_order_fk_source_project_id_in_merge_requests.rb b/db/migrate/20210423171304_re_order_fk_source_project_id_in_merge_requests.rb deleted file mode 100644 index ee9e444c792..00000000000 --- a/db/migrate/20210423171304_re_order_fk_source_project_id_in_merge_requests.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class ReOrderFkSourceProjectIdInMergeRequests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - OLD_SOURCE_PROJECT_FK = 'fk_3308fe130c' - NEW_SOURCE_PROJECT_FK = 'fk_source_project' - - def up - add_concurrent_foreign_key :merge_requests, :projects, column: :source_project_id, on_delete: :nullify, name: NEW_SOURCE_PROJECT_FK - - remove_foreign_key_if_exists :merge_requests, column: :source_project_id, name: OLD_SOURCE_PROJECT_FK - end - - def down - add_concurrent_foreign_key :merge_requests, :projects, column: :source_project_id, on_delete: :nullify - - remove_foreign_key_if_exists :merge_requests, column: :source_project_id, name: NEW_SOURCE_PROJECT_FK - end -end diff --git a/db/migrate/20210424115725_swap_partitioned_web_hook_logs.rb b/db/migrate/20210424115725_swap_partitioned_web_hook_logs.rb deleted file mode 100644 index 47b2f81cfae..00000000000 --- a/db/migrate/20210424115725_swap_partitioned_web_hook_logs.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class SwapPartitionedWebHookLogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::PartitioningMigrationHelpers - - DOWNTIME = false - - def up - replace_with_partitioned_table :web_hook_logs - end - - def down - rollback_replace_with_partitioned_table :web_hook_logs - end -end diff --git a/db/migrate/20210424163400_add_project_id_fk_to_timelogs.rb b/db/migrate/20210424163400_add_project_id_fk_to_timelogs.rb deleted file mode 100644 index 69542e7627d..00000000000 --- a/db/migrate/20210424163400_add_project_id_fk_to_timelogs.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class AddProjectIdFkToTimelogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_timelogs_on_project_id_and_spent_at' - - disable_ddl_transaction! - - def up - add_concurrent_index :timelogs, [:project_id, :spent_at], name: INDEX_NAME - add_concurrent_foreign_key :timelogs, :projects, column: :project_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :timelogs, column: :project_id - end - remove_concurrent_index_by_name :timelogs, INDEX_NAME - end -end diff --git a/db/migrate/20210426094524_initialize_conversion_of_ci_builds_to_bigint.rb b/db/migrate/20210426094524_initialize_conversion_of_ci_builds_to_bigint.rb deleted file mode 100644 index e2f82557387..00000000000 --- a/db/migrate/20210426094524_initialize_conversion_of_ci_builds_to_bigint.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiBuildsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :ci_builds - COLUMNS = %i(id stage_id) - TARGET_COLUMNS = COLUMNS.map { |col| "#{col}_convert_to_bigint" } - - def up - initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end -end diff --git a/db/migrate/20210427045604_initialize_conversion_of_ci_build_trace_chunks_to_bigint.rb b/db/migrate/20210427045604_initialize_conversion_of_ci_build_trace_chunks_to_bigint.rb deleted file mode 100644 index ec3bb0b7e45..00000000000 --- a/db/migrate/20210427045604_initialize_conversion_of_ci_build_trace_chunks_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiBuildTraceChunksToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :ci_build_trace_chunks - COLUMNS = %i(build_id) - - def up - initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end -end diff --git a/db/migrate/20210427062807_add_index_to_batched_migration_jobs_status.rb b/db/migrate/20210427062807_add_index_to_batched_migration_jobs_status.rb deleted file mode 100644 index c429094762e..00000000000 --- a/db/migrate/20210427062807_add_index_to_batched_migration_jobs_status.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToBatchedMigrationJobsStatus < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_batched_jobs_on_batched_migration_id_and_status' - - def up - add_concurrent_index :batched_background_migration_jobs, [:batched_background_migration_id, :status], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :batched_background_migration_jobs, INDEX_NAME - end -end diff --git a/db/migrate/20210427084924_initialize_conversion_of_ci_builds_runner_session_to_bigint.rb b/db/migrate/20210427084924_initialize_conversion_of_ci_builds_runner_session_to_bigint.rb deleted file mode 100644 index ffa653604df..00000000000 --- a/db/migrate/20210427084924_initialize_conversion_of_ci_builds_runner_session_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiBuildsRunnerSessionToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :ci_builds_runner_session - COLUMNS = %i(build_id) - - def up - initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end -end diff --git a/db/migrate/20210427094931_add_execution_order_index_to_batched_background_migration_jobs.rb b/db/migrate/20210427094931_add_execution_order_index_to_batched_background_migration_jobs.rb deleted file mode 100644 index 3622dddd27f..00000000000 --- a/db/migrate/20210427094931_add_execution_order_index_to_batched_background_migration_jobs.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddExecutionOrderIndexToBatchedBackgroundMigrationJobs < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_migration_jobs_on_migration_id_and_finished_at' - - def up - add_concurrent_index :batched_background_migration_jobs, %i(batched_background_migration_id finished_at), name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :batched_background_migration_jobs, INDEX_NAME - end -end diff --git a/db/migrate/20210427125400_add_spamcheck_api_key_to_application_setting.rb b/db/migrate/20210427125400_add_spamcheck_api_key_to_application_setting.rb deleted file mode 100644 index 9f411a61e5c..00000000000 --- a/db/migrate/20210427125400_add_spamcheck_api_key_to_application_setting.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddSpamcheckApiKeyToApplicationSetting < ActiveRecord::Migration[6.0] - def up - add_column :application_settings, :encrypted_spam_check_api_key, :binary - add_column :application_settings, :encrypted_spam_check_api_key_iv, :binary - end - - def down - remove_column :application_settings, :encrypted_spam_check_api_key - remove_column :application_settings, :encrypted_spam_check_api_key_iv - end -end diff --git a/db/migrate/20210427194958_add_description_roll_over_to_iterations_cadences.rb b/db/migrate/20210427194958_add_description_roll_over_to_iterations_cadences.rb deleted file mode 100644 index fbae2a14d2d..00000000000 --- a/db/migrate/20210427194958_add_description_roll_over_to_iterations_cadences.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddDescriptionRollOverToIterationsCadences < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - add_column :iterations_cadences, :roll_over, :boolean, null: false, default: false - add_column :iterations_cadences, :description, :text # rubocop:disable Migration/AddLimitToTextColumns - end - end - - def down - with_lock_retries do - remove_column :iterations_cadences, :roll_over - remove_column :iterations_cadences, :description - end - end -end diff --git a/db/migrate/20210427200840_add_text_limit_to_iterations_cadences_description.rb b/db/migrate/20210427200840_add_text_limit_to_iterations_cadences_description.rb deleted file mode 100644 index a146f295de3..00000000000 --- a/db/migrate/20210427200840_add_text_limit_to_iterations_cadences_description.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToIterationsCadencesDescription < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_text_limit :iterations_cadences, :description, 5000 - end - - def down - remove_text_limit :iterations_cadences, :description - end -end diff --git a/db/migrate/20210428151144_update_invalid_web_hooks.rb b/db/migrate/20210428151144_update_invalid_web_hooks.rb deleted file mode 100644 index 4f45e7aaa9b..00000000000 --- a/db/migrate/20210428151144_update_invalid_web_hooks.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class UpdateInvalidWebHooks < ActiveRecord::Migration[6.0] - disable_ddl_transaction! - - class WebHook < ActiveRecord::Base - include EachBatch - - self.table_name = 'web_hooks' - end - - def up - WebHook.each_batch(of: 10_000, column: :id) do |relation| - relation.where(type: 'ProjectHook') - .where.not(project_id: nil) - .where.not(group_id: nil) - .update_all(group_id: nil) - end - end - - def down - # no-op - end -end diff --git a/db/migrate/20210428151238_validate_foreign_key_on_group_hooks.rb b/db/migrate/20210428151238_validate_foreign_key_on_group_hooks.rb deleted file mode 100644 index e7020665b25..00000000000 --- a/db/migrate/20210428151238_validate_foreign_key_on_group_hooks.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class ValidateForeignKeyOnGroupHooks < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - CONSTRAINT_NAME = 'fk_rails_d35697648e' - - def up - validate_foreign_key :web_hooks, :group_id, name: CONSTRAINT_NAME - end - - def down - # no-op - end -end diff --git a/db/migrate/20210429024843_add_escalation_policies.rb b/db/migrate/20210429024843_add_escalation_policies.rb deleted file mode 100644 index 63bd558acfb..00000000000 --- a/db/migrate/20210429024843_add_escalation_policies.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class AddEscalationPolicies < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - UNIQUE_INDEX_NAME = 'index_on_project_id_escalation_policy_name_unique' - - def up - create_table_with_constraints :incident_management_escalation_policies do |t| - t.references :project, index: false, null: false, foreign_key: { on_delete: :cascade } - t.text :name, null: false - t.text :description, null: true - - t.text_limit :name, 72 - t.text_limit :description, 160 - t.index [:project_id, :name], unique: true, name: UNIQUE_INDEX_NAME - end - end - - def down - drop_table :incident_management_escalation_policies - end -end diff --git a/db/migrate/20210429032320_add_escalation_rules.rb b/db/migrate/20210429032320_add_escalation_rules.rb deleted file mode 100644 index 2297f7511a6..00000000000 --- a/db/migrate/20210429032320_add_escalation_rules.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddEscalationRules < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - RULE_SCHEDULE_INDEX_NAME = 'index_on_oncall_schedule_escalation_rule' - UNIQUENESS_INDEX_NAME = 'index_on_policy_schedule_status_elapsed_time_escalation_rules' - - def change - create_table :incident_management_escalation_rules do |t| - t.belongs_to :policy, index: false, null: false, foreign_key: { on_delete: :cascade, to_table: :incident_management_escalation_policies } - t.belongs_to :oncall_schedule, index: { name: RULE_SCHEDULE_INDEX_NAME }, null: false, foreign_key: { on_delete: :cascade, to_table: :incident_management_oncall_schedules } - t.integer :status, null: false, limit: 2 - t.integer :elapsed_time_seconds, null: false, limit: 4 - - t.index [:policy_id, :oncall_schedule_id, :status, :elapsed_time_seconds], unique: true, name: UNIQUENESS_INDEX_NAME - end - end -end diff --git a/db/migrate/20210429131525_create_user_credit_card_validations.rb b/db/migrate/20210429131525_create_user_credit_card_validations.rb deleted file mode 100644 index 8548274b29a..00000000000 --- a/db/migrate/20210429131525_create_user_credit_card_validations.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class CreateUserCreditCardValidations < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - with_lock_retries do - create_table :user_credit_card_validations, id: false do |t| - t.references :user, foreign_key: { on_delete: :cascade }, index: false, primary_key: true, default: nil - t.datetime_with_timezone :credit_card_validated_at, null: false - end - end - end - - def down - with_lock_retries do - drop_table :user_credit_card_validations - end - end -end diff --git a/db/migrate/20210429181325_add_failure_tracking_to_web_hooks.rb b/db/migrate/20210429181325_add_failure_tracking_to_web_hooks.rb deleted file mode 100644 index 4a34c2dd307..00000000000 --- a/db/migrate/20210429181325_add_failure_tracking_to_web_hooks.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddFailureTrackingToWebHooks < ActiveRecord::Migration[6.0] - def change - change_table(:web_hooks, bulk: true) do |t| - t.integer :recent_failures, null: false, limit: 2, default: 0 - t.integer :backoff_count, null: false, limit: 2, default: 0 - t.column :disabled_until, :timestamptz - end - end -end diff --git a/db/migrate/20210429192653_add_generic_package_duplicate_settings_to_namespace_package_settings.rb b/db/migrate/20210429192653_add_generic_package_duplicate_settings_to_namespace_package_settings.rb deleted file mode 100644 index 8c328eb52fc..00000000000 --- a/db/migrate/20210429192653_add_generic_package_duplicate_settings_to_namespace_package_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddGenericPackageDuplicateSettingsToNamespacePackageSettings < ActiveRecord::Migration[6.0] - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20210429193106_add_text_limit_to_namespace_package_settings_generic_duplicate_exception_regex - def change - add_column :namespace_package_settings, :generic_duplicates_allowed, :boolean, null: false, default: true - add_column :namespace_package_settings, :generic_duplicate_exception_regex, :text, null: false, default: '' - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20210429193106_add_text_limit_to_namespace_package_settings_generic_duplicate_exception_regex.rb b/db/migrate/20210429193106_add_text_limit_to_namespace_package_settings_generic_duplicate_exception_regex.rb deleted file mode 100644 index 5d02ad3e2f5..00000000000 --- a/db/migrate/20210429193106_add_text_limit_to_namespace_package_settings_generic_duplicate_exception_regex.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToNamespacePackageSettingsGenericDuplicateExceptionRegex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_text_limit :namespace_package_settings, :generic_duplicate_exception_regex, 255 - end - - def down - remove_text_limit :namespace_package_settings, :generic_duplicate_exception_regex - end -end diff --git a/db/migrate/20210430034712_add_alert_manager_token_to_clusters_integration_prometheus.rb b/db/migrate/20210430034712_add_alert_manager_token_to_clusters_integration_prometheus.rb deleted file mode 100644 index 48ab860a63b..00000000000 --- a/db/migrate/20210430034712_add_alert_manager_token_to_clusters_integration_prometheus.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddAlertManagerTokenToClustersIntegrationPrometheus < ActiveRecord::Migration[6.0] - def change - change_table :clusters_integration_prometheus do |t| - t.text :encrypted_alert_manager_token - t.text :encrypted_alert_manager_token_iv - end - end -end diff --git a/db/migrate/20210430100947_add_elasticsearch_username_password_to_application_settings.rb b/db/migrate/20210430100947_add_elasticsearch_username_password_to_application_settings.rb deleted file mode 100644 index 446ac93c75b..00000000000 --- a/db/migrate/20210430100947_add_elasticsearch_username_password_to_application_settings.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddElasticsearchUsernamePasswordToApplicationSettings < ActiveRecord::Migration[6.0] - def change - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20210505124816_add_text_limit_to_elasticsearch_username - add_column :application_settings, :elasticsearch_username, :text - # rubocop:enable Migration/AddLimitToTextColumns - - add_column :application_settings, :encrypted_elasticsearch_password, :binary - add_column :application_settings, :encrypted_elasticsearch_password_iv, :binary - end -end diff --git a/db/migrate/20210430121522_initialize_conversion_of_ci_build_trace_sections_to_bigint.rb b/db/migrate/20210430121522_initialize_conversion_of_ci_build_trace_sections_to_bigint.rb deleted file mode 100644 index c51ae67ebee..00000000000 --- a/db/migrate/20210430121522_initialize_conversion_of_ci_build_trace_sections_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiBuildTraceSectionsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :ci_build_trace_sections - COLUMN = :build_id - - def up - initialize_conversion_of_integer_to_bigint(TABLE, COLUMN, primary_key: COLUMN) - end - - def down - revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMN) - end -end diff --git a/db/migrate/20210430122951_add_snapshot_namespace_id.rb b/db/migrate/20210430122951_add_snapshot_namespace_id.rb deleted file mode 100644 index 9017bcdde53..00000000000 --- a/db/migrate/20210430122951_add_snapshot_namespace_id.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddSnapshotNamespaceId < ActiveRecord::Migration[6.0] - def change - add_column :analytics_devops_adoption_snapshots, :namespace_id, :integer - end -end diff --git a/db/migrate/20210430124212_add_display_namespace_id_to_segments.rb b/db/migrate/20210430124212_add_display_namespace_id_to_segments.rb deleted file mode 100644 index 43be5c719fb..00000000000 --- a/db/migrate/20210430124212_add_display_namespace_id_to_segments.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddDisplayNamespaceIdToSegments < ActiveRecord::Migration[6.0] - def change - add_column :analytics_devops_adoption_segments, :display_namespace_id, :integer - end -end diff --git a/db/migrate/20210430124630_add_devops_adoption_indexes.rb b/db/migrate/20210430124630_add_devops_adoption_indexes.rb deleted file mode 100644 index 4531e6b5e4c..00000000000 --- a/db/migrate/20210430124630_add_devops_adoption_indexes.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class AddDevopsAdoptionIndexes < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - SEGMENTS_INDEX_NAME = 'idx_devops_adoption_segments_namespaces_pair' - SNAPSHOT_END_TIME_INDEX_NAME = 'idx_devops_adoption_segments_namespace_end_time' - SNAPSHOT_RECORDED_AT_INDEX_NAME = 'idx_devops_adoption_segments_namespace_recorded_at' - - def up - add_concurrent_index :analytics_devops_adoption_snapshots, [:namespace_id, :end_time], - name: SNAPSHOT_END_TIME_INDEX_NAME - add_concurrent_index :analytics_devops_adoption_snapshots, [:namespace_id, :recorded_at], - name: SNAPSHOT_RECORDED_AT_INDEX_NAME - add_concurrent_index :analytics_devops_adoption_segments, [:display_namespace_id, :namespace_id], - unique: true, name: SEGMENTS_INDEX_NAME - - add_concurrent_foreign_key :analytics_devops_adoption_snapshots, :namespaces, column: :namespace_id - add_concurrent_foreign_key :analytics_devops_adoption_segments, :namespaces, column: :display_namespace_id - end - - def down - remove_foreign_key :analytics_devops_adoption_segments, :namespaces, column: :display_namespace_id - remove_foreign_key :analytics_devops_adoption_snapshots, :namespaces, column: :namespace_id - - remove_concurrent_index_by_name :analytics_devops_adoption_segments, SEGMENTS_INDEX_NAME - remove_concurrent_index_by_name :analytics_devops_adoption_snapshots, SNAPSHOT_RECORDED_AT_INDEX_NAME - remove_concurrent_index_by_name :analytics_devops_adoption_snapshots, SNAPSHOT_END_TIME_INDEX_NAME - end -end diff --git a/db/migrate/20210430154631_add_slice_multiplier_and_max_slices_to_elastic_reindexing_task.rb b/db/migrate/20210430154631_add_slice_multiplier_and_max_slices_to_elastic_reindexing_task.rb deleted file mode 100644 index be022c1b973..00000000000 --- a/db/migrate/20210430154631_add_slice_multiplier_and_max_slices_to_elastic_reindexing_task.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true -class AddSliceMultiplierAndMaxSlicesToElasticReindexingTask < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DEFAULT_MAX_TOTAL_SLICES_RUNNING = 60 - DEFAULT_SLICE_MULTIPLIER = 2 - - def change - add_column :elastic_reindexing_tasks, :max_slices_running, :integer, - limit: 2, - default: DEFAULT_MAX_TOTAL_SLICES_RUNNING, - null: false - add_column :elastic_reindexing_tasks, :slice_multiplier, :integer, - limit: 2, - default: DEFAULT_SLICE_MULTIPLIER, - null: false - end -end diff --git a/db/migrate/20210503105022_create_project_value_streams.rb b/db/migrate/20210503105022_create_project_value_streams.rb deleted file mode 100644 index 775ab03ad4b..00000000000 --- a/db/migrate/20210503105022_create_project_value_streams.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class CreateProjectValueStreams < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_analytics_ca_project_value_streams_on_project_id_and_name' - - def up - create_table_with_constraints :analytics_cycle_analytics_project_value_streams do |t| - t.timestamps_with_timezone - t.references(:project, - null: false, - index: false, - foreign_key: { to_table: :projects, on_delete: :cascade } - ) - t.text :name, null: false - t.index [:project_id, :name], unique: true, name: INDEX_NAME - t.text_limit :name, 100 - end - end - - def down - with_lock_retries do - drop_table :analytics_cycle_analytics_project_value_streams - end - end -end diff --git a/db/migrate/20210503105845_add_project_value_stream_id_to_project_stages.rb b/db/migrate/20210503105845_add_project_value_stream_id_to_project_stages.rb deleted file mode 100644 index d888ab4943c..00000000000 --- a/db/migrate/20210503105845_add_project_value_stream_id_to_project_stages.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class AddProjectValueStreamIdToProjectStages < ActiveRecord::Migration[6.0] - disable_ddl_transaction! - - INDEX_NAME = 'index_analytics_ca_project_stages_on_value_stream_id' - - class ProjectValueStream < ActiveRecord::Base - self.table_name = 'analytics_cycle_analytics_project_stages' - - include EachBatch - end - - def up - ProjectValueStream.reset_column_information - # The table was never used, there is no user-facing code that modifies the table, it should be empty. - # Since there is no functionality present that depends on this data, it's safe to delete the rows. - ProjectValueStream.each_batch(of: 100) do |relation| - relation.delete_all - end - - transaction do - add_reference :analytics_cycle_analytics_project_stages, :project_value_stream, null: false, index: { name: INDEX_NAME }, foreign_key: { on_delete: :cascade, to_table: :analytics_cycle_analytics_project_value_streams }, type: :bigint # rubocop: disable Migration/AddReference, Rails/NotNullColumn - end - end - - def down - remove_reference :analytics_cycle_analytics_project_stages, :project_value_stream - end -end diff --git a/db/migrate/20210503131747_add_web_hook_calls_to_plan_limits.rb b/db/migrate/20210503131747_add_web_hook_calls_to_plan_limits.rb deleted file mode 100644 index cb23c9391ea..00000000000 --- a/db/migrate/20210503131747_add_web_hook_calls_to_plan_limits.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddWebHookCallsToPlanLimits < ActiveRecord::Migration[6.0] - def change - add_column :plan_limits, :web_hook_calls, :integer, null: false, default: 0 - end -end diff --git a/db/migrate/20210504085144_add_index_on_web_hook_project_id_recent_failures.rb b/db/migrate/20210504085144_add_index_on_web_hook_project_id_recent_failures.rb deleted file mode 100644 index 898a0ccd1c5..00000000000 --- a/db/migrate/20210504085144_add_index_on_web_hook_project_id_recent_failures.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnWebHookProjectIdRecentFailures < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_web_hooks_on_project_id_recent_failures' - - disable_ddl_transaction! - - def up - add_concurrent_index(:web_hooks, [:project_id, :recent_failures], name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:web_hooks, INDEX_NAME) - end -end diff --git a/db/migrate/20210504135823_add_floc_application_settings.rb b/db/migrate/20210504135823_add_floc_application_settings.rb deleted file mode 100644 index a5e3aad6b8c..00000000000 --- a/db/migrate/20210504135823_add_floc_application_settings.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddFlocApplicationSettings < ActiveRecord::Migration[6.0] - def change - add_column :application_settings, :floc_enabled, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20210504143128_add_verification_state_and_started_at_to_mr_diff_details_table.rb b/db/migrate/20210504143128_add_verification_state_and_started_at_to_mr_diff_details_table.rb deleted file mode 100644 index 7999ea14a12..00000000000 --- a/db/migrate/20210504143128_add_verification_state_and_started_at_to_mr_diff_details_table.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationStateAndStartedAtToMrDiffDetailsTable < ActiveRecord::Migration[6.0] - def change - change_table(:merge_request_diff_details) do |t| - t.integer :verification_state, default: 0, limit: 2, null: false - t.column :verification_started_at, :datetime_with_timezone - end - end -end diff --git a/db/migrate/20210504153354_create_clusters_integration_elasticstack.rb b/db/migrate/20210504153354_create_clusters_integration_elasticstack.rb deleted file mode 100644 index 79680821060..00000000000 --- a/db/migrate/20210504153354_create_clusters_integration_elasticstack.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class CreateClustersIntegrationElasticstack < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - create_table_with_constraints :clusters_integration_elasticstack, id: false do |t| - t.timestamps_with_timezone null: false - t.references :cluster, primary_key: true, default: nil, index: false, foreign_key: { on_delete: :cascade } - t.boolean :enabled, null: false, default: false - t.text :chart_version - t.text_limit :chart_version, 10 - end - end - - def down - with_lock_retries do - drop_table :clusters_integration_elasticstack - end - end -end diff --git a/db/migrate/20210504164429_create_partial_indexes_for_pending_and_running_builds.rb b/db/migrate/20210504164429_create_partial_indexes_for_pending_and_running_builds.rb deleted file mode 100644 index af403faa278..00000000000 --- a/db/migrate/20210504164429_create_partial_indexes_for_pending_and_running_builds.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class CreatePartialIndexesForPendingAndRunningBuilds < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_PENDING = 'index_ci_builds_runner_id_pending' - INDEX_RUNNING = 'index_ci_builds_runner_id_running' - - def up - add_concurrent_index :ci_builds, :runner_id, where: "status = 'pending' AND type = 'Ci::Build'", name: INDEX_PENDING - add_concurrent_index :ci_builds, :runner_id, where: "status = 'running' AND type = 'Ci::Build'", name: INDEX_RUNNING - end - - def down - remove_concurrent_index_by_name :ci_builds, INDEX_PENDING - remove_concurrent_index_by_name :ci_builds, INDEX_RUNNING - end -end diff --git a/db/migrate/20210505070612_create_packages_debian_group_distribution_keys.rb b/db/migrate/20210505070612_create_packages_debian_group_distribution_keys.rb deleted file mode 100644 index 1e79b4e29b0..00000000000 --- a/db/migrate/20210505070612_create_packages_debian_group_distribution_keys.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class CreatePackagesDebianGroupDistributionKeys < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - INDEX_DISTRIBUTION = 'idx_pkgs_debian_group_distribution_keys_on_distribution_id' - - disable_ddl_transaction! - - def up - create_table_with_constraints :packages_debian_group_distribution_keys do |t| - t.timestamps_with_timezone - t.references :distribution, - foreign_key: { to_table: :packages_debian_group_distributions, on_delete: :cascade }, - index: { name: INDEX_DISTRIBUTION }, - null: false - - t.text :encrypted_private_key, null: false - t.text :encrypted_private_key_iv, null: false - t.text :encrypted_passphrase, null: false - t.text :encrypted_passphrase_iv, null: false - t.text :public_key, null: false - t.text :fingerprint, null: false - - t.text_limit :public_key, 512.kilobytes - t.text_limit :fingerprint, 255 - end - end - - def down - with_lock_retries do - drop_table :packages_debian_group_distribution_keys - end - end -end diff --git a/db/migrate/20210505070812_create_packages_debian_project_distribution_keys.rb b/db/migrate/20210505070812_create_packages_debian_project_distribution_keys.rb deleted file mode 100644 index f5ec01ec0d6..00000000000 --- a/db/migrate/20210505070812_create_packages_debian_project_distribution_keys.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class CreatePackagesDebianProjectDistributionKeys < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - INDEX_DISTRIBUTION = 'idx_pkgs_debian_project_distribution_keys_on_distribution_id' - - disable_ddl_transaction! - - def up - create_table_with_constraints :packages_debian_project_distribution_keys do |t| - t.timestamps_with_timezone - t.references :distribution, - foreign_key: { to_table: :packages_debian_project_distributions, on_delete: :cascade }, - index: { name: INDEX_DISTRIBUTION }, - null: false - - t.text :encrypted_private_key, null: false - t.text :encrypted_private_key_iv, null: false - t.text :encrypted_passphrase, null: false - t.text :encrypted_passphrase_iv, null: false - t.text :public_key, null: false - t.text :fingerprint, null: false - - t.text_limit :public_key, 512.kilobytes - t.text_limit :fingerprint, 255 - end - end - - def down - with_lock_retries do - drop_table :packages_debian_project_distribution_keys - end - end -end diff --git a/db/migrate/20210505124816_add_text_limit_to_elasticsearch_username.rb b/db/migrate/20210505124816_add_text_limit_to_elasticsearch_username.rb deleted file mode 100644 index 324b9193efb..00000000000 --- a/db/migrate/20210505124816_add_text_limit_to_elasticsearch_username.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToElasticsearchUsername < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_text_limit :application_settings, :elasticsearch_username, 255 - end - - def down - remove_text_limit :application_settings, :elasticsearch_username - end -end diff --git a/db/migrate/20210505170152_add_verification_indexes_to_merge_request_diff_details_table.rb b/db/migrate/20210505170152_add_verification_indexes_to_merge_request_diff_details_table.rb deleted file mode 100644 index e85a28e3fa7..00000000000 --- a/db/migrate/20210505170152_add_verification_indexes_to_merge_request_diff_details_table.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class AddVerificationIndexesToMergeRequestDiffDetailsTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - VERIFICATION_STATE_INDEX_NAME = "index_merge_request_diff_details_on_verification_state" - PENDING_VERIFICATION_INDEX_NAME = "index_merge_request_diff_details_pending_verification" - FAILED_VERIFICATION_INDEX_NAME = "index_merge_request_diff_details_failed_verification" - NEEDS_VERIFICATION_INDEX_NAME = "index_merge_request_diff_details_needs_verification" - - disable_ddl_transaction! - - def up - add_concurrent_index :merge_request_diff_details, :verification_state, name: VERIFICATION_STATE_INDEX_NAME - add_concurrent_index :merge_request_diff_details, :verified_at, where: "(verification_state = 0)", order: { verified_at: 'ASC NULLS FIRST' }, name: PENDING_VERIFICATION_INDEX_NAME - add_concurrent_index :merge_request_diff_details, :verification_retry_at, where: "(verification_state = 3)", order: { verification_retry_at: 'ASC NULLS FIRST' }, name: FAILED_VERIFICATION_INDEX_NAME - add_concurrent_index :merge_request_diff_details, :verification_state, where: "(verification_state = 0 OR verification_state = 3)", name: NEEDS_VERIFICATION_INDEX_NAME - end - - def down - remove_concurrent_index_by_name :merge_request_diff_details, VERIFICATION_STATE_INDEX_NAME - remove_concurrent_index_by_name :merge_request_diff_details, PENDING_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :merge_request_diff_details, FAILED_VERIFICATION_INDEX_NAME - remove_concurrent_index_by_name :merge_request_diff_details, NEEDS_VERIFICATION_INDEX_NAME - end -end diff --git a/db/migrate/20210506150833_create_vulnerability_finding_evidence_headers.rb b/db/migrate/20210506150833_create_vulnerability_finding_evidence_headers.rb deleted file mode 100644 index 0e584303e51..00000000000 --- a/db/migrate/20210506150833_create_vulnerability_finding_evidence_headers.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class CreateVulnerabilityFindingEvidenceHeaders < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - create_table_with_constraints :vulnerability_finding_evidence_headers do |t| - t.timestamps_with_timezone null: false - - t.references :vulnerability_finding_evidence_request, index: { name: 'finding_evidence_header_on_finding_evidence_request_id' }, null: true, foreign_key: { on_delete: :cascade } - t.references :vulnerability_finding_evidence_response, index: { name: 'finding_evidence_header_on_finding_evidence_response_id' }, null: true, foreign_key: { on_delete: :cascade } - t.text :name, null: false - t.text :value, null: false - - t.text_limit :name, 255 - t.text_limit :value, 8192 - end - end - - def down - with_lock_retries do - drop_table :vulnerability_finding_evidence_headers - end - end -end diff --git a/db/migrate/20210507191949_add_remove_on_issue_close_to_labels.rb b/db/migrate/20210507191949_add_remove_on_issue_close_to_labels.rb deleted file mode 100644 index 131edb20164..00000000000 --- a/db/migrate/20210507191949_add_remove_on_issue_close_to_labels.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddRemoveOnIssueCloseToLabels < ActiveRecord::Migration[6.0] - # This migration was reverted in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/62056 - - def up - end - - def down - end -end diff --git a/db/migrate/20210510083845_add_sha_to_status_check_response.rb b/db/migrate/20210510083845_add_sha_to_status_check_response.rb deleted file mode 100644 index 202f5ca00c1..00000000000 --- a/db/migrate/20210510083845_add_sha_to_status_check_response.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddShaToStatusCheckResponse < ActiveRecord::Migration[6.0] - def up - execute('DELETE FROM status_check_responses') - - add_column :status_check_responses, :sha, :binary, null: false # rubocop:disable Rails/NotNullColumn - end - - def down - remove_column :status_check_responses, :sha - end -end diff --git a/db/migrate/20210510191551_add_body_to_findings_evidences_request.rb b/db/migrate/20210510191551_add_body_to_findings_evidences_request.rb deleted file mode 100644 index 9b0054dbd22..00000000000 --- a/db/migrate/20210510191551_add_body_to_findings_evidences_request.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddBodyToFindingsEvidencesRequest < ActiveRecord::Migration[6.0] - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20210510191552_add_limit_to_findings_evidences_request_body.rb - def change - add_column :vulnerability_finding_evidence_requests, :body, :text - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20210510191552_add_limit_to_findings_evidences_request_body.rb b/db/migrate/20210510191552_add_limit_to_findings_evidences_request_body.rb deleted file mode 100644 index 84c8acdb10d..00000000000 --- a/db/migrate/20210510191552_add_limit_to_findings_evidences_request_body.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddLimitToFindingsEvidencesRequestBody < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_text_limit :vulnerability_finding_evidence_requests, :body, 2048 - end - - def down - remove_text_limit :vulnerability_finding_evidence_requests, :body - end -end diff --git a/db/migrate/20210511104929_add_epic_board_recent_visits_table.rb b/db/migrate/20210511104929_add_epic_board_recent_visits_table.rb deleted file mode 100644 index 9822276f9c4..00000000000 --- a/db/migrate/20210511104929_add_epic_board_recent_visits_table.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class AddEpicBoardRecentVisitsTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - unless table_exists?(:boards_epic_board_recent_visits) - create_table :boards_epic_board_recent_visits do |t| - t.references :user, index: true, null: false, foreign_key: { on_delete: :cascade } - t.references :epic_board, index: true, foreign_key: { to_table: :boards_epic_boards, on_delete: :cascade }, null: false - t.references :group, index: true, foreign_key: { to_table: :namespaces, on_delete: :cascade }, null: false - t.timestamps_with_timezone null: false - end - end - end - end - - def down - with_lock_retries do - drop_table :boards_epic_board_recent_visits - end - end -end diff --git a/db/migrate/20210511104930_add_index_to_epic_board_recent_visits.rb b/db/migrate/20210511104930_add_index_to_epic_board_recent_visits.rb deleted file mode 100644 index 1341886c50c..00000000000 --- a/db/migrate/20210511104930_add_index_to_epic_board_recent_visits.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToEpicBoardRecentVisits < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_epic_board_recent_visits_on_user_group_and_board' - - disable_ddl_transaction! - - def up - add_concurrent_index :boards_epic_board_recent_visits, - [:user_id, :group_id, :epic_board_id], - name: INDEX_NAME, - unique: true - end - - def down - remove_concurrent_index_by_name :boards_epic_board_recent_visits, INDEX_NAME - end -end diff --git a/db/migrate/20210511165250_add_foreign_key_to_lfs_objects_projects.rb b/db/migrate/20210511165250_add_foreign_key_to_lfs_objects_projects.rb deleted file mode 100644 index 4163499a553..00000000000 --- a/db/migrate/20210511165250_add_foreign_key_to_lfs_objects_projects.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToLfsObjectsProjects < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :lfs_objects_projects, :lfs_objects, column: :lfs_object_id, on_delete: :restrict, validate: false - add_concurrent_foreign_key :lfs_objects_projects, :projects, column: :project_id, on_delete: :cascade, validate: false - end - - def down - with_lock_retries do - remove_foreign_key :lfs_objects_projects, column: :lfs_object_id - remove_foreign_key :lfs_objects_projects, column: :project_id - end - end -end diff --git a/db/migrate/20210512120122_add_pending_builds_table.rb b/db/migrate/20210512120122_add_pending_builds_table.rb deleted file mode 100644 index 38e13d43b38..00000000000 --- a/db/migrate/20210512120122_add_pending_builds_table.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddPendingBuildsTable < ActiveRecord::Migration[6.0] - def up - create_table :ci_pending_builds do |t| - t.references :build, index: { unique: true }, null: false, foreign_key: { to_table: :ci_builds, on_delete: :cascade } - t.references :project, index: true, null: false, foreign_key: { on_delete: :cascade } - t.datetime_with_timezone :created_at, null: false, default: -> { 'NOW()' } - end - end - - def down - drop_table :ci_pending_builds - end -end diff --git a/db/migrate/20210512183309_add_body_to_findings_evidences_response.rb b/db/migrate/20210512183309_add_body_to_findings_evidences_response.rb deleted file mode 100644 index 6884d339b9c..00000000000 --- a/db/migrate/20210512183309_add_body_to_findings_evidences_response.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddBodyToFindingsEvidencesResponse < ActiveRecord::Migration[6.0] - # rubocop:disable Migration/AddLimitToTextColumns - # limit is added in 20210512183310_add_limit_to_findings_evidences_response_body.rb - def change - add_column :vulnerability_finding_evidence_responses, :body, :text - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20210512183310_add_limit_to_findings_evidences_response_body.rb b/db/migrate/20210512183310_add_limit_to_findings_evidences_response_body.rb deleted file mode 100644 index bdd15163809..00000000000 --- a/db/migrate/20210512183310_add_limit_to_findings_evidences_response_body.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddLimitToFindingsEvidencesResponseBody < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_text_limit :vulnerability_finding_evidence_responses, :body, 2048 - end - - def down - remove_text_limit :vulnerability_finding_evidence_responses, :body - end -end diff --git a/db/migrate/20210513093418_add_draft_column_to_merge_requests.rb b/db/migrate/20210513093418_add_draft_column_to_merge_requests.rb deleted file mode 100644 index 67e2cc0eea0..00000000000 --- a/db/migrate/20210513093418_add_draft_column_to_merge_requests.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddDraftColumnToMergeRequests < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - add_column :merge_requests, :draft, :boolean, default: false, null: false - end - end - - def down - with_lock_retries do - remove_column :merge_requests, :draft - end - end -end diff --git a/db/migrate/20210517130723_make_snapshot_segment_id_optional.rb b/db/migrate/20210517130723_make_snapshot_segment_id_optional.rb deleted file mode 100644 index a05be71a243..00000000000 --- a/db/migrate/20210517130723_make_snapshot_segment_id_optional.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class MakeSnapshotSegmentIdOptional < ActiveRecord::Migration[6.0] - def up - change_column_null(:analytics_devops_adoption_snapshots, :segment_id, true) - end - - def down - change_column_null(:analytics_devops_adoption_snapshots, :segment_id, false) - end -end diff --git a/db/migrate/20210517144856_require_snapshot_namespace.rb b/db/migrate/20210517144856_require_snapshot_namespace.rb deleted file mode 100644 index ec25c13383f..00000000000 --- a/db/migrate/20210517144856_require_snapshot_namespace.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -require Rails.root.join('db', 'post_migrate', '20210430134202_copy_adoption_snapshot_namespace.rb') - -class RequireSnapshotNamespace < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - CopyAdoptionSnapshotNamespace.new.up - - add_not_null_constraint(:analytics_devops_adoption_snapshots, :namespace_id) - end - - def down - remove_not_null_constraint(:analytics_devops_adoption_snapshots, :namespace_id) - end -end diff --git a/db/migrate/20210517221612_add_default_value_to_merge_requests_author_approval_on_projects.rb b/db/migrate/20210517221612_add_default_value_to_merge_requests_author_approval_on_projects.rb deleted file mode 100644 index 1c017a366c8..00000000000 --- a/db/migrate/20210517221612_add_default_value_to_merge_requests_author_approval_on_projects.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddDefaultValueToMergeRequestsAuthorApprovalOnProjects < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - change_column_default :projects, :merge_requests_author_approval, false - end - end - - def down - with_lock_retries do - change_column_default :projects, :merge_requests_author_approval, nil - end - end -end diff --git a/db/migrate/20210519132109_initialize_conversion_of_ci_builds_metadata_to_bigint.rb b/db/migrate/20210519132109_initialize_conversion_of_ci_builds_metadata_to_bigint.rb deleted file mode 100644 index 7ff0276b4b5..00000000000 --- a/db/migrate/20210519132109_initialize_conversion_of_ci_builds_metadata_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiBuildsMetadataToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :ci_builds_metadata - COLUMN = :build_id - - def up - initialize_conversion_of_integer_to_bigint(TABLE, COLUMN) - end - - def down - revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMN) - end -end diff --git a/db/migrate/20210519154058_schedule_update_users_where_two_factor_auth_required_from_group.rb b/db/migrate/20210519154058_schedule_update_users_where_two_factor_auth_required_from_group.rb deleted file mode 100644 index 2da84301a72..00000000000 --- a/db/migrate/20210519154058_schedule_update_users_where_two_factor_auth_required_from_group.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -class ScheduleUpdateUsersWhereTwoFactorAuthRequiredFromGroup < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - MIGRATION = 'UpdateUsersWhereTwoFactorAuthRequiredFromGroup' - DELAY_INTERVAL = 2.minutes - BATCH_SIZE = 10_000 - INDEX_NAME = 'index_users_require_two_factor_authentication_from_group_false' - - disable_ddl_transaction! - - class User < ActiveRecord::Base - include EachBatch - - self.table_name = 'users' - end - - def up - add_concurrent_index :users, - :require_two_factor_authentication_from_group, - where: 'require_two_factor_authentication_from_group = FALSE', - name: INDEX_NAME - - relation = User.where(require_two_factor_authentication_from_group: false) - - queue_background_migration_jobs_by_range_at_intervals( - relation, MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) - end - - def down - remove_concurrent_index_by_name :users, INDEX_NAME - end -end diff --git a/db/migrate/20210520102039_group_protected_environments_add_column.rb b/db/migrate/20210520102039_group_protected_environments_add_column.rb deleted file mode 100644 index 642e22c5f48..00000000000 --- a/db/migrate/20210520102039_group_protected_environments_add_column.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class GroupProtectedEnvironmentsAddColumn < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - add_column :protected_environments, :group_id, :bigint - change_column_null :protected_environments, :project_id, true - end - - def down - change_column_null :protected_environments, :project_id, false - remove_column :protected_environments, :group_id - end -end diff --git a/db/migrate/20210520133032_initialize_conversion_of_taggings_to_bigint.rb b/db/migrate/20210520133032_initialize_conversion_of_taggings_to_bigint.rb deleted file mode 100644 index e154c25b082..00000000000 --- a/db/migrate/20210520133032_initialize_conversion_of_taggings_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfTaggingsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :taggings - COLUMNS = %i(id taggable_id) - - def up - initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end -end diff --git a/db/migrate/20210520133440_backfill_taggings_for_bigint_conversion.rb b/db/migrate/20210520133440_backfill_taggings_for_bigint_conversion.rb deleted file mode 100644 index 778e186eb9c..00000000000 --- a/db/migrate/20210520133440_backfill_taggings_for_bigint_conversion.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class BackfillTaggingsForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :taggings - COLUMNS = %i(id taggable_id) - - def up - backfill_conversion_of_integer_to_bigint TABLE, COLUMNS, batch_size: 15000, sub_batch_size: 100 - end - - def down - revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMNS - end -end diff --git a/db/migrate/20210521073920_drop_devops_adoption_namespace_uniqueness.rb b/db/migrate/20210521073920_drop_devops_adoption_namespace_uniqueness.rb deleted file mode 100644 index d255ce844e2..00000000000 --- a/db/migrate/20210521073920_drop_devops_adoption_namespace_uniqueness.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class DropDevopsAdoptionNamespaceUniqueness < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_analytics_devops_adoption_segments_on_namespace_id' - NEW_INDEX_NAME = 'idx_analytics_devops_adoption_segments_on_namespace_id' - - def up - add_concurrent_index :analytics_devops_adoption_segments, :namespace_id, name: NEW_INDEX_NAME - remove_concurrent_index_by_name :analytics_devops_adoption_segments, INDEX_NAME - end - - def down - # Clean up duplicated records - execute "DELETE FROM analytics_devops_adoption_segments WHERE id NOT IN (SELECT MIN(id) FROM analytics_devops_adoption_segments GROUP BY namespace_id)" - - add_concurrent_index :analytics_devops_adoption_segments, :namespace_id, name: INDEX_NAME, unique: true - remove_concurrent_index_by_name :analytics_devops_adoption_segments, NEW_INDEX_NAME - end -end diff --git a/db/migrate/20210525085158_initialize_conversion_of_deployments_to_bigint.rb b/db/migrate/20210525085158_initialize_conversion_of_deployments_to_bigint.rb deleted file mode 100644 index 70775eb3bb5..00000000000 --- a/db/migrate/20210525085158_initialize_conversion_of_deployments_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfDeploymentsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :deployments - COLUMNS = %i(deployable_id) - - def up - initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end -end diff --git a/db/migrate/20210525085325_backfill_deployments_for_bigint_conversion.rb b/db/migrate/20210525085325_backfill_deployments_for_bigint_conversion.rb deleted file mode 100644 index 0795abf19d4..00000000000 --- a/db/migrate/20210525085325_backfill_deployments_for_bigint_conversion.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class BackfillDeploymentsForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :deployments - COLUMNS = %i(deployable_id) - - def up - backfill_conversion_of_integer_to_bigint TABLE, COLUMNS - end - - def down - revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMNS - end -end diff --git a/db/migrate/20210525100539_initialize_conversion_of_geo_job_artifact_deleted_events_to_bigint.rb b/db/migrate/20210525100539_initialize_conversion_of_geo_job_artifact_deleted_events_to_bigint.rb deleted file mode 100644 index 3e8bcf1851a..00000000000 --- a/db/migrate/20210525100539_initialize_conversion_of_geo_job_artifact_deleted_events_to_bigint.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfGeoJobArtifactDeletedEventsToBigint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - TABLE = :geo_job_artifact_deleted_events - COLUMNS = %i(job_artifact_id) - - def up - initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end -end diff --git a/db/migrate/20210525100603_backfill_geo_job_artifact_deleted_events_for_bigint_conversion.rb b/db/migrate/20210525100603_backfill_geo_job_artifact_deleted_events_for_bigint_conversion.rb deleted file mode 100644 index c2845760b5c..00000000000 --- a/db/migrate/20210525100603_backfill_geo_job_artifact_deleted_events_for_bigint_conversion.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class BackfillGeoJobArtifactDeletedEventsForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :geo_job_artifact_deleted_events - COLUMNS = %i(job_artifact_id) - - def up - backfill_conversion_of_integer_to_bigint TABLE, COLUMNS - end - - def down - revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMNS - end -end diff --git a/db/migrate/20210525184900_add_latest_pipeline_id_into_vulnerability_statistics_table.rb b/db/migrate/20210525184900_add_latest_pipeline_id_into_vulnerability_statistics_table.rb deleted file mode 100644 index 508ad92f9e5..00000000000 --- a/db/migrate/20210525184900_add_latest_pipeline_id_into_vulnerability_statistics_table.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddLatestPipelineIdIntoVulnerabilityStatisticsTable < ActiveRecord::Migration[6.0] - def change - add_column :vulnerability_statistics, :latest_pipeline_id, :bigint - end -end diff --git a/db/migrate/20210526135911_create_ci_minutes_additional_packs.rb b/db/migrate/20210526135911_create_ci_minutes_additional_packs.rb deleted file mode 100644 index 3464268a77f..00000000000 --- a/db/migrate/20210526135911_create_ci_minutes_additional_packs.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class CreateCiMinutesAdditionalPacks < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - create_table_with_constraints :ci_minutes_additional_packs, if_not_exists: true do |t| - t.timestamps_with_timezone - - t.references :namespace, index: false, null: false, foreign_key: { on_delete: :cascade } - t.date :expires_at, null: true - t.integer :number_of_minutes, null: false - t.text :purchase_xid, null: true - t.text_limit :purchase_xid, 32 - - t.index [:namespace_id, :purchase_xid], name: 'index_ci_minutes_additional_packs_on_namespace_id_purchase_xid' - end - end - - def down - with_lock_retries do - drop_table :ci_minutes_additional_packs - end - end -end diff --git a/db/migrate/20210526155257_rename_sync_security_report_approval_rules_sidekiq_queue.rb b/db/migrate/20210526155257_rename_sync_security_report_approval_rules_sidekiq_queue.rb deleted file mode 100644 index 51f234166de..00000000000 --- a/db/migrate/20210526155257_rename_sync_security_report_approval_rules_sidekiq_queue.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RenameSyncSecurityReportApprovalRulesSidekiqQueue < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - sidekiq_queue_migrate 'sync_security_reports_to_report_approval_rules', to: 'ci_sync_reports_to_report_approval_rules' # rubocop:disable Migration/SidekiqQueueMigrate - end - - def down - sidekiq_queue_migrate 'ci_sync_reports_to_report_approval_rules', to: 'sync_security_reports_to_report_approval_rules' # rubocop:disable Migration/SidekiqQueueMigrate - end -end diff --git a/db/migrate/20210526181820_add_index_to_vulnerability_statistics_on_latest_pipeline_id.rb b/db/migrate/20210526181820_add_index_to_vulnerability_statistics_on_latest_pipeline_id.rb deleted file mode 100644 index dd11b1e6f11..00000000000 --- a/db/migrate/20210526181820_add_index_to_vulnerability_statistics_on_latest_pipeline_id.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToVulnerabilityStatisticsOnLatestPipelineId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_vulnerability_statistics_on_latest_pipeline_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :vulnerability_statistics, :latest_pipeline_id, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :vulnerability_statistics, INDEX_NAME - end -end diff --git a/db/migrate/20210526181821_add_foreign_key_for_latest_pipeline_id_to_ci_pipelines.rb b/db/migrate/20210526181821_add_foreign_key_for_latest_pipeline_id_to_ci_pipelines.rb deleted file mode 100644 index adcac5e2637..00000000000 --- a/db/migrate/20210526181821_add_foreign_key_for_latest_pipeline_id_to_ci_pipelines.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyForLatestPipelineIdToCiPipelines < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :vulnerability_statistics, :ci_pipelines, column: :latest_pipeline_id, on_delete: :nullify - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :vulnerability_statistics, :ci_pipelines - end - end -end diff --git a/db/migrate/20210526190259_add_ci_daily_pipeline_schedule_triggers_to_plan_limits.rb b/db/migrate/20210526190259_add_ci_daily_pipeline_schedule_triggers_to_plan_limits.rb deleted file mode 100644 index 074bec31160..00000000000 --- a/db/migrate/20210526190259_add_ci_daily_pipeline_schedule_triggers_to_plan_limits.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddCiDailyPipelineScheduleTriggersToPlanLimits < ActiveRecord::Migration[6.0] - def change - add_column(:plan_limits, :ci_daily_pipeline_schedule_triggers, :integer, default: 0, null: false) - end -end diff --git a/db/migrate/20210526190553_insert_ci_daily_pipeline_schedule_triggers_plan_limits.rb b/db/migrate/20210526190553_insert_ci_daily_pipeline_schedule_triggers_plan_limits.rb deleted file mode 100644 index fe0969c15fb..00000000000 --- a/db/migrate/20210526190553_insert_ci_daily_pipeline_schedule_triggers_plan_limits.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class InsertCiDailyPipelineScheduleTriggersPlanLimits < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - EVERY_5_MINUTES = (1.day.in_minutes / 5).to_i - EVERY_HOUR = 1.day.in_hours.to_i - - def up - return unless Gitlab.com? - - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'free', EVERY_HOUR) - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'bronze', EVERY_5_MINUTES) - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'silver', EVERY_5_MINUTES) - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'gold', EVERY_5_MINUTES) - end - - def down - return unless Gitlab.com? - - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'free', 0) - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'bronze', 0) - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'silver', 0) - create_or_update_plan_limit('ci_daily_pipeline_schedule_triggers', 'gold', 0) - end -end diff --git a/db/migrate/20210527065005_add_index_for_cadence_iterations_automation.rb b/db/migrate/20210527065005_add_index_for_cadence_iterations_automation.rb deleted file mode 100644 index 62ccdb6a4fd..00000000000 --- a/db/migrate/20210527065005_add_index_for_cadence_iterations_automation.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexForCadenceIterationsAutomation < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'cadence_create_iterations_automation' - - disable_ddl_transaction! - - def up - # no-op - end - - def down - # no-op - end -end diff --git a/db/migrate/20210527130524_rename_experiment_subjects_group_id_to_namespace_id.rb b/db/migrate/20210527130524_rename_experiment_subjects_group_id_to_namespace_id.rb deleted file mode 100644 index 5f60a7f25c2..00000000000 --- a/db/migrate/20210527130524_rename_experiment_subjects_group_id_to_namespace_id.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RenameExperimentSubjectsGroupIdToNamespaceId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers::V2 - - disable_ddl_transaction! - - def up - rename_column_concurrently :experiment_subjects, :group_id, :namespace_id - end - - def down - undo_rename_column_concurrently :experiment_subjects, :group_id, :namespace_id - end -end diff --git a/db/migrate/20210527133919_add_diff_max_lines_to_application_settings.rb b/db/migrate/20210527133919_add_diff_max_lines_to_application_settings.rb deleted file mode 100644 index 9c1cd94dbaa..00000000000 --- a/db/migrate/20210527133919_add_diff_max_lines_to_application_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddDiffMaxLinesToApplicationSettings < ActiveRecord::Migration[6.0] - def change - add_column(:application_settings, - :diff_max_lines, - :integer, - default: 50000, - null: false) - end -end diff --git a/db/migrate/20210527134019_add_diff_max_files_to_application_settings.rb b/db/migrate/20210527134019_add_diff_max_files_to_application_settings.rb deleted file mode 100644 index 60b1f74cfd0..00000000000 --- a/db/migrate/20210527134019_add_diff_max_files_to_application_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddDiffMaxFilesToApplicationSettings < ActiveRecord::Migration[6.0] - def change - add_column(:application_settings, - :diff_max_files, - :integer, - default: 1000, - null: false) - end -end diff --git a/db/migrate/20210527185542_add_prevent_sharing_groups_outside_hierarchy_to_namespace_settings.rb b/db/migrate/20210527185542_add_prevent_sharing_groups_outside_hierarchy_to_namespace_settings.rb deleted file mode 100644 index 8fb489ac537..00000000000 --- a/db/migrate/20210527185542_add_prevent_sharing_groups_outside_hierarchy_to_namespace_settings.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddPreventSharingGroupsOutsideHierarchyToNamespaceSettings < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - add_column :namespace_settings, :prevent_sharing_groups_outside_hierarchy, :boolean, null: false, default: false - end - end - - def down - with_lock_retries do - remove_column :namespace_settings, :prevent_sharing_groups_outside_hierarchy - end - end -end diff --git a/db/migrate/20210527194558_create_ci_job_token_project_scope_links.rb b/db/migrate/20210527194558_create_ci_job_token_project_scope_links.rb deleted file mode 100644 index aaa94b9a231..00000000000 --- a/db/migrate/20210527194558_create_ci_job_token_project_scope_links.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class CreateCiJobTokenProjectScopeLinks < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - create_table :ci_job_token_project_scope_links, if_not_exists: true do |t| - t.belongs_to :source_project, index: false, null: false, foreign_key: { to_table: :projects, on_delete: :cascade } - t.belongs_to :target_project, null: false, foreign_key: { to_table: :projects, on_delete: :cascade } - t.belongs_to :added_by, foreign_key: { to_table: :users, on_delete: :nullify } - t.datetime_with_timezone :created_at, null: false - - t.index [:source_project_id, :target_project_id], unique: true, name: 'i_ci_job_token_project_scope_links_on_source_and_target_project' - end - end - end - - def down - with_lock_retries do - drop_table :ci_job_token_project_scope_links, if_exists: true - end - end -end diff --git a/db/migrate/20210529164247_change_iterations_title_uniqueness_index.rb b/db/migrate/20210529164247_change_iterations_title_uniqueness_index.rb deleted file mode 100644 index 47e7e2c757d..00000000000 --- a/db/migrate/20210529164247_change_iterations_title_uniqueness_index.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class ChangeIterationsTitleUniquenessIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_sprints_on_iterations_cadence_id_and_title' - OLD_INDEX_NAME = 'index_sprints_on_group_id_and_title' - - disable_ddl_transaction! - - def up - add_concurrent_index :sprints, [:iterations_cadence_id, :title], name: INDEX_NAME, unique: true - remove_concurrent_index_by_name :sprints, OLD_INDEX_NAME - end - - def down - # noop - # rollback would not work as we can have duplicate records once the unique `index_sprints_on_group_id_and_title` index is removed - end -end diff --git a/db/migrate/20210531053916_rename_instance_statistics_measurements.rb b/db/migrate/20210531053916_rename_instance_statistics_measurements.rb deleted file mode 100644 index 733ca296952..00000000000 --- a/db/migrate/20210531053916_rename_instance_statistics_measurements.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class RenameInstanceStatisticsMeasurements < Gitlab::Database::Migration[1.0] - enable_lock_retries! - - def up - rename_table_safely(:analytics_instance_statistics_measurements, :analytics_usage_trends_measurements) - end - - def down - undo_rename_table_safely(:analytics_instance_statistics_measurements, :analytics_usage_trends_measurements) - end -end diff --git a/db/migrate/20210531070452_default_enforce_ssh_key_expiration.rb b/db/migrate/20210531070452_default_enforce_ssh_key_expiration.rb deleted file mode 100644 index 8ddbb528962..00000000000 --- a/db/migrate/20210531070452_default_enforce_ssh_key_expiration.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class DefaultEnforceSshKeyExpiration < ActiveRecord::Migration[6.0] - def change - change_column_default(:application_settings, :enforce_ssh_key_expiration, from: false, to: true) - end -end diff --git a/db/migrate/20210531071107_enable_enforce_ssh_key_expiration.rb b/db/migrate/20210531071107_enable_enforce_ssh_key_expiration.rb deleted file mode 100644 index c164183fbf8..00000000000 --- a/db/migrate/20210531071107_enable_enforce_ssh_key_expiration.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class EnableEnforceSshKeyExpiration < ActiveRecord::Migration[6.0] - class ApplicationSetting < ActiveRecord::Base - self.table_name = 'application_settings' - end - - def up - ApplicationSetting.reset_column_information - - ApplicationSetting.where.not(enforce_ssh_key_expiration: true).each do |application_setting| - application_setting.update!(enforce_ssh_key_expiration: true) - end - end -end diff --git a/db/migrate/20210601080039_group_protected_environments_add_index_and_constraint.rb b/db/migrate/20210601080039_group_protected_environments_add_index_and_constraint.rb deleted file mode 100644 index 1109d814ee9..00000000000 --- a/db/migrate/20210601080039_group_protected_environments_add_index_and_constraint.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -class GroupProtectedEnvironmentsAddIndexAndConstraint < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_protected_environments_on_group_id_and_name' - - disable_ddl_transaction! - - def up - add_concurrent_index :protected_environments, [:group_id, :name], unique: true, - name: INDEX_NAME, where: 'group_id IS NOT NULL' - add_concurrent_foreign_key :protected_environments, :namespaces, column: :group_id, on_delete: :cascade - - add_check_constraint :protected_environments, - "((project_id IS NULL) != (group_id IS NULL))", - :protected_environments_project_or_group_existence - end - - def down - remove_group_protected_environments! - - remove_check_constraint :protected_environments, :protected_environments_project_or_group_existence - remove_foreign_key_if_exists :protected_environments, column: :group_id - remove_concurrent_index_by_name :protected_environments, name: INDEX_NAME - end - - private - - def remove_group_protected_environments! - execute <<-SQL - DELETE FROM protected_environments WHERE group_id IS NOT NULL - SQL - end -end diff --git a/db/migrate/20210601123341_add_running_builds_table.rb b/db/migrate/20210601123341_add_running_builds_table.rb deleted file mode 100644 index 4093619d2c3..00000000000 --- a/db/migrate/20210601123341_add_running_builds_table.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddRunningBuildsTable < ActiveRecord::Migration[6.0] - def up - create_table :ci_running_builds do |t| - t.references :build, index: { unique: true }, null: false, foreign_key: { to_table: :ci_builds, on_delete: :cascade } - t.references :project, index: true, null: false, foreign_key: { on_delete: :cascade } - t.references :runner, index: true, null: false, foreign_key: { to_table: :ci_runners, on_delete: :cascade } - t.datetime_with_timezone :created_at, null: false, default: -> { 'NOW()' } - t.integer :runner_type, limit: 2, null: false - end - end - - def down - drop_table :ci_running_builds - end -end diff --git a/db/migrate/20210601125410_add_runners_created_at_index.rb b/db/migrate/20210601125410_add_runners_created_at_index.rb deleted file mode 100644 index 6a6be6d8480..00000000000 --- a/db/migrate/20210601125410_add_runners_created_at_index.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# See https://docs.gitlab.com/ee/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddRunnersCreatedAtIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_runners, [:created_at, :id], order: { id: :desc }, name: 'index_ci_runners_on_created_at_and_id_desc' - add_concurrent_index :ci_runners, [:created_at, :id], order: { created_at: :desc, id: :desc }, name: 'index_ci_runners_on_created_at_desc_and_id_desc' - end - - def down - remove_concurrent_index :ci_runners, [:created_at, :id], order: { id: :desc }, name: 'index_ci_runners_on_created_at_and_id_desc' - remove_concurrent_index :ci_runners, [:created_at, :id], order: { created_at: :desc, id: :desc }, name: 'index_ci_runners_on_created_at_desc_and_id_desc' - end -end diff --git a/db/migrate/20210601131742_update_web_hook_calls_limit.rb b/db/migrate/20210601131742_update_web_hook_calls_limit.rb deleted file mode 100644 index 6af0facd17d..00000000000 --- a/db/migrate/20210601131742_update_web_hook_calls_limit.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class UpdateWebHookCallsLimit < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - return unless Gitlab.com? - - create_or_update_plan_limit('web_hook_calls', 'free', 120) - end - - def down - return unless Gitlab.com? - - create_or_update_plan_limit('web_hook_calls', 'free', 0) - end -end diff --git a/db/migrate/20210601132134_remove_partial_index_for_hashed_storage_migration.rb b/db/migrate/20210601132134_remove_partial_index_for_hashed_storage_migration.rb deleted file mode 100644 index d9793832d8c..00000000000 --- a/db/migrate/20210601132134_remove_partial_index_for_hashed_storage_migration.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RemovePartialIndexForHashedStorageMigration < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - remove_concurrent_index :projects, :id, name: 'index_on_id_partial_with_legacy_storage' - end - - def down - add_concurrent_index :projects, :id, where: 'storage_version < 2 or storage_version IS NULL', name: 'index_on_id_partial_with_legacy_storage' - end -end diff --git a/db/migrate/20210601133459_replace_runners_contacted_at_index.rb b/db/migrate/20210601133459_replace_runners_contacted_at_index.rb deleted file mode 100644 index a0a933721f0..00000000000 --- a/db/migrate/20210601133459_replace_runners_contacted_at_index.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# See https://docs.gitlab.com/ee/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class ReplaceRunnersContactedAtIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - OLD_INDEX_NAME = 'index_ci_runners_on_contacted_at' - - def up - add_concurrent_index :ci_runners, [:contacted_at, :id], order: { id: :desc }, name: 'index_ci_runners_on_contacted_at_and_id_desc', using: 'btree' - add_concurrent_index :ci_runners, [:contacted_at, :id], order: { contacted_at: :desc, id: :desc }, name: 'index_ci_runners_on_contacted_at_desc_and_id_desc', using: 'btree' - - remove_concurrent_index_by_name :ci_runners, OLD_INDEX_NAME - end - - def down - remove_concurrent_index_by_name :ci_runners, 'index_ci_runners_on_contacted_at_and_id_desc' - remove_concurrent_index_by_name :ci_runners, 'index_ci_runners_on_contacted_at_desc_and_id_desc' - - add_concurrent_index :ci_runners, :contacted_at, name: OLD_INDEX_NAME, using: 'btree' - end -end diff --git a/db/migrate/20210602122213_add_upcoming_reconciliations.rb b/db/migrate/20210602122213_add_upcoming_reconciliations.rb deleted file mode 100644 index 90d0013b357..00000000000 --- a/db/migrate/20210602122213_add_upcoming_reconciliations.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class AddUpcomingReconciliations < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - def up - with_lock_retries do - create_table :upcoming_reconciliations do |t| - t.references :namespace, index: { unique: true }, null: true, foreign_key: { on_delete: :cascade } - t.date :next_reconciliation_date, null: false - t.date :display_alert_from, null: false - - t.timestamps_with_timezone - end - end - end - - def down - with_lock_retries do - drop_table :upcoming_reconciliations - end - end -end diff --git a/db/migrate/20210602122233_add_runners_description_index.rb b/db/migrate/20210602122233_add_runners_description_index.rb deleted file mode 100644 index ae779e62f0f..00000000000 --- a/db/migrate/20210602122233_add_runners_description_index.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddRunnersDescriptionIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'index_ci_runners_on_description_trigram' - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_runners, :description, name: INDEX_NAME, using: :gin, opclass: { description: :gin_trgm_ops } - end - - def down - remove_concurrent_index_by_name :ci_runners, INDEX_NAME - end -end diff --git a/db/migrate/20210602155056_add_merge_request_diff_commit_users.rb b/db/migrate/20210602155056_add_merge_request_diff_commit_users.rb deleted file mode 100644 index f99790e0eca..00000000000 --- a/db/migrate/20210602155056_add_merge_request_diff_commit_users.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class AddMergeRequestDiffCommitUsers < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - create_table_with_constraints :merge_request_diff_commit_users, id: :bigint do |t| - t.text :name - t.text :email - - t.text_limit :name, 512 - t.text_limit :email, 512 - - t.index [:name, :email], unique: true - end - - # Names or Emails can be optional, so in some cases one of these may be - # null. But if both are NULL/empty, no row should exist in this table. - add_check_constraint( - :merge_request_diff_commit_users, - "(COALESCE(name, '') != '') OR (COALESCE(email, '') != '')", - :merge_request_diff_commit_users_name_or_email_existence - ) - end - - def down - drop_table :merge_request_diff_commit_users - end -end diff --git a/db/migrate/20210602155110_add_merge_request_diff_commit_user_columns.rb b/db/migrate/20210602155110_add_merge_request_diff_commit_user_columns.rb deleted file mode 100644 index 8cc86c7e73c..00000000000 --- a/db/migrate/20210602155110_add_merge_request_diff_commit_user_columns.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class AddMergeRequestDiffCommitUserColumns < ActiveRecord::Migration[6.1] - include Gitlab::Database::MigrationHelpers - - def up - # NOTE: these columns are _not_ indexed, nor do they use foreign keys. - # - # This is deliberate, as creating these indexes on GitLab.com takes a _very_ - # long time. In addition, there's no real need for them either based on how - # this data is used. - # - # For more information, refer to the following: - # - # - https://gitlab.com/gitlab-com/gl-infra/production/-/issues/5038#note_614592881 - # - https://gitlab.com/gitlab-org/gitlab/-/merge_requests/63669 - add_column(:merge_request_diff_commits, :commit_author_id, :bigint) - add_column(:merge_request_diff_commits, :committer_id, :bigint) - end - - def down - remove_column(:merge_request_diff_commits, :commit_author_id) - remove_column(:merge_request_diff_commits, :committer_id) - end -end diff --git a/db/migrate/20210301200959_init_schema.rb b/db/migrate/20210602155110_init_schema.rb similarity index 70% rename from db/migrate/20210301200959_init_schema.rb rename to db/migrate/20210602155110_init_schema.rb index df68927d79a..971a3e0e2db 100644 --- a/db/migrate/20210301200959_init_schema.rb +++ b/db/migrate/20210602155110_init_schema.rb @@ -4,10 +4,10 @@ class InitSchema < ActiveRecord::Migration[6.0] DOWNTIME = false def up - execute(IO.read("db/init_structure.sql")) + execute(File.read("db/init_structure.sql")) end def down - raise ActiveRecord::IrreversibleMigration, "The initial migration is not revertable" + raise ActiveRecord::IrreversibleMigration, "The initial migration is not able to be reverted." end end diff --git a/db/post_migrate/20210302074524_backfill_namespace_statistics_with_wiki_size.rb b/db/post_migrate/20210302074524_backfill_namespace_statistics_with_wiki_size.rb deleted file mode 100644 index e04f69f4206..00000000000 --- a/db/post_migrate/20210302074524_backfill_namespace_statistics_with_wiki_size.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class BackfillNamespaceStatisticsWithWikiSize < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - DELAY_INTERVAL = 2.minutes.to_i - BATCH_SIZE = 500 - MIGRATION = 'PopulateNamespaceStatistics' - - disable_ddl_transaction! - - def up - return unless Gitlab.ee? - - groups = exec_query <<~SQL - SELECT group_wiki_repositories.group_id - FROM group_wiki_repositories - SQL - - groups.rows.flatten.in_groups_of(BATCH_SIZE, false).each_with_index do |group_ids, index| - migrate_in(index * DELAY_INTERVAL, MIGRATION, [group_ids, [:wiki_size]]) - end - end - - def down - # No-op - end -end diff --git a/db/post_migrate/20210302150310_schedule_migrate_pages_to_zip_storage.rb b/db/post_migrate/20210302150310_schedule_migrate_pages_to_zip_storage.rb deleted file mode 100644 index 87c7d373329..00000000000 --- a/db/post_migrate/20210302150310_schedule_migrate_pages_to_zip_storage.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class ScheduleMigratePagesToZipStorage < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - MIGRATION = 'MigratePagesToZipStorage' - BATCH_SIZE = 10 - BATCH_TIME = 5.minutes - - disable_ddl_transaction! - - def up - # no-op - end -end diff --git a/db/post_migrate/20210303064112_add_not_null_constraints_to_gitlab_subscriptions_namespace_id.rb b/db/post_migrate/20210303064112_add_not_null_constraints_to_gitlab_subscriptions_namespace_id.rb deleted file mode 100644 index f1d2d80a0f3..00000000000 --- a/db/post_migrate/20210303064112_add_not_null_constraints_to_gitlab_subscriptions_namespace_id.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddNotNullConstraintsToGitlabSubscriptionsNamespaceId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - # This will add the `NOT NULL` constraint WITHOUT validating it - add_not_null_constraint :gitlab_subscriptions, :namespace_id, validate: false - end - - def down - # Down is required as `add_not_null_constraint` is not reversible - remove_not_null_constraint :gitlab_subscriptions, :namespace_id - end -end diff --git a/db/post_migrate/20210303064142_cleanup_gitlab_subscriptions_with_null_namespace_id.rb b/db/post_migrate/20210303064142_cleanup_gitlab_subscriptions_with_null_namespace_id.rb deleted file mode 100644 index 2250d4c0c8a..00000000000 --- a/db/post_migrate/20210303064142_cleanup_gitlab_subscriptions_with_null_namespace_id.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class CleanupGitlabSubscriptionsWithNullNamespaceId < ActiveRecord::Migration[6.0] - disable_ddl_transaction! - - class GitlabSubscription < ActiveRecord::Base - self.table_name = 'gitlab_subscriptions' - end - - def up - # As of today, there is 0 records whose namespace_id is null on GitLab.com. - # And we expect no such records on non GitLab.com instance. - # So this post-migration cleanup script is just for extra safe. - # - # This will be fast on GitLab.com, because: - # - gitlab_subscriptions.count=5021850 - # - namespace_id is indexed, so the query is pretty fast. Try on database-lab, this uses 5.931 ms - GitlabSubscription.where(namespace_id: nil).delete_all - end - - def down - # no-op : can't go back to `NULL` without first dropping the `NOT NULL` constraint - end -end diff --git a/db/post_migrate/20210303121224_update_gitlab_subscriptions_start_at_post_eoa.rb b/db/post_migrate/20210303121224_update_gitlab_subscriptions_start_at_post_eoa.rb deleted file mode 100644 index 69d99704469..00000000000 --- a/db/post_migrate/20210303121224_update_gitlab_subscriptions_start_at_post_eoa.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -class UpdateGitlabSubscriptionsStartAtPostEoa < ActiveRecord::Migration[6.0] - UPDATE_BATCH_SIZE = 100 - - disable_ddl_transaction! - - class Plan < ActiveRecord::Base - self.table_name = 'plans' - self.inheritance_column = :_type_disabled - end - - class GitlabSubscription < ActiveRecord::Base - include EachBatch - - self.table_name = 'gitlab_subscriptions' - self.inheritance_column = :_type_disabled - - EOA_ROLLOUT_DATE = '2021-01-26' - - scope :with_plan, -> (from_plan) do - where("start_date >= ? AND hosted_plan_id = ?", EOA_ROLLOUT_DATE, from_plan.id) - end - end - - def up - return unless Gitlab.com? - - silver_plan = Plan.find_by(name: 'silver') - gold_plan = Plan.find_by(name: 'gold') - premium_plan = Plan.find_by(name: 'premium') - ultimate_plan = Plan.find_by(name: 'ultimate') - - # Silver to Premium - update_hosted_plan_for_subscription(from_plan: silver_plan, to_plan: premium_plan) - - # Gold to Ultimate - update_hosted_plan_for_subscription(from_plan: gold_plan, to_plan: ultimate_plan) - end - - def down - # no-op - end - - private - - def update_hosted_plan_for_subscription(from_plan:, to_plan:) - return unless from_plan && to_plan - - GitlabSubscription.with_plan(from_plan).each_batch(of: UPDATE_BATCH_SIZE) do |batch| - batch.update_all(hosted_plan_id: to_plan.id) - end - end -end diff --git a/db/post_migrate/20210303165302_cleanup_cluster_tokens_with_null_name.rb b/db/post_migrate/20210303165302_cleanup_cluster_tokens_with_null_name.rb deleted file mode 100644 index 6553036792c..00000000000 --- a/db/post_migrate/20210303165302_cleanup_cluster_tokens_with_null_name.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class CleanupClusterTokensWithNullName < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - BATCH_SIZE = 1000 - - disable_ddl_transaction! - - class AgentToken < ActiveRecord::Base - include EachBatch - - self.table_name = 'cluster_agent_tokens' - end - - def up - AgentToken.each_batch(of: BATCH_SIZE) do |relation| - relation.where(name: nil).update_all("name = 'agent-token-' || id") - end - end - - def down - # no-op : can't go back to `NULL` without first dropping the `NOT NULL` constraint - end -end diff --git a/db/post_migrate/20210304133508_schedule_remove_duplicate_vulnerabilities_findings2.rb b/db/post_migrate/20210304133508_schedule_remove_duplicate_vulnerabilities_findings2.rb deleted file mode 100644 index 78574921fea..00000000000 --- a/db/post_migrate/20210304133508_schedule_remove_duplicate_vulnerabilities_findings2.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class ScheduleRemoveDuplicateVulnerabilitiesFindings2 < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - MIGRATION = 'RemoveDuplicateVulnerabilitiesFindings' - DELAY_INTERVAL = 2.minutes.to_i - BATCH_SIZE = 5_000 - - disable_ddl_transaction! - - class VulnerabilitiesFinding < ActiveRecord::Base - include ::EachBatch - self.table_name = "vulnerability_occurrences" - end - - def up - say "Scheduling #{MIGRATION} jobs" - queue_background_migration_jobs_by_range_at_intervals( - VulnerabilitiesFinding, - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210306121310_backfill_partitioned_web_hook_logs.rb b/db/post_migrate/20210306121310_backfill_partitioned_web_hook_logs.rb deleted file mode 100644 index 3a37d8a8510..00000000000 --- a/db/post_migrate/20210306121310_backfill_partitioned_web_hook_logs.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class BackfillPartitionedWebHookLogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::PartitioningMigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - enqueue_partitioning_data_migration :web_hook_logs - end - - def down - cleanup_partitioning_data_migration :web_hook_logs - end -end diff --git a/db/post_migrate/20210311045138_set_traversal_ids_for_gitlab_org_group_staging.rb b/db/post_migrate/20210311045138_set_traversal_ids_for_gitlab_org_group_staging.rb deleted file mode 100644 index bcf872ded54..00000000000 --- a/db/post_migrate/20210311045138_set_traversal_ids_for_gitlab_org_group_staging.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -class SetTraversalIdsForGitlabOrgGroupStaging < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - return unless Gitlab.staging? - - # namespace ID 9970 is gitlab-org on staging. - with_lock_retries do - execute(<<~SQL) - UPDATE - namespaces - SET - traversal_ids = cte.traversal_ids - FROM - ( - WITH RECURSIVE cte(id, traversal_ids, cycle) AS ( - VALUES - (9970, ARRAY[9970], false) - UNION ALL - SELECT - n.id, - cte.traversal_ids || n.id, - n.id = ANY(cte.traversal_ids) - FROM - namespaces n, - cte - WHERE - n.parent_id = cte.id - AND NOT cycle - ) - SELECT - id, - traversal_ids - FROM - cte FOR - UPDATE - ) as cte - WHERE - namespaces.id = cte.id - AND namespaces.traversal_ids <> cte.traversal_ids - SQL - end - end - - def down - return unless Gitlab.staging? - - # namespace ID 9970 is gitlab-org on staging. - with_lock_retries do - execute(<<~SQL) - UPDATE - namespaces - SET - traversal_ids = '{}' - FROM - ( - WITH RECURSIVE cte(id, traversal_ids, cycle) AS ( - VALUES - (9970, ARRAY[9970], false) - UNION ALL - SELECT - n.id, - cte.traversal_ids || n.id, - n.id = ANY(cte.traversal_ids) - FROM - namespaces n, - cte - WHERE - n.parent_id = cte.id - AND NOT cycle - ) - SELECT - id, - traversal_ids - FROM - cte FOR - UPDATE - ) as cte - WHERE - namespaces.id = cte.id - SQL - end - end -end diff --git a/db/post_migrate/20210311045139_set_traversal_ids_for_gitlab_org_group_com.rb b/db/post_migrate/20210311045139_set_traversal_ids_for_gitlab_org_group_com.rb deleted file mode 100644 index 8cef1f1cc2b..00000000000 --- a/db/post_migrate/20210311045139_set_traversal_ids_for_gitlab_org_group_com.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -class SetTraversalIdsForGitlabOrgGroupCom < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - return unless Gitlab.com? - - # namespace ID 9970 is gitlab-org on .com - with_lock_retries do - execute(<<~SQL) - UPDATE - namespaces - SET - traversal_ids = cte.traversal_ids - FROM - ( - WITH RECURSIVE cte(id, traversal_ids, cycle) AS ( - VALUES - (9970, ARRAY[9970], false) - UNION ALL - SELECT - n.id, - cte.traversal_ids || n.id, - n.id = ANY(cte.traversal_ids) - FROM - namespaces n, - cte - WHERE - n.parent_id = cte.id - AND NOT cycle - ) - SELECT - id, - traversal_ids - FROM - cte FOR - UPDATE - ) as cte - WHERE - namespaces.id = cte.id - AND namespaces.traversal_ids <> cte.traversal_ids - SQL - end - end - - def down - return unless Gitlab.com? - - # namespace ID 9970 is gitlab-org on .com - with_lock_retries do - execute(<<~SQL) - UPDATE - namespaces - SET - traversal_ids = '{}' - FROM - ( - WITH RECURSIVE cte(id, traversal_ids, cycle) AS ( - VALUES - (9970, ARRAY[9970], false) - UNION ALL - SELECT - n.id, - cte.traversal_ids || n.id, - n.id = ANY(cte.traversal_ids) - FROM - namespaces n, - cte - WHERE - n.parent_id = cte.id - AND NOT cycle - ) - SELECT - id, - traversal_ids - FROM - cte FOR - UPDATE - ) as cte - WHERE - namespaces.id = cte.id - SQL - end - end -end diff --git a/db/post_migrate/20210311093723_add_partial_index_on_ci_pipelines_by_cancelable_status_and_users.rb b/db/post_migrate/20210311093723_add_partial_index_on_ci_pipelines_by_cancelable_status_and_users.rb deleted file mode 100644 index 176548be6e6..00000000000 --- a/db/post_migrate/20210311093723_add_partial_index_on_ci_pipelines_by_cancelable_status_and_users.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class AddPartialIndexOnCiPipelinesByCancelableStatusAndUsers < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_ci_pipelines_on_user_id_and_id_and_cancelable_status' - INDEX_FILTER_CONDITION = <<~SQL - ((status)::text = ANY ( - ARRAY[ - ('running'::character varying)::text, - ('waiting_for_resource'::character varying)::text, - ('preparing'::character varying)::text, - ('pending'::character varying)::text, - ('created'::character varying)::text, - ('scheduled'::character varying)::text - ] - )) - SQL - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_pipelines, [:user_id, :id], where: INDEX_FILTER_CONDITION, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :ci_pipelines, INDEX_NAME - end -end diff --git a/db/post_migrate/20210311120155_backfill_events_id_for_bigint_conversion.rb b/db/post_migrate/20210311120155_backfill_events_id_for_bigint_conversion.rb deleted file mode 100644 index 5d31cdb05e6..00000000000 --- a/db/post_migrate/20210311120155_backfill_events_id_for_bigint_conversion.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class BackfillEventsIdForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint :events, :id, batch_size: 15000, sub_batch_size: 100 - end - - def down - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration - .where(job_class_name: 'CopyColumnUsingBackgroundMigrationJob') - .where(table_name: 'events', column_name: 'id') - .where(job_arguments: Gitlab::Json.dump(%w[id id_convert_to_bigint])) - .delete_all - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210311120156_backfill_push_event_payload_event_id_for_bigint_conversion.rb b/db/post_migrate/20210311120156_backfill_push_event_payload_event_id_for_bigint_conversion.rb deleted file mode 100644 index b64282fe0d3..00000000000 --- a/db/post_migrate/20210311120156_backfill_push_event_payload_event_id_for_bigint_conversion.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class BackfillPushEventPayloadEventIdForBigintConversion < ActiveRecord::Migration[6.0] - disable_ddl_transaction! - - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint :push_event_payloads, :event_id, primary_key: :event_id, - batch_size: 15000, sub_batch_size: 100 - end - - def down - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration - .where(job_class_name: 'CopyColumnUsingBackgroundMigrationJob') - .where(table_name: 'push_event_payloads', column_name: 'event_id') - .where(job_arguments: Gitlab::Json.dump(%w[event_id event_id_convert_to_bigint])) - .delete_all - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210317104032_set_iteration_cadence_automatic_to_false.rb b/db/post_migrate/20210317104032_set_iteration_cadence_automatic_to_false.rb deleted file mode 100644 index c151551ae64..00000000000 --- a/db/post_migrate/20210317104032_set_iteration_cadence_automatic_to_false.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class SetIterationCadenceAutomaticToFalse < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - ActiveRecord::Base.connection.execute <<~SQL - UPDATE iterations_cadences - SET automatic = FALSE - WHERE iterations_cadences.automatic = TRUE - SQL - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210317155207_validate_not_null_constraint_on_cluster_token_name.rb b/db/post_migrate/20210317155207_validate_not_null_constraint_on_cluster_token_name.rb deleted file mode 100644 index b77523c3a44..00000000000 --- a/db/post_migrate/20210317155207_validate_not_null_constraint_on_cluster_token_name.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class ValidateNotNullConstraintOnClusterTokenName < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - DOWNTIME = false - - disable_ddl_transaction! - - def up - validate_not_null_constraint :cluster_agent_tokens, :name - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210322115438_validate_not_null_constraint_on_gitlab_subscriptions_namespace_id.rb b/db/post_migrate/20210322115438_validate_not_null_constraint_on_gitlab_subscriptions_namespace_id.rb deleted file mode 100644 index 96d9f383406..00000000000 --- a/db/post_migrate/20210322115438_validate_not_null_constraint_on_gitlab_subscriptions_namespace_id.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class ValidateNotNullConstraintOnGitlabSubscriptionsNamespaceId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - validate_not_null_constraint :gitlab_subscriptions, :namespace_id - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210326121537_backfill_cleanup_for_partitioned_web_hook_logs.rb b/db/post_migrate/20210326121537_backfill_cleanup_for_partitioned_web_hook_logs.rb deleted file mode 100644 index 5816d02561e..00000000000 --- a/db/post_migrate/20210326121537_backfill_cleanup_for_partitioned_web_hook_logs.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class BackfillCleanupForPartitionedWebHookLogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::PartitioningMigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - finalize_backfilling_partitioned_table :web_hook_logs - end - - def down - # no op - end -end diff --git a/db/post_migrate/20210328214434_remove_temporary_index_from_vulnerabilities_table.rb b/db/post_migrate/20210328214434_remove_temporary_index_from_vulnerabilities_table.rb deleted file mode 100644 index f3da1cc69c4..00000000000 --- a/db/post_migrate/20210328214434_remove_temporary_index_from_vulnerabilities_table.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class RemoveTemporaryIndexFromVulnerabilitiesTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'temporary_index_vulnerabilities_on_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME - end - - def down - add_concurrent_index :vulnerabilities, :id, where: "state = 2 AND (dismissed_at IS NULL OR dismissed_by_id IS NULL)", name: INDEX_NAME - end -end diff --git a/db/post_migrate/20210329102724_add_new_trail_plans.rb b/db/post_migrate/20210329102724_add_new_trail_plans.rb deleted file mode 100644 index 37c64bbd42d..00000000000 --- a/db/post_migrate/20210329102724_add_new_trail_plans.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -class AddNewTrailPlans < ActiveRecord::Migration[6.0] - class Plan < ActiveRecord::Base - self.inheritance_column = :_type_disabled - - has_one :limits, class_name: 'PlanLimits' - - def actual_limits - self.limits || self.build_limits - end - end - - class PlanLimits < ActiveRecord::Base - self.inheritance_column = :_type_disabled - - belongs_to :plan - end - - def create_plan_limits(plan_limit_name, plan) - plan_limit = Plan.find_or_initialize_by(name: plan_limit_name).actual_limits.dup - plan_limit.plan = plan - plan_limit.save! - end - - def up - return unless Gitlab.com? - - ultimate_trial = Plan.create!(name: 'ultimate_trial', title: 'Ultimate Trial') - premium_trial = Plan.create!(name: 'premium_trial', title: 'Premium Trial') - - create_plan_limits('gold', ultimate_trial) - create_plan_limits('silver', premium_trial) - end - - def down - return unless Gitlab.com? - - Plan.where(name: %w(ultimate_trial premium_trial)).delete_all - end -end diff --git a/db/post_migrate/20210330091751_remove_records_without_group_from_webhooks_table.rb b/db/post_migrate/20210330091751_remove_records_without_group_from_webhooks_table.rb deleted file mode 100644 index c384aa25ac4..00000000000 --- a/db/post_migrate/20210330091751_remove_records_without_group_from_webhooks_table.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class RemoveRecordsWithoutGroupFromWebhooksTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - class WebHook < ActiveRecord::Base - include EachBatch - - self.table_name = 'web_hooks' - end - - class Group < ActiveRecord::Base - self.inheritance_column = :_type_disabled - self.table_name = 'namespaces' - end - - def up - subquery = Group.select(1).where(Group.arel_table[:id].eq(WebHook.arel_table[:group_id])) - - WebHook.each_batch(of: 500, column: :id) do |relation| - relation.where(type: 'GroupHook').where.not('EXISTS (?)', subquery).delete_all - end - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210330130420_drop_finding_fingerprint_table.rb b/db/post_migrate/20210330130420_drop_finding_fingerprint_table.rb deleted file mode 100644 index fd77d4d7a4b..00000000000 --- a/db/post_migrate/20210330130420_drop_finding_fingerprint_table.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -class DropFindingFingerprintTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - FINGERPRINT_IDX = :idx_vuln_fingerprints_on_occurrences_id_and_fingerprint_sha256 - UNIQ_IDX = :idx_vuln_fingerprints_uniqueness_fingerprint_sha256 - - def up - with_lock_retries do - drop_table :vulnerability_finding_fingerprints - end - end - - def down - with_lock_retries do - create_table :vulnerability_finding_fingerprints do |t| - t.references :finding, - index: true, - null: false, - foreign_key: { to_table: :vulnerability_occurrences, column: :finding_id, on_delete: :cascade } - - t.timestamps_with_timezone null: false - - t.integer :algorithm_type, null: false, limit: 2 - t.binary :fingerprint_sha256, null: false - - t.index %i[finding_id fingerprint_sha256], - name: FINGERPRINT_IDX, - unique: true # only one link should exist between occurrence and the fingerprint - - t.index %i[finding_id algorithm_type fingerprint_sha256], - name: UNIQ_IDX, - unique: true # these should be unique - end - end - end -end diff --git a/db/post_migrate/20210331105335_drop_non_partitioned_audit_events.rb b/db/post_migrate/20210331105335_drop_non_partitioned_audit_events.rb deleted file mode 100644 index 7c32fc61711..00000000000 --- a/db/post_migrate/20210331105335_drop_non_partitioned_audit_events.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -class DropNonPartitionedAuditEvents < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers - - DOWNTIME = false - - def up - drop_nonpartitioned_archive_table(:audit_events) - end - - def down - execute(<<~SQL) - CREATE TABLE audit_events_archived ( - id integer NOT NULL, - author_id integer NOT NULL, - entity_id integer NOT NULL, - entity_type character varying NOT NULL, - details text, - created_at timestamp without time zone, - ip_address inet, - author_name text, - entity_path text, - target_details text, - target_type text, - target_id bigint, - CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), - CONSTRAINT check_82294106dd CHECK ((char_length(target_type) <= 255)), - CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), - CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) - ); - - ALTER TABLE ONLY audit_events_archived ADD CONSTRAINT audit_events_archived_pkey PRIMARY KEY (id); - - CREATE INDEX analytics_index_audit_events_on_created_at_and_author_id ON audit_events_archived USING btree (created_at, author_id); - CREATE INDEX idx_audit_events_on_entity_id_desc_author_id_created_at ON audit_events_archived USING btree (entity_id, entity_type, id DESC, author_id, created_at); - SQL - - with_lock_retries do - create_trigger_to_sync_tables(:audit_events, :audit_events_archived, 'id') - end - end -end diff --git a/db/post_migrate/20210401131948_move_container_registry_enabled_to_project_features2.rb b/db/post_migrate/20210401131948_move_container_registry_enabled_to_project_features2.rb deleted file mode 100644 index ee118371fb8..00000000000 --- a/db/post_migrate/20210401131948_move_container_registry_enabled_to_project_features2.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class MoveContainerRegistryEnabledToProjectFeatures2 < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - BATCH_SIZE = 21_000 - MIGRATION = 'MoveContainerRegistryEnabledToProjectFeature' - - disable_ddl_transaction! - - class Project < ActiveRecord::Base - include EachBatch - self.table_name = 'projects' - end - - def up - # Superceded by db/post_migrate/20210415155043_move_container_registry_enabled_to_project_features3.rb. - - # delete_queued_jobs('MoveContainerRegistryEnabledToProjectFeature') - - # queue_background_migration_jobs_by_range_at_intervals(Project, MIGRATION, 2.minutes, batch_size: BATCH_SIZE, track_jobs: true) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210402005225_add_source_and_level_index_on_notification_settings.rb b/db/post_migrate/20210402005225_add_source_and_level_index_on_notification_settings.rb deleted file mode 100644 index a29babca93e..00000000000 --- a/db/post_migrate/20210402005225_add_source_and_level_index_on_notification_settings.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class AddSourceAndLevelIndexOnNotificationSettings < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_WITH_SOURCE_LEVEL_USER_NAME = 'index_notification_settings_on_source_and_level_and_user' - INDEX_WITH_SOURCE_NAME = 'index_notification_settings_on_source_id_and_source_type' - INDEX_WITH_USER_NAME = 'index_notification_settings_on_user_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :notification_settings, [:source_id, :source_type, :level, :user_id], name: INDEX_WITH_SOURCE_LEVEL_USER_NAME - remove_concurrent_index_by_name :notification_settings, INDEX_WITH_SOURCE_NAME # Above index expands this index - remove_concurrent_index_by_name :notification_settings, INDEX_WITH_USER_NAME # It is redundant as we already have unique index on (user_id, source_id, source_type) - end - - def down - add_concurrent_index :notification_settings, [:source_id, :source_type], name: INDEX_WITH_SOURCE_NAME - add_concurrent_index :notification_settings, [:user_id], name: INDEX_WITH_USER_NAME - remove_concurrent_index_by_name :notification_settings, INDEX_WITH_SOURCE_LEVEL_USER_NAME - end -end diff --git a/db/post_migrate/20210403022952_remove_notes_delete_cascade_timelogs.rb b/db/post_migrate/20210403022952_remove_notes_delete_cascade_timelogs.rb deleted file mode 100644 index 832ba584931..00000000000 --- a/db/post_migrate/20210403022952_remove_notes_delete_cascade_timelogs.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class RemoveNotesDeleteCascadeTimelogs < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - CONSTRAINT_NAME = 'fk_timelogs_note_id' - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :timelogs, :notes, column: :note_id, on_delete: :nullify, name: CONSTRAINT_NAME - - with_lock_retries do - remove_foreign_key_if_exists :timelogs, :notes, column: :note_id, on_delete: :cascade - end - end - - def down - add_concurrent_foreign_key :timelogs, :notes, column: :note_id, on_delete: :cascade - - with_lock_retries do - remove_foreign_key_if_exists :timelogs, :notes, column: :note_id, on_delete: :nullify, name: CONSTRAINT_NAME - end - end -end diff --git a/db/post_migrate/20210406144743_backfill_total_tuple_count_for_batched_migrations.rb b/db/post_migrate/20210406144743_backfill_total_tuple_count_for_batched_migrations.rb deleted file mode 100644 index 5fc5a5b2b6e..00000000000 --- a/db/post_migrate/20210406144743_backfill_total_tuple_count_for_batched_migrations.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class BackfillTotalTupleCountForBatchedMigrations < ActiveRecord::Migration[6.0] - DOWNTIME = false - - def up - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration.all.each do |migration| - total_tuple_count = Gitlab::Database::PgClass.for_table(migration.table_name)&.cardinality_estimate - - migration.update(total_tuple_count: total_tuple_count) - end - end - - def down - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration.update_all(total_tuple_count: nil) - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210407150240_confirm_support_bot_user.rb b/db/post_migrate/20210407150240_confirm_support_bot_user.rb deleted file mode 100644 index c26ae153128..00000000000 --- a/db/post_migrate/20210407150240_confirm_support_bot_user.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class ConfirmSupportBotUser < ActiveRecord::Migration[6.0] - SUPPORT_BOT_TYPE = 1 - - def up - users = Arel::Table.new(:users) - um = Arel::UpdateManager.new - um.table(users) - .where(users[:user_type].eq(SUPPORT_BOT_TYPE)) - .where(users[:confirmed_at].eq(nil)) - .set([[users[:confirmed_at], Arel::Nodes::NamedFunction.new('COALESCE', [users[:created_at], Arel::Nodes::SqlLiteral.new('NOW()')])]]) - connection.execute(um.to_sql) - end - - def down - # no op - - # The up migration allows for the possibility that the support user might - # have already been manually confirmed. It's not reversible as this data is - # subsequently lost. - end -end diff --git a/db/post_migrate/20210409185501_index_members_on_user_id_source_id_source_type.rb b/db/post_migrate/20210409185501_index_members_on_user_id_source_id_source_type.rb deleted file mode 100644 index d20eb5e4ea3..00000000000 --- a/db/post_migrate/20210409185501_index_members_on_user_id_source_id_source_type.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class IndexMembersOnUserIdSourceIdSourceType < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_members_on_user_id_source_id_source_type' - - def up - add_concurrent_index(:members, [:user_id, :source_id, :source_type], name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:members, INDEX_NAME) - end -end diff --git a/db/post_migrate/20210409185531_remove_members_index_on_user_id.rb b/db/post_migrate/20210409185531_remove_members_index_on_user_id.rb deleted file mode 100644 index 3f330e44408..00000000000 --- a/db/post_migrate/20210409185531_remove_members_index_on_user_id.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RemoveMembersIndexOnUserId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_members_on_user_id' - - def up - remove_concurrent_index_by_name(:members, INDEX_NAME) - end - - def down - add_concurrent_index(:members, :user_id, name: INDEX_NAME) - end -end diff --git a/db/post_migrate/20210413092922_add_index_to_packages_maven_metadata_path.rb b/db/post_migrate/20210413092922_add_index_to_packages_maven_metadata_path.rb deleted file mode 100644 index 697b9f9cbf7..00000000000 --- a/db/post_migrate/20210413092922_add_index_to_packages_maven_metadata_path.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToPackagesMavenMetadataPath < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_packages_maven_metadata_on_path' - - def up - add_concurrent_index :packages_maven_metadata, :path, name: INDEX_NAME - end - - def down - remove_concurrent_index :packages_maven_metadata, :path, name: INDEX_NAME - end -end diff --git a/db/post_migrate/20210413130011_add_partitioned_web_hook_log_fk.rb b/db/post_migrate/20210413130011_add_partitioned_web_hook_log_fk.rb deleted file mode 100644 index 6453993bd51..00000000000 --- a/db/post_migrate/20210413130011_add_partitioned_web_hook_log_fk.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class AddPartitionedWebHookLogFk < ActiveRecord::Migration[6.0] - include Gitlab::Database::PartitioningMigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_partitioned_foreign_key :web_hook_logs_part_0c5294f417, - :web_hooks, - column: :web_hook_id, - on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :web_hook_logs_part_0c5294f417, column: :web_hook_id - end - end -end diff --git a/db/post_migrate/20210413132500_reschedule_artifact_expiry_backfill_again.rb b/db/post_migrate/20210413132500_reschedule_artifact_expiry_backfill_again.rb deleted file mode 100644 index 0377df7a46b..00000000000 --- a/db/post_migrate/20210413132500_reschedule_artifact_expiry_backfill_again.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class RescheduleArtifactExpiryBackfillAgain < ActiveRecord::Migration[6.0] - # This migration has been disabled as it was causing a regression bug for self instances - # preventing artifact deletion, see https://gitlab.com/gitlab-org/gitlab/-/issues/355955 - - def up - # no-op - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210415074645_index_members_on_user_id_access_level_requested_at_is_null.rb b/db/post_migrate/20210415074645_index_members_on_user_id_access_level_requested_at_is_null.rb deleted file mode 100644 index fb379d48b2a..00000000000 --- a/db/post_migrate/20210415074645_index_members_on_user_id_access_level_requested_at_is_null.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class IndexMembersOnUserIdAccessLevelRequestedAtIsNull < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'index_members_on_user_id_and_access_level_requested_at_is_null' - - def up - add_concurrent_index(:members, [:user_id, :access_level], where: 'requested_at IS NULL', name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:members, INDEX_NAME) - end -end diff --git a/db/post_migrate/20210415101228_backfill_ci_build_needs_for_bigint_conversion.rb b/db/post_migrate/20210415101228_backfill_ci_build_needs_for_bigint_conversion.rb deleted file mode 100644 index 8fcaeb3fb04..00000000000 --- a/db/post_migrate/20210415101228_backfill_ci_build_needs_for_bigint_conversion.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiBuildNeedsForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint :ci_build_needs, :build_id, - batch_size: 15000, sub_batch_size: 100 - end - - def down - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration - .where(job_class_name: 'CopyColumnUsingBackgroundMigrationJob') - .where(table_name: 'ci_build_needs', column_name: 'build_id') - .where(job_arguments: Gitlab::Json.dump(%w[build_id build_id_convert_to_bigint])) - .delete_all - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210415155043_move_container_registry_enabled_to_project_features3.rb b/db/post_migrate/20210415155043_move_container_registry_enabled_to_project_features3.rb deleted file mode 100644 index f63d7c5138b..00000000000 --- a/db/post_migrate/20210415155043_move_container_registry_enabled_to_project_features3.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -class MoveContainerRegistryEnabledToProjectFeatures3 < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - BATCH_SIZE = 21_000 - MIGRATION = 'MoveContainerRegistryEnabledToProjectFeature' - - disable_ddl_transaction! - - def up - # Delete any existing jobs from the queue - delete_queued_jobs(MIGRATION) - - # Delete existing rows in background_migration_jobs table - bg_migration_job_class = define_model('background_migration_jobs') - bg_migration_job_class.where(class_name: MIGRATION).delete_all - - batchable_project_class = define_batchable_model('projects') - queue_background_migration_jobs_by_range_at_intervals(batchable_project_class, MIGRATION, 2.minutes, batch_size: BATCH_SIZE, track_jobs: true) - end - - def down - # no-op - end - - private - - def define_model(table_name) - Class.new(ActiveRecord::Base) do - self.table_name = table_name - self.inheritance_column = :_type_disabled - end - end -end diff --git a/db/post_migrate/20210420103955_remove_hipchat_service_records.rb b/db/post_migrate/20210420103955_remove_hipchat_service_records.rb deleted file mode 100644 index 5ad34cfad22..00000000000 --- a/db/post_migrate/20210420103955_remove_hipchat_service_records.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class RemoveHipchatServiceRecords < ActiveRecord::Migration[6.0] - disable_ddl_transaction! - - class Service < ActiveRecord::Base - include EachBatch - - self.table_name = 'services' - end - - def up - Service.each_batch(of: 100_000, column: :id) do |relation| - relation.delete_by(type: 'HipchatService') - end - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210420121149_backfill_conversion_of_ci_job_artifacts.rb b/db/post_migrate/20210420121149_backfill_conversion_of_ci_job_artifacts.rb deleted file mode 100644 index 0c68834f723..00000000000 --- a/db/post_migrate/20210420121149_backfill_conversion_of_ci_job_artifacts.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class BackfillConversionOfCiJobArtifacts < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint :ci_job_artifacts, %i(id job_id), batch_size: 15000, sub_batch_size: 100 - end - - def down - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration - .where(job_class_name: 'CopyColumnUsingBackgroundMigrationJob') - .where(table_name: 'ci_job_artifacts', column_name: 'id') - .where(job_arguments: Gitlab::Json.dump([%w[id job_id], %w[id_convert_to_bigint job_id_convert_to_bigint]])) - .delete_all - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210421163509_schedule_update_jira_tracker_data_deployment_type_based_on_url.rb b/db/post_migrate/20210421163509_schedule_update_jira_tracker_data_deployment_type_based_on_url.rb deleted file mode 100644 index 0f6cf970778..00000000000 --- a/db/post_migrate/20210421163509_schedule_update_jira_tracker_data_deployment_type_based_on_url.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class ScheduleUpdateJiraTrackerDataDeploymentTypeBasedOnUrl < ActiveRecord::Migration[6.0] - def up - # no-op (being re-run in 20220324152945_update_jira_tracker_data_deployment_type_based_on_url.rb) - # due to this migration causing this issue: https://gitlab.com/gitlab-org/gitlab/-/issues/336849 - # The migration is rescheduled in - # db/post_migrate/20220725150127_update_jira_tracker_data_deployment_type_based_on_url.rb - # Related discussion: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/82103#note_862401816 - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210422023046_backfill_ci_sources_pipelines_source_job_id_for_bigint_conversion.rb b/db/post_migrate/20210422023046_backfill_ci_sources_pipelines_source_job_id_for_bigint_conversion.rb deleted file mode 100644 index 3c6f2385f1d..00000000000 --- a/db/post_migrate/20210422023046_backfill_ci_sources_pipelines_source_job_id_for_bigint_conversion.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiSourcesPipelinesSourceJobIdForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint :ci_sources_pipelines, :source_job_id, - batch_size: 15000, sub_batch_size: 100 - end - - def down - return unless should_run? - - Gitlab::Database::BackgroundMigration::BatchedMigration - .where(job_class_name: 'CopyColumnUsingBackgroundMigrationJob') - .where(table_name: 'ci_sources_pipelines', column_name: 'id') - .where(job_arguments: Gitlab::Json.dump([%w[source_job_id], %w[source_job_id_convert_to_bigint]])) - .delete_all - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210423124223_remove_proxy_settings_to_jira_tracker_data.rb b/db/post_migrate/20210423124223_remove_proxy_settings_to_jira_tracker_data.rb deleted file mode 100644 index 43ab965d79c..00000000000 --- a/db/post_migrate/20210423124223_remove_proxy_settings_to_jira_tracker_data.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class RemoveProxySettingsToJiraTrackerData < ActiveRecord::Migration[6.0] - def change - remove_column :jira_tracker_data, :encrypted_proxy_address, :text - remove_column :jira_tracker_data, :encrypted_proxy_address_iv, :text - remove_column :jira_tracker_data, :encrypted_proxy_port, :text - remove_column :jira_tracker_data, :encrypted_proxy_port_iv, :text - remove_column :jira_tracker_data, :encrypted_proxy_username, :text - remove_column :jira_tracker_data, :encrypted_proxy_username_iv, :text - remove_column :jira_tracker_data, :encrypted_proxy_password, :text - remove_column :jira_tracker_data, :encrypted_proxy_password_iv, :text - end -end diff --git a/db/post_migrate/20210423160427_schedule_drop_invalid_vulnerabilities.rb b/db/post_migrate/20210423160427_schedule_drop_invalid_vulnerabilities.rb deleted file mode 100644 index 8199da937d3..00000000000 --- a/db/post_migrate/20210423160427_schedule_drop_invalid_vulnerabilities.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class ScheduleDropInvalidVulnerabilities < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - MIGRATION = 'DropInvalidVulnerabilities' - DELAY_INTERVAL = 2.minutes.to_i - BATCH_SIZE = 10_000 - - disable_ddl_transaction! - - def up - say "Scheduling #{MIGRATION} jobs" - queue_background_migration_jobs_by_range_at_intervals( - define_batchable_model('vulnerabilities'), - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210426094549_backfill_ci_builds_for_bigint_conversion.rb b/db/post_migrate/20210426094549_backfill_ci_builds_for_bigint_conversion.rb deleted file mode 100644 index fd071ec9a1a..00000000000 --- a/db/post_migrate/20210426094549_backfill_ci_builds_for_bigint_conversion.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiBuildsForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - TABLE = :ci_builds - COLUMNS = %i(id stage_id).freeze - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint TABLE, COLUMNS, batch_size: 15000, sub_batch_size: 100 - end - - def down - return unless should_run? - - revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMNS - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210426225417_schedule_recalculate_uuid_on_vulnerabilities_occurrences2.rb b/db/post_migrate/20210426225417_schedule_recalculate_uuid_on_vulnerabilities_occurrences2.rb deleted file mode 100644 index 0e85fb40a36..00000000000 --- a/db/post_migrate/20210426225417_schedule_recalculate_uuid_on_vulnerabilities_occurrences2.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class ScheduleRecalculateUuidOnVulnerabilitiesOccurrences2 < ActiveRecord::Migration[6.0] - def up - # no-op - # superseded by db/post_migrate/20211207125231_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210427045711_backfill_ci_build_trace_chunks_for_bigint_conversion.rb b/db/post_migrate/20210427045711_backfill_ci_build_trace_chunks_for_bigint_conversion.rb deleted file mode 100644 index 7e11d38868b..00000000000 --- a/db/post_migrate/20210427045711_backfill_ci_build_trace_chunks_for_bigint_conversion.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiBuildTraceChunksForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :ci_build_trace_chunks - COLUMNS = %i(build_id) - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - return unless should_run? - - revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210427085020_backfill_ci_builds_runner_session_for_bigint_conversion.rb b/db/post_migrate/20210427085020_backfill_ci_builds_runner_session_for_bigint_conversion.rb deleted file mode 100644 index fa0420fe426..00000000000 --- a/db/post_migrate/20210427085020_backfill_ci_builds_runner_session_for_bigint_conversion.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiBuildsRunnerSessionForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :ci_builds_runner_session - COLUMNS = %i(build_id) - - def up - return unless should_run? - - backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - return unless should_run? - - revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - private - - def should_run? - Gitlab.dev_or_test_env? || Gitlab.com? - end -end diff --git a/db/post_migrate/20210427212034_schedule_update_timelogs_project_id.rb b/db/post_migrate/20210427212034_schedule_update_timelogs_project_id.rb deleted file mode 100644 index 13b802f7cb4..00000000000 --- a/db/post_migrate/20210427212034_schedule_update_timelogs_project_id.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class ScheduleUpdateTimelogsProjectId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - BATCH_SIZE = 50_000 - DELAY_INTERVAL = 2.minutes - MIGRATION = 'UpdateTimelogsProjectId' - - disable_ddl_transaction! - - class Timelog < ActiveRecord::Base - include EachBatch - - self.table_name = 'timelogs' - self.inheritance_column = :_type_disabled - end - - def up - queue_background_migration_jobs_by_range_at_intervals( - Timelog.all, - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210429143649_add_new_issues_index_for_relative_position.rb b/db/post_migrate/20210429143649_add_new_issues_index_for_relative_position.rb deleted file mode 100644 index 50785fa94f8..00000000000 --- a/db/post_migrate/20210429143649_add_new_issues_index_for_relative_position.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddNewIssuesIndexForRelativePosition < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - INDEX_NAME = 'idx_issues_on_project_id_and_rel_asc_and_id' - - def up - add_concurrent_index :issues, [:project_id, :relative_position, :id], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name(:issues, INDEX_NAME) - end -end diff --git a/db/post_migrate/20210430121542_backfill_ci_build_trace_sections_for_bigint_conversion.rb b/db/post_migrate/20210430121542_backfill_ci_build_trace_sections_for_bigint_conversion.rb deleted file mode 100644 index 340dceda254..00000000000 --- a/db/post_migrate/20210430121542_backfill_ci_build_trace_sections_for_bigint_conversion.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiBuildTraceSectionsForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :ci_build_trace_sections - COLUMN = :build_id - - def up - # No-op to disable the migration: - # backfill_conversion_of_integer_to_bigint TABLE, COLUMN, batch_size: 15000, sub_batch_size: 100, primary_key: COLUMN - end - - def down - revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMN, primary_key: COLUMN - end -end diff --git a/db/post_migrate/20210430130259_remove_obsolete_segments_field.rb b/db/post_migrate/20210430130259_remove_obsolete_segments_field.rb deleted file mode 100644 index ffdd84582cb..00000000000 --- a/db/post_migrate/20210430130259_remove_obsolete_segments_field.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class RemoveObsoleteSegmentsField < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - with_lock_retries do - remove_column :analytics_devops_adoption_segments, :name - end - end - - def down - add_column :analytics_devops_adoption_segments, :name, :text - add_text_limit :analytics_devops_adoption_segments, :name, 255 - end -end diff --git a/db/post_migrate/20210430134202_copy_adoption_snapshot_namespace.rb b/db/post_migrate/20210430134202_copy_adoption_snapshot_namespace.rb deleted file mode 100644 index d0a72ff2c43..00000000000 --- a/db/post_migrate/20210430134202_copy_adoption_snapshot_namespace.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class CopyAdoptionSnapshotNamespace < ActiveRecord::Migration[6.0] - def up - execute <<-SQL - UPDATE analytics_devops_adoption_snapshots snapshots - SET namespace_id = segments.namespace_id - FROM analytics_devops_adoption_segments segments - WHERE snapshots.namespace_id IS NULL AND segments.id = snapshots.segment_id - SQL - end - - def down - execute 'UPDATE analytics_devops_adoption_snapshots SET namespace_id = NULL' - end -end diff --git a/db/post_migrate/20210430135954_copy_adoption_segments_namespace.rb b/db/post_migrate/20210430135954_copy_adoption_segments_namespace.rb deleted file mode 100644 index 04f454bea37..00000000000 --- a/db/post_migrate/20210430135954_copy_adoption_segments_namespace.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class CopyAdoptionSegmentsNamespace < ActiveRecord::Migration[6.0] - def up - execute <<-SQL - UPDATE analytics_devops_adoption_segments SET display_namespace_id = namespace_id - WHERE display_namespace_id IS NULL - SQL - end - - def down - execute 'UPDATE analytics_devops_adoption_segments SET display_namespace_id = NULL' - end -end diff --git a/db/post_migrate/20210505092746_create_partial_covering_index_for_pending_builds.rb b/db/post_migrate/20210505092746_create_partial_covering_index_for_pending_builds.rb deleted file mode 100644 index 81fe65c1945..00000000000 --- a/db/post_migrate/20210505092746_create_partial_covering_index_for_pending_builds.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class CreatePartialCoveringIndexForPendingBuilds < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - EXISTING_INDEX = 'index_ci_builds_runner_id_pending' - NEW_INDEX = 'index_ci_builds_runner_id_pending_covering' - - def up - disable_statement_timeout do - execute "CREATE INDEX CONCURRENTLY #{NEW_INDEX} ON ci_builds (runner_id, id) INCLUDE (project_id) WHERE status = 'pending' AND type = 'Ci::Build'" unless index_exists_by_name?(:ci_builds, NEW_INDEX) - end - - remove_concurrent_index_by_name :ci_builds, EXISTING_INDEX - end - - def down - add_concurrent_index :ci_builds, :runner_id, where: "status = 'pending' AND type = 'Ci::Build'", name: EXISTING_INDEX - - remove_concurrent_index_by_name :ci_builds, NEW_INDEX - end -end diff --git a/db/post_migrate/20210506064413_create_namespaces_id_parent_id_inverse_partial_index.rb b/db/post_migrate/20210506064413_create_namespaces_id_parent_id_inverse_partial_index.rb deleted file mode 100644 index 151b0f64e80..00000000000 --- a/db/post_migrate/20210506064413_create_namespaces_id_parent_id_inverse_partial_index.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreateNamespacesIdParentIdInversePartialIndex < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - NAME = 'index_namespaces_id_parent_id_is_not_null' - - disable_ddl_transaction! - - def up - add_concurrent_index :namespaces, :id, where: 'parent_id IS NOT NULL', name: NAME - end - - def down - remove_concurrent_index :namespaces, :id, name: NAME - end -end diff --git a/db/post_migrate/20210506065000_schedule_backfill_traversal_ids.rb b/db/post_migrate/20210506065000_schedule_backfill_traversal_ids.rb deleted file mode 100644 index 5ae80c1da80..00000000000 --- a/db/post_migrate/20210506065000_schedule_backfill_traversal_ids.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -class ScheduleBackfillTraversalIds < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - ROOTS_MIGRATION = 'BackfillNamespaceTraversalIdsRoots' - CHILDREN_MIGRATION = 'BackfillNamespaceTraversalIdsChildren' - DOWNTIME = false - BATCH_SIZE = 1_000 - SUB_BATCH_SIZE = 100 - DELAY_INTERVAL = 2.minutes - - disable_ddl_transaction! - - def up - # Personal namespaces and top-level groups - final_delay = queue_background_migration_jobs_by_range_at_intervals( - ::Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsRoots::Namespace.base_query, - ROOTS_MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE, - other_job_arguments: [SUB_BATCH_SIZE], - track_jobs: true - ) - final_delay += DELAY_INTERVAL - - # Subgroups - queue_background_migration_jobs_by_range_at_intervals( - ::Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsChildren::Namespace.base_query, - CHILDREN_MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE, - initial_delay: final_delay, - other_job_arguments: [SUB_BATCH_SIZE], - track_jobs: true - ) - end -end diff --git a/db/post_migrate/20210511095657_add_temporary_index_for_project_topics_to_taggings.rb b/db/post_migrate/20210511095657_add_temporary_index_for_project_topics_to_taggings.rb deleted file mode 100644 index 0d807df614c..00000000000 --- a/db/post_migrate/20210511095657_add_temporary_index_for_project_topics_to_taggings.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddTemporaryIndexForProjectTopicsToTaggings < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_project_and_tags' - INDEX_CONDITION = "taggable_type = 'Project' AND context = 'tags'" - - disable_ddl_transaction! - - def up - # this index is used in 20210511095658_schedule_migrate_project_taggings_context_from_tags_to_topics - add_concurrent_index :taggings, :id, where: INDEX_CONDITION, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :taggings, INDEX_NAME - end -end diff --git a/db/post_migrate/20210511095658_schedule_migrate_project_taggings_context_from_tags_to_topics.rb b/db/post_migrate/20210511095658_schedule_migrate_project_taggings_context_from_tags_to_topics.rb deleted file mode 100644 index 25d23b771d5..00000000000 --- a/db/post_migrate/20210511095658_schedule_migrate_project_taggings_context_from_tags_to_topics.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class ScheduleMigrateProjectTaggingsContextFromTagsToTopics < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - BATCH_SIZE = 30_000 - DELAY_INTERVAL = 2.minutes - MIGRATION = 'MigrateProjectTaggingsContextFromTagsToTopics' - - disable_ddl_transaction! - - class Tagging < ActiveRecord::Base - include ::EachBatch - - self.table_name = 'taggings' - end - - def up - queue_background_migration_jobs_by_range_at_intervals( - Tagging.where(taggable_type: 'Project', context: 'tags'), - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE - ) - end - - def down - end -end diff --git a/db/post_migrate/20210511142748_schedule_drop_invalid_vulnerabilities2.rb b/db/post_migrate/20210511142748_schedule_drop_invalid_vulnerabilities2.rb deleted file mode 100644 index 09886b85571..00000000000 --- a/db/post_migrate/20210511142748_schedule_drop_invalid_vulnerabilities2.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class ScheduleDropInvalidVulnerabilities2 < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - MIGRATION = 'DropInvalidVulnerabilities' - DELAY_INTERVAL = 2.minutes.to_i - BATCH_SIZE = 10_000 - - disable_ddl_transaction! - - def up - queue_background_migration_jobs_by_range_at_intervals( - define_batchable_model('vulnerabilities'), - MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE, - track_jobs: true - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210513155447_add_temporary_package_index_for_nuget_data_migration.rb b/db/post_migrate/20210513155447_add_temporary_package_index_for_nuget_data_migration.rb deleted file mode 100644 index b43abab2a96..00000000000 --- a/db/post_migrate/20210513155447_add_temporary_package_index_for_nuget_data_migration.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddTemporaryPackageIndexForNugetDataMigration < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'tmp_index_packages_on_id_where_nuget_default_temp_package' - INDEX_CONDITION = "package_type = 4 AND name = 'NuGet.Temporary.Package' AND status = 0" - - disable_ddl_transaction! - - def up - # this index is used in 20210513155546_backfill_nuget_temporary_packages_to_processing_status - add_concurrent_index :packages_packages, :id, where: INDEX_CONDITION, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :packages_packages, INDEX_NAME - end -end diff --git a/db/post_migrate/20210513155546_backfill_nuget_temporary_packages_to_processing_status.rb b/db/post_migrate/20210513155546_backfill_nuget_temporary_packages_to_processing_status.rb deleted file mode 100644 index 8124f94b519..00000000000 --- a/db/post_migrate/20210513155546_backfill_nuget_temporary_packages_to_processing_status.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class BackfillNugetTemporaryPackagesToProcessingStatus < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - class Package < ActiveRecord::Base - include EachBatch - - self.table_name = 'packages_packages' - - scope :nuget_temporary_packages, -> do - # 4 is nuget package type, 0 is default status - where(package_type: 4, name: 'NuGet.Temporary.Package', status: 0) - end - end - - def up - Package.nuget_temporary_packages.each_batch(of: 100) do |batch| - # 2 is processing status - batch.update_all(status: 2) - end - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210513155635_remove_temporary_package_index_for_nuget_data_migration.rb b/db/post_migrate/20210513155635_remove_temporary_package_index_for_nuget_data_migration.rb deleted file mode 100644 index eb0abba5112..00000000000 --- a/db/post_migrate/20210513155635_remove_temporary_package_index_for_nuget_data_migration.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveTemporaryPackageIndexForNugetDataMigration < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'tmp_index_packages_on_id_where_nuget_default_temp_package' - INDEX_CONDITION = "package_type = 4 AND name = 'NuGet.Temporary.Package' AND status = 0" - - disable_ddl_transaction! - - def up - # this index was used in 20210513155546_backfill_nuget_temporary_packages_to_processing_status - remove_concurrent_index_by_name :packages_packages, INDEX_NAME - end - - def down - add_concurrent_index :packages_packages, :id, where: INDEX_CONDITION, name: INDEX_NAME - end -end diff --git a/db/post_migrate/20210513163904_cleanup_move_container_registry_enabled_to_project_feature.rb b/db/post_migrate/20210513163904_cleanup_move_container_registry_enabled_to_project_feature.rb deleted file mode 100644 index 665d274a0ee..00000000000 --- a/db/post_migrate/20210513163904_cleanup_move_container_registry_enabled_to_project_feature.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -class CleanupMoveContainerRegistryEnabledToProjectFeature < ActiveRecord::Migration[6.0] - MIGRATION = 'MoveContainerRegistryEnabledToProjectFeature' - - disable_ddl_transaction! - - def up - Gitlab::BackgroundMigration.steal(MIGRATION) - - bg_migration_job_class = define_background_migration_jobs_class - bg_migration_job_class.where(class_name: MIGRATION, status: bg_migration_job_class.statuses['pending']).each do |job| - Gitlab::BackgroundMigration::MoveContainerRegistryEnabledToProjectFeature.new.perform(*job.arguments) - end - - bg_migration_job_class.where(class_name: MIGRATION).delete_all - end - - def down - # no-op - end - - private - - def define_background_migration_jobs_class - Class.new(ActiveRecord::Base) do - self.table_name = 'background_migration_jobs' - self.inheritance_column = :_type_disabled - - enum status: { - pending: 0, - succeeded: 1 - } - end - end -end diff --git a/db/post_migrate/20210514063252_schedule_cleanup_orphaned_lfs_objects_projects.rb b/db/post_migrate/20210514063252_schedule_cleanup_orphaned_lfs_objects_projects.rb deleted file mode 100644 index 76e4a0a95bb..00000000000 --- a/db/post_migrate/20210514063252_schedule_cleanup_orphaned_lfs_objects_projects.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class ScheduleCleanupOrphanedLfsObjectsProjects < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - MIGRATION = 'CleanupOrphanedLfsObjectsProjects' - DELAY_INTERVAL = 2.minutes - BATCH_SIZE = 50_000 - - disable_ddl_transaction! - - class LfsObjectsProject < ActiveRecord::Base - self.table_name = 'lfs_objects_projects' - - include ::EachBatch - end - - def up - queue_background_migration_jobs_by_range_at_intervals(LfsObjectsProject, MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) - end - - def down - # NOOP - end -end diff --git a/db/post_migrate/20210517075444_remove_temporary_index_for_project_topics_to_taggings.rb b/db/post_migrate/20210517075444_remove_temporary_index_for_project_topics_to_taggings.rb deleted file mode 100644 index bfd09653695..00000000000 --- a/db/post_migrate/20210517075444_remove_temporary_index_for_project_topics_to_taggings.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveTemporaryIndexForProjectTopicsToTaggings < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_project_and_tags' - INDEX_CONDITION = "taggable_type = 'Project' AND context = 'tags'" - - disable_ddl_transaction! - - def up - # this index was used in 20210511095658_schedule_migrate_project_taggings_context_from_tags_to_topics - remove_concurrent_index_by_name :taggings, INDEX_NAME - end - - def down - add_concurrent_index :taggings, :id, where: INDEX_CONDITION, name: INDEX_NAME - end -end diff --git a/db/post_migrate/20210518001450_backfill_clusters_integration_elastic_stack_enabled.rb b/db/post_migrate/20210518001450_backfill_clusters_integration_elastic_stack_enabled.rb deleted file mode 100644 index 6d21945af00..00000000000 --- a/db/post_migrate/20210518001450_backfill_clusters_integration_elastic_stack_enabled.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -class BackfillClustersIntegrationElasticStackEnabled < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - ApplicationRecord.connection.execute(<<~SQL.squish) - INSERT INTO clusters_integration_elasticstack( - cluster_id, - enabled, - chart_version, - created_at, - updated_at - ) - SELECT - cluster_id, - true, - version, - TIMEZONE('UTC', NOW()), - TIMEZONE('UTC', NOW()) - FROM clusters_applications_elastic_stacks - WHERE status IN (3, 11) - ON CONFLICT(cluster_id) DO UPDATE SET - enabled = true, - updated_at = TIMEZONE('UTC', NOW()) - SQL - end - - def down - # Irreversible - end -end diff --git a/db/post_migrate/20210518074332_schedule_disable_expiration_policies_linked_to_no_container_images.rb b/db/post_migrate/20210518074332_schedule_disable_expiration_policies_linked_to_no_container_images.rb deleted file mode 100644 index 8583f8541c7..00000000000 --- a/db/post_migrate/20210518074332_schedule_disable_expiration_policies_linked_to_no_container_images.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class ScheduleDisableExpirationPoliciesLinkedToNoContainerImages < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - BATCH_SIZE = 30_000 - DELAY = 2.minutes.freeze - DOWNTIME = false - MIGRATION = 'DisableExpirationPoliciesLinkedToNoContainerImages' - - disable_ddl_transaction! - - def up - queue_background_migration_jobs_by_range_at_intervals( - define_batchable_model('container_expiration_policies').where(enabled: true), - MIGRATION, - DELAY, - batch_size: BATCH_SIZE, - track_jobs: false, - primary_column_name: :project_id - ) - end - - def down - # this migration is irreversible - - # we can't accuretaly know which policies were previously enabled during the background migration - end -end diff --git a/db/post_migrate/20210519104931_backfill_clusters_integration_prometheus_enabled.rb b/db/post_migrate/20210519104931_backfill_clusters_integration_prometheus_enabled.rb deleted file mode 100644 index 6cd9b1173b6..00000000000 --- a/db/post_migrate/20210519104931_backfill_clusters_integration_prometheus_enabled.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -class BackfillClustersIntegrationPrometheusEnabled < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - ApplicationRecord.connection.execute(<<~SQL.squish) - WITH executed_at AS (VALUES (TIMEZONE('UTC', NOW()))) - INSERT INTO clusters_integration_prometheus( - cluster_id, - enabled, - encrypted_alert_manager_token, - encrypted_alert_manager_token_iv, - created_at, - updated_at - ) - SELECT - cluster_id, - true, - encrypted_alert_manager_token, - encrypted_alert_manager_token_iv, - (table executed_at), - (table executed_at) - FROM clusters_applications_prometheus - WHERE status IN ( - 3, /* installed */ - 11 /* externally installed */ - ) - ON CONFLICT(cluster_id) DO UPDATE SET - enabled = true, - encrypted_alert_manager_token = EXCLUDED.encrypted_alert_manager_token, - encrypted_alert_manager_token_iv = EXCLUDED.encrypted_alert_manager_token_iv, - updated_at = (table executed_at) - SQL - end - - def down - # Irreversible - end -end diff --git a/db/post_migrate/20210519132129_backfill_ci_builds_metadata_for_bigint_conversion.rb b/db/post_migrate/20210519132129_backfill_ci_builds_metadata_for_bigint_conversion.rb deleted file mode 100644 index 39dd78975da..00000000000 --- a/db/post_migrate/20210519132129_backfill_ci_builds_metadata_for_bigint_conversion.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiBuildsMetadataForBigintConversion < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TABLE = :ci_builds_metadata - COLUMN = :build_id - - def up - backfill_conversion_of_integer_to_bigint TABLE, COLUMN, batch_size: 15000, sub_batch_size: 100 - end - - def down - revert_backfill_conversion_of_integer_to_bigint TABLE, COLUMN - end -end diff --git a/db/post_migrate/20210519220019_backfill_escalation_policies_for_oncall_schedules.rb b/db/post_migrate/20210519220019_backfill_escalation_policies_for_oncall_schedules.rb deleted file mode 100644 index f972815cf67..00000000000 --- a/db/post_migrate/20210519220019_backfill_escalation_policies_for_oncall_schedules.rb +++ /dev/null @@ -1,89 +0,0 @@ -# frozen_string_literal: true - -class BackfillEscalationPoliciesForOncallSchedules < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - # Creates a single new escalation policy for projects which have - # existing on-call schedules. Only one schedule is expected - # per project, but it is possible to have multiple. - # - # An escalation rule is created for each existing schedule, - # configured to immediately notify the schedule of an incoming - # alert payload unless the alert has already been acknowledged. - # For projects with multiple schedules, the name of the first saved - # schedule will be used for the policy's description. - # - # Skips projects which already have escalation policies & schedules. - # - # EX) - # For these existing records: - # Project #3 - # IncidentManagement::OncallSchedules #13 - # project_id: 3 - # name: 'Awesome Schedule' - # description: null - # IncidentManagement::OncallSchedules #14 - # project_id: 3 - # name: '2ndary sched' - # description: 'Backup on-call' - # - # These will be inserted: - # EscalationPolicy #1 - # project_id: 3 - # name: 'On-call Escalation Policy' - # description: 'Immediately notify Awesome Schedule' - # EscalationRule #1 - # policy_id: 1, - # oncall_schedule_id: 13 - # status: 1 # Acknowledged status - # elapsed_time_seconds: 0 - # EscalationRule #2 - # policy_id: 1, - # oncall_schedule_id: 14 - # status: 1 # Acknowledged status - # elapsed_time_seconds: 0 - def up - ApplicationRecord.connection.exec_query(<<~SQL.squish) - WITH new_escalation_policies AS ( - INSERT INTO incident_management_escalation_policies ( - project_id, - name, - description - ) - SELECT - DISTINCT ON (project_id) project_id, - 'On-call Escalation Policy', - CONCAT('Immediately notify ', name) - FROM incident_management_oncall_schedules - WHERE project_id NOT IN ( - SELECT DISTINCT project_id - FROM incident_management_escalation_policies - ) - ORDER BY project_id, id - RETURNING id, project_id - ) - - INSERT INTO incident_management_escalation_rules ( - policy_id, - oncall_schedule_id, - status, - elapsed_time_seconds - ) - SELECT - new_escalation_policies.id, - incident_management_oncall_schedules.id, - 1, - 0 - FROM new_escalation_policies - INNER JOIN incident_management_oncall_schedules - ON new_escalation_policies.project_id = incident_management_oncall_schedules.project_id - SQL - end - - # There is no way to distinguish between policies created - # via the backfill or as a result of a user creating a new - # on-call schedule. - def down - # no-op - end -end diff --git a/db/post_migrate/20210520012430_backfill_pk_conversion_for_self_managed.rb b/db/post_migrate/20210520012430_backfill_pk_conversion_for_self_managed.rb deleted file mode 100644 index 68bc82059bc..00000000000 --- a/db/post_migrate/20210520012430_backfill_pk_conversion_for_self_managed.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -class BackfillPkConversionForSelfManaged < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - CONVERSIONS = [ - { table: :events, columns: %i(id), sub_batch_size: 500 }, - { table: :push_event_payloads, columns: %i(event_id), sub_batch_size: 2500, primary_key: :event_id }, - { table: :ci_job_artifacts, columns: %i(id job_id), sub_batch_size: 2000 }, - { table: :ci_sources_pipelines, columns: %i(source_job_id), sub_batch_size: 100 }, - { table: :ci_build_needs, columns: %i(build_id), sub_batch_size: 1000 }, - { table: :ci_builds, columns: %i(id stage_id), sub_batch_size: 250 }, - { table: :ci_builds_runner_session, columns: %i(build_id), sub_batch_size: 5000 }, - { table: :ci_build_trace_chunks, columns: %i(build_id), sub_batch_size: 1000 } - ] - - def up - return unless should_run? - - CONVERSIONS.each do |conversion| - backfill_conversion_of_integer_to_bigint( - conversion[:table], conversion[:columns], - sub_batch_size: conversion[:sub_batch_size], primary_key: conversion.fetch(:primary_key, :id) - ) - end - end - - def down - return unless should_run? - - CONVERSIONS.each do |conversion| - revert_backfill_conversion_of_integer_to_bigint( - conversion[:table], conversion[:columns], - primary_key: conversion.fetch(:primary_key, :id) - ) - end - end - - private - - def should_run? - !Gitlab.com? - end -end diff --git a/db/post_migrate/20210525075724_clean_up_pending_builds_table.rb b/db/post_migrate/20210525075724_clean_up_pending_builds_table.rb deleted file mode 100644 index 59b41dd2008..00000000000 --- a/db/post_migrate/20210525075724_clean_up_pending_builds_table.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class CleanUpPendingBuildsTable < ActiveRecord::Migration[6.0] - include ::Gitlab::Database::DynamicModelHelpers - - BATCH_SIZE = 1000 - - disable_ddl_transaction! - - def up - return unless Gitlab.dev_or_test_env? || Gitlab.com? - - each_batch_range('ci_pending_builds', connection: connection, of: BATCH_SIZE) do |min, max| - execute <<~SQL - DELETE FROM ci_pending_builds - USING ci_builds - WHERE ci_builds.id = ci_pending_builds.build_id - AND ci_builds.status != 'pending' - AND ci_builds.type = 'Ci::Build' - AND ci_pending_builds.id BETWEEN #{min} AND #{max} - SQL - end - end - - def down - # noop - end -end diff --git a/db/post_migrate/20210526160133_remove_segment_selections_table.rb b/db/post_migrate/20210526160133_remove_segment_selections_table.rb deleted file mode 100644 index 02e981b40ba..00000000000 --- a/db/post_migrate/20210526160133_remove_segment_selections_table.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class RemoveSegmentSelectionsTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - drop_table :analytics_devops_adoption_segment_selections - end - - def down - create_table :analytics_devops_adoption_segment_selections do |t| - t.references :segment, index: { name: 'index_on_segment_selections_segment_id' }, null: false, foreign_key: { to_table: :analytics_devops_adoption_segments, on_delete: :cascade } - t.bigint :group_id - t.bigint :project_id - t.index [:group_id, :segment_id], unique: true, name: 'index_on_segment_selections_group_id_segment_id' - t.index [:project_id, :segment_id], unique: true, name: 'index_on_segment_selections_project_id_segment_id' - - t.timestamps_with_timezone - end - add_concurrent_foreign_key(:analytics_devops_adoption_segment_selections, :projects, column: :project_id, on_delete: :cascade) - add_concurrent_foreign_key(:analytics_devops_adoption_segment_selections, :namespaces, column: :group_id, on_delete: :cascade) - add_check_constraint :analytics_devops_adoption_segment_selections, '(project_id != NULL AND group_id IS NULL) OR (group_id != NULL AND project_id IS NULL)', 'segment_selection_project_id_or_group_id_required' - end -end diff --git a/db/post_migrate/20210526222715_backfill_draft_status_on_merge_requests.rb b/db/post_migrate/20210526222715_backfill_draft_status_on_merge_requests.rb deleted file mode 100644 index 8ff0e306ad5..00000000000 --- a/db/post_migrate/20210526222715_backfill_draft_status_on_merge_requests.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class BackfillDraftStatusOnMergeRequests < ActiveRecord::Migration[6.0] - # include Gitlab::Database::MigrationHelpers - - # Marking these as no-op as the original contents caused timeouts on - # staging. Removing the code here per - # #https://docs.gitlab.com/ee/development/deleting_migrations.html#how-to-disable-a-data-migration - # => - def up - # no-op - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20210527131039_clean_up_rename_experiment_subjects_group_id_to_namespace_id.rb b/db/post_migrate/20210527131039_clean_up_rename_experiment_subjects_group_id_to_namespace_id.rb deleted file mode 100644 index 6dec99c8acd..00000000000 --- a/db/post_migrate/20210527131039_clean_up_rename_experiment_subjects_group_id_to_namespace_id.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class CleanUpRenameExperimentSubjectsGroupIdToNamespaceId < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers::V2 - - disable_ddl_transaction! - - def up - cleanup_concurrent_column_rename :experiment_subjects, :group_id, :namespace_id - end - - def down - undo_cleanup_concurrent_column_rename :experiment_subjects, :group_id, :namespace_id - end -end diff --git a/db/post_migrate/20210531054108_finalize_rename_instance_statistics_measurements.rb b/db/post_migrate/20210531054108_finalize_rename_instance_statistics_measurements.rb deleted file mode 100644 index 7aac4446c0c..00000000000 --- a/db/post_migrate/20210531054108_finalize_rename_instance_statistics_measurements.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class FinalizeRenameInstanceStatisticsMeasurements < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - def up - finalize_table_rename(:analytics_instance_statistics_measurements, :analytics_usage_trends_measurements) - end - - def down - undo_finalize_table_rename(:analytics_instance_statistics_measurements, :analytics_usage_trends_measurements) - end -end diff --git a/db/post_migrate/20210601073400_fix_total_stage_in_vsa.rb b/db/post_migrate/20210601073400_fix_total_stage_in_vsa.rb deleted file mode 100644 index 85302ee1d20..00000000000 --- a/db/post_migrate/20210601073400_fix_total_stage_in_vsa.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class FixTotalStageInVsa < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - TOTAL_STAGE = 'Total' - - class GroupStage < ActiveRecord::Base - include EachBatch - - self.table_name = 'analytics_cycle_analytics_group_stages' - end - - def up - GroupStage.reset_column_information - - GroupStage.each_batch(of: 100) do |relation| - relation.where(name: TOTAL_STAGE, custom: false).update_all(custom: true) - end - end - - def down - # no-op - end -end diff --git a/db/schema_migrations/20210301200959 b/db/schema_migrations/20210301200959 deleted file mode 100644 index 8c5efabd76d..00000000000 --- a/db/schema_migrations/20210301200959 +++ /dev/null @@ -1 +0,0 @@ -28b90c9b7c2e4f2e2b12088f5aee85c16dfb567f89ed6a8e771f2c5d91c818d9 \ No newline at end of file diff --git a/db/schema_migrations/20210302025305 b/db/schema_migrations/20210302025305 deleted file mode 100644 index 935006818be..00000000000 --- a/db/schema_migrations/20210302025305 +++ /dev/null @@ -1 +0,0 @@ -bf47b1c4840c97459f99308d9de04644d18c301659ef5f021088911155d2c624 \ No newline at end of file diff --git a/db/schema_migrations/20210302074524 b/db/schema_migrations/20210302074524 deleted file mode 100644 index be35539d1f0..00000000000 --- a/db/schema_migrations/20210302074524 +++ /dev/null @@ -1 +0,0 @@ -251c0d811eee00f78e62f4d1e7f2893b2137fbf8121cefc4283c3217677b5447 \ No newline at end of file diff --git a/db/schema_migrations/20210302103851 b/db/schema_migrations/20210302103851 deleted file mode 100644 index cd166f974a9..00000000000 --- a/db/schema_migrations/20210302103851 +++ /dev/null @@ -1 +0,0 @@ -b2dad27276941e17248f86764196525bd91b088eed78ad7aa6ae2e5a2c9e82bd \ No newline at end of file diff --git a/db/schema_migrations/20210302150310 b/db/schema_migrations/20210302150310 deleted file mode 100644 index 251fdb0ba8e..00000000000 --- a/db/schema_migrations/20210302150310 +++ /dev/null @@ -1 +0,0 @@ -7c562d43801c18af48dc526dc6574aebd11689b62bad864b107580d341ba64a1 \ No newline at end of file diff --git a/db/schema_migrations/20210302155904 b/db/schema_migrations/20210302155904 deleted file mode 100644 index b9f1297934c..00000000000 --- a/db/schema_migrations/20210302155904 +++ /dev/null @@ -1 +0,0 @@ -104e767518d55a7caa5ff517efe978287beb629649c681a2871ada8a677a0e13 \ No newline at end of file diff --git a/db/schema_migrations/20210302160544 b/db/schema_migrations/20210302160544 deleted file mode 100644 index fd1b67c16bf..00000000000 --- a/db/schema_migrations/20210302160544 +++ /dev/null @@ -1 +0,0 @@ -e5c589decb2bc8d3e37451bf9977a810308ee37f5f02ed96226e0be87f8b908d \ No newline at end of file diff --git a/db/schema_migrations/20210302212623 b/db/schema_migrations/20210302212623 deleted file mode 100644 index f7e2ab33416..00000000000 --- a/db/schema_migrations/20210302212623 +++ /dev/null @@ -1 +0,0 @@ -283645d1791a8d72fa7e327799ede933d89bd69d8db2a87b7ff437a2f5d74da3 \ No newline at end of file diff --git a/db/schema_migrations/20210303053341 b/db/schema_migrations/20210303053341 deleted file mode 100644 index 115b5655f4f..00000000000 --- a/db/schema_migrations/20210303053341 +++ /dev/null @@ -1 +0,0 @@ -3bd7e839c4f93716a7e893bf9184306a1fcfd401e5b54f4393e5138e2776f5e0 \ No newline at end of file diff --git a/db/schema_migrations/20210303064112 b/db/schema_migrations/20210303064112 deleted file mode 100644 index 42164b222b7..00000000000 --- a/db/schema_migrations/20210303064112 +++ /dev/null @@ -1 +0,0 @@ -5b8f32bafe4bffd30b9235f9b6ba5774a26d5c4c9f1e987d3e840056f8abdd52 \ No newline at end of file diff --git a/db/schema_migrations/20210303064142 b/db/schema_migrations/20210303064142 deleted file mode 100644 index 9ac9716c8e7..00000000000 --- a/db/schema_migrations/20210303064142 +++ /dev/null @@ -1 +0,0 @@ -70c5b76788460bd098c3ae3f75c7b18194c7765e1462f5305feaf2400f7dd4ff \ No newline at end of file diff --git a/db/schema_migrations/20210303091651 b/db/schema_migrations/20210303091651 deleted file mode 100644 index 35d2ca084b8..00000000000 --- a/db/schema_migrations/20210303091651 +++ /dev/null @@ -1 +0,0 @@ -e1641d84828e3d87aea626dbce6b3b2d231d08fcf1475991fe8d11714cdb0af0 \ No newline at end of file diff --git a/db/schema_migrations/20210303121224 b/db/schema_migrations/20210303121224 deleted file mode 100644 index 0c0ba7c882c..00000000000 --- a/db/schema_migrations/20210303121224 +++ /dev/null @@ -1 +0,0 @@ -cef2421a6885cb8b28d34388af6c79c4be1564dfd5fae2efcb35622d511eb8c0 \ No newline at end of file diff --git a/db/schema_migrations/20210303165201 b/db/schema_migrations/20210303165201 deleted file mode 100644 index 55181591e3f..00000000000 --- a/db/schema_migrations/20210303165201 +++ /dev/null @@ -1 +0,0 @@ -0a5d306735047101692bbdb37aa829bf70a225af6db7213a8c2eb8168f9a30e9 \ No newline at end of file diff --git a/db/schema_migrations/20210303165301 b/db/schema_migrations/20210303165301 deleted file mode 100644 index c040288a283..00000000000 --- a/db/schema_migrations/20210303165301 +++ /dev/null @@ -1 +0,0 @@ -fa82a0f6c57a527a143da56ae0d70245a7d711b5e5ff3eb959fd6b2cf5872dac \ No newline at end of file diff --git a/db/schema_migrations/20210303165302 b/db/schema_migrations/20210303165302 deleted file mode 100644 index f140d636482..00000000000 --- a/db/schema_migrations/20210303165302 +++ /dev/null @@ -1 +0,0 @@ -1cb74abdc7134c3252425c3ceb8cd9dc4b157d64b1a2ff7928153e78b05d9121 \ No newline at end of file diff --git a/db/schema_migrations/20210303193544 b/db/schema_migrations/20210303193544 deleted file mode 100644 index ee00730b633..00000000000 --- a/db/schema_migrations/20210303193544 +++ /dev/null @@ -1 +0,0 @@ -4d88c8ff507a985d90ed13dc16eba068e440efd12e5ec72782cef2a4bc3cf9e7 \ No newline at end of file diff --git a/db/schema_migrations/20210303193605 b/db/schema_migrations/20210303193605 deleted file mode 100644 index f0460522a0e..00000000000 --- a/db/schema_migrations/20210303193605 +++ /dev/null @@ -1 +0,0 @@ -d79c7059c9d79b3e437ed649f19e587e713ba8dbd0af9f58ace4f4f522b4ac11 \ No newline at end of file diff --git a/db/schema_migrations/20210304133508 b/db/schema_migrations/20210304133508 deleted file mode 100644 index c57b04c24fb..00000000000 --- a/db/schema_migrations/20210304133508 +++ /dev/null @@ -1 +0,0 @@ -a6bf41632fc3d81d2c015d2d848f4e74468ec8cfeb2a2afb644fd92189e95e21 \ No newline at end of file diff --git a/db/schema_migrations/20210305002016 b/db/schema_migrations/20210305002016 deleted file mode 100644 index a4bc67d505a..00000000000 --- a/db/schema_migrations/20210305002016 +++ /dev/null @@ -1 +0,0 @@ -c91541048b119bcbbe9454760c6a90ddb6c4dc90e121f3ee7f4cdd6a1bde2c9e \ No newline at end of file diff --git a/db/schema_migrations/20210305013509 b/db/schema_migrations/20210305013509 deleted file mode 100644 index 6649e76508b..00000000000 --- a/db/schema_migrations/20210305013509 +++ /dev/null @@ -1 +0,0 @@ -743344bb057d0e368c69cc3c90f72d560359d0753acf069e7423928c778a140a \ No newline at end of file diff --git a/db/schema_migrations/20210305031822 b/db/schema_migrations/20210305031822 deleted file mode 100644 index 8c09ba8d22f..00000000000 --- a/db/schema_migrations/20210305031822 +++ /dev/null @@ -1 +0,0 @@ -d91eb442db670adef6d610a2c79259377709e5c98615ba10b85eb998715b3130 \ No newline at end of file diff --git a/db/schema_migrations/20210305145622 b/db/schema_migrations/20210305145622 deleted file mode 100644 index 4a4c89a03c8..00000000000 --- a/db/schema_migrations/20210305145622 +++ /dev/null @@ -1 +0,0 @@ -be22d5a1c61cbb8b2396a351951ffcee54fbf37dc5ef5f899576a36a14200e75 \ No newline at end of file diff --git a/db/schema_migrations/20210305180331 b/db/schema_migrations/20210305180331 deleted file mode 100644 index a7d9a6d10f3..00000000000 --- a/db/schema_migrations/20210305180331 +++ /dev/null @@ -1 +0,0 @@ -cf63d7ffd6bfb93c25c894b26424e9890b43652b4f0bfc259917a4857ff414e2 \ No newline at end of file diff --git a/db/schema_migrations/20210305182740 b/db/schema_migrations/20210305182740 deleted file mode 100644 index 3e45c9cd1d5..00000000000 --- a/db/schema_migrations/20210305182740 +++ /dev/null @@ -1 +0,0 @@ -4c1ae24594ccb85706a4c9836ed1fc8ce47d68863262e90b9109ddc1d83d121b \ No newline at end of file diff --git a/db/schema_migrations/20210305182855 b/db/schema_migrations/20210305182855 deleted file mode 100644 index 4e42b8d3f99..00000000000 --- a/db/schema_migrations/20210305182855 +++ /dev/null @@ -1 +0,0 @@ -8f9957b7f7744e3d72bba1b2bf9bd2c9a06203091bf8f9dcafc69755db25fef0 \ No newline at end of file diff --git a/db/schema_migrations/20210305183904 b/db/schema_migrations/20210305183904 deleted file mode 100644 index 7e391fc6bc5..00000000000 --- a/db/schema_migrations/20210305183904 +++ /dev/null @@ -1 +0,0 @@ -43af4a4200ba87ebb50627d341bb324896cbe0c36896d50dd81a8a9cfb2eb426 \ No newline at end of file diff --git a/db/schema_migrations/20210306121300 b/db/schema_migrations/20210306121300 deleted file mode 100644 index f46097b1126..00000000000 --- a/db/schema_migrations/20210306121300 +++ /dev/null @@ -1 +0,0 @@ -44d53ac15c5e54c2f1c825286155dec643b82573184026caaf08288512168aef \ No newline at end of file diff --git a/db/schema_migrations/20210306121310 b/db/schema_migrations/20210306121310 deleted file mode 100644 index 8713032f2d4..00000000000 --- a/db/schema_migrations/20210306121310 +++ /dev/null @@ -1 +0,0 @@ -90072e3dee4517061ff9e08decda7fecb9cc9b38a56345c09685e3cce48a8b66 \ No newline at end of file diff --git a/db/schema_migrations/20210308125742 b/db/schema_migrations/20210308125742 deleted file mode 100644 index 9090fa4dc5e..00000000000 --- a/db/schema_migrations/20210308125742 +++ /dev/null @@ -1 +0,0 @@ -a81f3555d0e1159569687d4967edcd2b5706cdafd5defb8dc725e295eb969861 \ No newline at end of file diff --git a/db/schema_migrations/20210308175224 b/db/schema_migrations/20210308175224 deleted file mode 100644 index c222b9101af..00000000000 --- a/db/schema_migrations/20210308175224 +++ /dev/null @@ -1 +0,0 @@ -ad6e0feff16589839714098a69673edcba50af7a62d98cd078585c5d2aada919 \ No newline at end of file diff --git a/db/schema_migrations/20210308175225 b/db/schema_migrations/20210308175225 deleted file mode 100644 index 7fb92d10f8c..00000000000 --- a/db/schema_migrations/20210308175225 +++ /dev/null @@ -1 +0,0 @@ -9263c522f0632f5b4fc0004e1fe9666bc3a44e4f70cf0d21aab5bb229f08ab5c \ No newline at end of file diff --git a/db/schema_migrations/20210308175226 b/db/schema_migrations/20210308175226 deleted file mode 100644 index 4d126ff2b63..00000000000 --- a/db/schema_migrations/20210308175226 +++ /dev/null @@ -1 +0,0 @@ -72491b1834a1256a197e8f49c599b28b41773226db4fe70ce402903674d2f622 \ No newline at end of file diff --git a/db/schema_migrations/20210308175227 b/db/schema_migrations/20210308175227 deleted file mode 100644 index 66aaf4ca558..00000000000 --- a/db/schema_migrations/20210308175227 +++ /dev/null @@ -1 +0,0 @@ -e99b8a6242589992ae8b618cb502d16b67672856cef024c1aafe00a1e64e41b9 \ No newline at end of file diff --git a/db/schema_migrations/20210308190413 b/db/schema_migrations/20210308190413 deleted file mode 100644 index 9ddde51b57e..00000000000 --- a/db/schema_migrations/20210308190413 +++ /dev/null @@ -1 +0,0 @@ -cc131cf37f2af8f0f58c7fa6e5055e88a3b2ed413862c155b0d18383aba06058 \ No newline at end of file diff --git a/db/schema_migrations/20210309160106 b/db/schema_migrations/20210309160106 deleted file mode 100644 index d10e9176a71..00000000000 --- a/db/schema_migrations/20210309160106 +++ /dev/null @@ -1 +0,0 @@ -968ba7808c969e29f1c3b6b635bff22f986b60e56cb001737ad8aba1825fd945 \ No newline at end of file diff --git a/db/schema_migrations/20210309181019 b/db/schema_migrations/20210309181019 deleted file mode 100644 index 3055268acc8..00000000000 --- a/db/schema_migrations/20210309181019 +++ /dev/null @@ -1 +0,0 @@ -a31b85b8ab0db2ad4daa5f2c15eacae97432e75e0e0a28f10d81f6a5aa94c8e0 \ No newline at end of file diff --git a/db/schema_migrations/20210310000627 b/db/schema_migrations/20210310000627 deleted file mode 100644 index b52703908c9..00000000000 --- a/db/schema_migrations/20210310000627 +++ /dev/null @@ -1 +0,0 @@ -71cea758ecb70049468531f70c52aec021060cd48e58155de0ba118786562ac6 \ No newline at end of file diff --git a/db/schema_migrations/20210310111009 b/db/schema_migrations/20210310111009 deleted file mode 100644 index 9fa502b1226..00000000000 --- a/db/schema_migrations/20210310111009 +++ /dev/null @@ -1 +0,0 @@ -8b5a69947c44c9c1050f4989e3b373d3eb87832111d0202992c7dd992032c9d1 \ No newline at end of file diff --git a/db/schema_migrations/20210311022012 b/db/schema_migrations/20210311022012 deleted file mode 100644 index fbfe6d2cd23..00000000000 --- a/db/schema_migrations/20210311022012 +++ /dev/null @@ -1 +0,0 @@ -77d023cc7b635f5b3fc4d8c963183ca15e90f6bb747c145bd8efd1a4e47f65a0 \ No newline at end of file diff --git a/db/schema_migrations/20210311045138 b/db/schema_migrations/20210311045138 deleted file mode 100644 index 3dcf40429f9..00000000000 --- a/db/schema_migrations/20210311045138 +++ /dev/null @@ -1 +0,0 @@ -01bbe2af2bc6bdaa6bf1e2fe10557e3f9f969cc60a348f188fbfe126ea7ea97d \ No newline at end of file diff --git a/db/schema_migrations/20210311045139 b/db/schema_migrations/20210311045139 deleted file mode 100644 index 71026c1b2af..00000000000 --- a/db/schema_migrations/20210311045139 +++ /dev/null @@ -1 +0,0 @@ -2387c8a5516aaf8bcf44c9bad45bfc9844d68d2c03330f67773ce046b21a7a6c \ No newline at end of file diff --git a/db/schema_migrations/20210311093723 b/db/schema_migrations/20210311093723 deleted file mode 100644 index 9036880454b..00000000000 --- a/db/schema_migrations/20210311093723 +++ /dev/null @@ -1 +0,0 @@ -6af1c870e685b5a7fbc31b658959018c313713f0f35ad776f97d0a804f1c0f05 \ No newline at end of file diff --git a/db/schema_migrations/20210311120152 b/db/schema_migrations/20210311120152 deleted file mode 100644 index d5e739cdf05..00000000000 --- a/db/schema_migrations/20210311120152 +++ /dev/null @@ -1 +0,0 @@ -2ad45eaf6589600d9aadd225b55451d9213a4d858ef2717b7151062f1db225c8 \ No newline at end of file diff --git a/db/schema_migrations/20210311120153 b/db/schema_migrations/20210311120153 deleted file mode 100644 index 2d8f5b253ef..00000000000 --- a/db/schema_migrations/20210311120153 +++ /dev/null @@ -1 +0,0 @@ -3486452547ffa5da3e12837d2f184e356c90fdd1f016f85144a1ba4865825e87 \ No newline at end of file diff --git a/db/schema_migrations/20210311120154 b/db/schema_migrations/20210311120154 deleted file mode 100644 index c3007047230..00000000000 --- a/db/schema_migrations/20210311120154 +++ /dev/null @@ -1 +0,0 @@ -e169ea265b942f636b2386a432e04d9dfccdc95f04113400d44ce59e81537843 \ No newline at end of file diff --git a/db/schema_migrations/20210311120155 b/db/schema_migrations/20210311120155 deleted file mode 100644 index 2d17acdc9f4..00000000000 --- a/db/schema_migrations/20210311120155 +++ /dev/null @@ -1 +0,0 @@ -b7af086a68c530dd528c4ceaf4bca8d04951c0f234f75a09922aa392bb17a796 \ No newline at end of file diff --git a/db/schema_migrations/20210311120156 b/db/schema_migrations/20210311120156 deleted file mode 100644 index b2ac3c856af..00000000000 --- a/db/schema_migrations/20210311120156 +++ /dev/null @@ -1 +0,0 @@ -4715c46f5d76c8eb3a206ad3bbcc94a8c13d1d6a66a7824dba400b0aa49c8aa6 \ No newline at end of file diff --git a/db/schema_migrations/20210312140029 b/db/schema_migrations/20210312140029 deleted file mode 100644 index 7b4d553e244..00000000000 --- a/db/schema_migrations/20210312140029 +++ /dev/null @@ -1 +0,0 @@ -5d63a48f4a9327f683eff093d2862a0b88aa4249c94b2de9751ed6172c9b4799 \ No newline at end of file diff --git a/db/schema_migrations/20210312174321 b/db/schema_migrations/20210312174321 deleted file mode 100644 index 5126ab2675d..00000000000 --- a/db/schema_migrations/20210312174321 +++ /dev/null @@ -1 +0,0 @@ -4fa88193ae328f04465980210d9a43ce8cad978c157bda5e8ae9951538209268 \ No newline at end of file diff --git a/db/schema_migrations/20210312193532 b/db/schema_migrations/20210312193532 deleted file mode 100644 index af5cd0b163c..00000000000 --- a/db/schema_migrations/20210312193532 +++ /dev/null @@ -1 +0,0 @@ -93e92e8eca0765cb8e6e08ec90ce0143d9b31d13e4d61e1b9690dbaed5a1bb63 \ No newline at end of file diff --git a/db/schema_migrations/20210313045617 b/db/schema_migrations/20210313045617 deleted file mode 100644 index d422d0ab5d2..00000000000 --- a/db/schema_migrations/20210313045617 +++ /dev/null @@ -1 +0,0 @@ -d1e6596e9c6825e29c50523dce60fd3d0b3c067c10e210f74640ba94f7938871 \ No newline at end of file diff --git a/db/schema_migrations/20210313045845 b/db/schema_migrations/20210313045845 deleted file mode 100644 index 8e2b5605f8b..00000000000 --- a/db/schema_migrations/20210313045845 +++ /dev/null @@ -1 +0,0 @@ -bc6302444f7a0a858c821d971fc45a4ececd7b877020f8e920a244866c60b7a2 \ No newline at end of file diff --git a/db/schema_migrations/20210316094047 b/db/schema_migrations/20210316094047 deleted file mode 100644 index d5d23d1e2c2..00000000000 --- a/db/schema_migrations/20210316094047 +++ /dev/null @@ -1 +0,0 @@ -208df71aa7c2dc447ea8f63ca8cc02344a78bd739c7a0e9457c665bfb831a879 \ No newline at end of file diff --git a/db/schema_migrations/20210316094323 b/db/schema_migrations/20210316094323 deleted file mode 100644 index 9ad5baba2bd..00000000000 --- a/db/schema_migrations/20210316094323 +++ /dev/null @@ -1 +0,0 @@ -e1d83121dd3bd1a608626910a8238546816870f6f36840d96b2b4ac3415af985 \ No newline at end of file diff --git a/db/schema_migrations/20210316152500 b/db/schema_migrations/20210316152500 deleted file mode 100644 index fe2f477a9d7..00000000000 --- a/db/schema_migrations/20210316152500 +++ /dev/null @@ -1 +0,0 @@ -c2e3f8f6f283d919d99b0acf970f663fef8ca30ef277116401549014fc99ae91 \ No newline at end of file diff --git a/db/schema_migrations/20210316171009 b/db/schema_migrations/20210316171009 deleted file mode 100644 index baf2152bb17..00000000000 --- a/db/schema_migrations/20210316171009 +++ /dev/null @@ -1 +0,0 @@ -b17c853b2bc82cfa83cd82b8023eca39d875d898b99e78c81d767a73391a0b75 \ No newline at end of file diff --git a/db/schema_migrations/20210317035357 b/db/schema_migrations/20210317035357 deleted file mode 100644 index c8cc61fd9fc..00000000000 --- a/db/schema_migrations/20210317035357 +++ /dev/null @@ -1 +0,0 @@ -6fb6381e969d062f19b5269b4958306c3bf9a1b7cf06e5b0eb25beb005952d07 \ No newline at end of file diff --git a/db/schema_migrations/20210317100520 b/db/schema_migrations/20210317100520 deleted file mode 100644 index f75c67143c2..00000000000 --- a/db/schema_migrations/20210317100520 +++ /dev/null @@ -1 +0,0 @@ -54c701451c305ffdead2a9019cf07adae835c5873025caa1f32169f5ae83bf5d \ No newline at end of file diff --git a/db/schema_migrations/20210317104032 b/db/schema_migrations/20210317104032 deleted file mode 100644 index 616397a0663..00000000000 --- a/db/schema_migrations/20210317104032 +++ /dev/null @@ -1 +0,0 @@ -c954e1f2bfdfddc98030bfa0ab28f58a41921cbb5b81e088cde12637e3ae5a8f \ No newline at end of file diff --git a/db/schema_migrations/20210317104301 b/db/schema_migrations/20210317104301 deleted file mode 100644 index c0bd8549c6a..00000000000 --- a/db/schema_migrations/20210317104301 +++ /dev/null @@ -1 +0,0 @@ -c502a539a50ef1b8f07a8c22426a23cf974ee663fc80a99abe0d658e2a07f52b \ No newline at end of file diff --git a/db/schema_migrations/20210317105904 b/db/schema_migrations/20210317105904 deleted file mode 100644 index 51dcb6516a0..00000000000 --- a/db/schema_migrations/20210317105904 +++ /dev/null @@ -1 +0,0 @@ -64675f43f66d90158147c62699c0d2a48dc74d017c81b30ce3847408d0dad3cb \ No newline at end of file diff --git a/db/schema_migrations/20210317123054 b/db/schema_migrations/20210317123054 deleted file mode 100644 index 1a18d409ac7..00000000000 --- a/db/schema_migrations/20210317123054 +++ /dev/null @@ -1 +0,0 @@ -28b1e8add8ac7249be55ccd25e60c8a181d2ff036a7d69ac861bcdb5bf5e84e1 \ No newline at end of file diff --git a/db/schema_migrations/20210317155207 b/db/schema_migrations/20210317155207 deleted file mode 100644 index 3038d9cb4ab..00000000000 --- a/db/schema_migrations/20210317155207 +++ /dev/null @@ -1 +0,0 @@ -b6c30723c2be7dd0afe535272cded230db4954bfe914d5087542be2c27d0ad79 \ No newline at end of file diff --git a/db/schema_migrations/20210317192943 b/db/schema_migrations/20210317192943 deleted file mode 100644 index d03b325fa77..00000000000 --- a/db/schema_migrations/20210317192943 +++ /dev/null @@ -1 +0,0 @@ -dfb88ea7a213da1e56bef532255f01a284d7b9be9ec8a6b9dd0e95ec04d0f524 \ No newline at end of file diff --git a/db/schema_migrations/20210317210338 b/db/schema_migrations/20210317210338 deleted file mode 100644 index 15400399589..00000000000 --- a/db/schema_migrations/20210317210338 +++ /dev/null @@ -1 +0,0 @@ -e915378e1ebb78b528abfecda55cdc52a690d982e4377876b818197b3134c09a \ No newline at end of file diff --git a/db/schema_migrations/20210318134427 b/db/schema_migrations/20210318134427 deleted file mode 100644 index 3fe6ac49550..00000000000 --- a/db/schema_migrations/20210318134427 +++ /dev/null @@ -1 +0,0 @@ -07f4619577b05ea6a62045c81de7d225841bea28c0dd8f2cdb2011c902fd3e5a \ No newline at end of file diff --git a/db/schema_migrations/20210319071214 b/db/schema_migrations/20210319071214 deleted file mode 100644 index ee3a7613d63..00000000000 --- a/db/schema_migrations/20210319071214 +++ /dev/null @@ -1 +0,0 @@ -3f9e229fc13075c2a2d42931b163c8069089458d66bc565609b393e07460f25d \ No newline at end of file diff --git a/db/schema_migrations/20210322063407 b/db/schema_migrations/20210322063407 deleted file mode 100644 index bea9c3f2ba0..00000000000 --- a/db/schema_migrations/20210322063407 +++ /dev/null @@ -1 +0,0 @@ -d520fe71ca271c135b9684dc7a03ede27832659459f7476787798d11460c4736 \ No newline at end of file diff --git a/db/schema_migrations/20210322063450 b/db/schema_migrations/20210322063450 deleted file mode 100644 index 7c4a1ba65bf..00000000000 --- a/db/schema_migrations/20210322063450 +++ /dev/null @@ -1 +0,0 @@ -fdf858a31e27fb2ce4071642b6e2d76082db95f6ebbec63ce627f92ddf7edfcf \ No newline at end of file diff --git a/db/schema_migrations/20210322115438 b/db/schema_migrations/20210322115438 deleted file mode 100644 index 94db65a9a8a..00000000000 --- a/db/schema_migrations/20210322115438 +++ /dev/null @@ -1 +0,0 @@ -e177c2cc0b59eea54de10417445b391cea7dd308547077aea34054fac22b9e40 \ No newline at end of file diff --git a/db/schema_migrations/20210322182751 b/db/schema_migrations/20210322182751 deleted file mode 100644 index 615f3c7a5de..00000000000 --- a/db/schema_migrations/20210322182751 +++ /dev/null @@ -1 +0,0 @@ -79ad2de15faef8edb8752c2a9c89f1739a805af999c86db6e73482a613c4f9d1 \ No newline at end of file diff --git a/db/schema_migrations/20210323064751 b/db/schema_migrations/20210323064751 deleted file mode 100644 index 3ce610ecb0d..00000000000 --- a/db/schema_migrations/20210323064751 +++ /dev/null @@ -1 +0,0 @@ -4ef75890cf2c30954e0d1ff04c75b58cb910315ea1ed345e351edd035b681cc6 \ No newline at end of file diff --git a/db/schema_migrations/20210323125809 b/db/schema_migrations/20210323125809 deleted file mode 100644 index 353bf743ebf..00000000000 --- a/db/schema_migrations/20210323125809 +++ /dev/null @@ -1 +0,0 @@ -f8c4a3da0931ee04654050e3b172814e7ea1238bac501794e39d0d68592da8fa \ No newline at end of file diff --git a/db/schema_migrations/20210323130831 b/db/schema_migrations/20210323130831 deleted file mode 100644 index b296b8a5bd1..00000000000 --- a/db/schema_migrations/20210323130831 +++ /dev/null @@ -1 +0,0 @@ -ca53c3d2bf58aeb803f942ce122a84d7ce587fcceb06c5800c44fd5aac1fd6ac \ No newline at end of file diff --git a/db/schema_migrations/20210323131543 b/db/schema_migrations/20210323131543 deleted file mode 100644 index 1edba1a0f3d..00000000000 --- a/db/schema_migrations/20210323131543 +++ /dev/null @@ -1 +0,0 @@ -a4cac229cdd249feef18a39e845158952bef2f67fa2784713db47ab9a06495bd \ No newline at end of file diff --git a/db/schema_migrations/20210323155010 b/db/schema_migrations/20210323155010 deleted file mode 100644 index 23225216b5a..00000000000 --- a/db/schema_migrations/20210323155010 +++ /dev/null @@ -1 +0,0 @@ -1143241b1a8d1554c86a8d72d43276fa15c0193e510f47d5d7c64769860c60e3 \ No newline at end of file diff --git a/db/schema_migrations/20210323182846 b/db/schema_migrations/20210323182846 deleted file mode 100644 index aa4ab4ba7fd..00000000000 --- a/db/schema_migrations/20210323182846 +++ /dev/null @@ -1 +0,0 @@ -9ee014f462ec0d2affaab146243fb991298e9b30bd57b741fba0440b1676de03 \ No newline at end of file diff --git a/db/schema_migrations/20210324112439 b/db/schema_migrations/20210324112439 deleted file mode 100644 index e0cf51c3a54..00000000000 --- a/db/schema_migrations/20210324112439 +++ /dev/null @@ -1 +0,0 @@ -7e6dd4e247ad6b610ebebcf59b4212fd0d2258c8fff008d525b891da872613e5 \ No newline at end of file diff --git a/db/schema_migrations/20210324131727 b/db/schema_migrations/20210324131727 deleted file mode 100644 index 85ea4aad1ee..00000000000 --- a/db/schema_migrations/20210324131727 +++ /dev/null @@ -1 +0,0 @@ -e0fab4d950a5be032f823160b1805c44262f9e3d233dc76cd108483a5b92896b \ No newline at end of file diff --git a/db/schema_migrations/20210325092215 b/db/schema_migrations/20210325092215 deleted file mode 100644 index 0693c47994b..00000000000 --- a/db/schema_migrations/20210325092215 +++ /dev/null @@ -1 +0,0 @@ -ea819fd401c5566986fd495ed3b8aa0d296d6c9e3fedf2a10f34cb7fbaeedb20 \ No newline at end of file diff --git a/db/schema_migrations/20210325113129 b/db/schema_migrations/20210325113129 deleted file mode 100644 index 86c212db71b..00000000000 --- a/db/schema_migrations/20210325113129 +++ /dev/null @@ -1 +0,0 @@ -27fcdd54a21d554e44df621e409b81fe248e00851c856d315f4f64b463c7a5b7 \ No newline at end of file diff --git a/db/schema_migrations/20210325150837 b/db/schema_migrations/20210325150837 deleted file mode 100644 index 716462ad187..00000000000 --- a/db/schema_migrations/20210325150837 +++ /dev/null @@ -1 +0,0 @@ -6022464130d7a5697f52b9238837c6a6d3363fd349cbcb14052ff52de6ea2e59 \ No newline at end of file diff --git a/db/schema_migrations/20210325151758 b/db/schema_migrations/20210325151758 deleted file mode 100644 index a3d5f1b1b0a..00000000000 --- a/db/schema_migrations/20210325151758 +++ /dev/null @@ -1 +0,0 @@ -de55a114773961e6cae9ebae36ac93e60676555fe4c2973527511bb3a2eae69d \ No newline at end of file diff --git a/db/schema_migrations/20210325152011 b/db/schema_migrations/20210325152011 deleted file mode 100644 index f685bcd7d9d..00000000000 --- a/db/schema_migrations/20210325152011 +++ /dev/null @@ -1 +0,0 @@ -379fdb3c52e55b51ebdb4a3b1e67c12f19b15e97cce22eed351e33953e389c85 \ No newline at end of file diff --git a/db/schema_migrations/20210326035553 b/db/schema_migrations/20210326035553 deleted file mode 100644 index da34de0fafe..00000000000 --- a/db/schema_migrations/20210326035553 +++ /dev/null @@ -1 +0,0 @@ -018381c15d859a777afb2b3402ca4425ce52ab35dcd4d1e930b3a9928b2a2019 \ No newline at end of file diff --git a/db/schema_migrations/20210326121537 b/db/schema_migrations/20210326121537 deleted file mode 100644 index ece53e34413..00000000000 --- a/db/schema_migrations/20210326121537 +++ /dev/null @@ -1 +0,0 @@ -ac8063901a0de1f2e6d4fd5336f54bfca0bafa9d081066124ec9d2acf47c9b47 \ No newline at end of file diff --git a/db/schema_migrations/20210326190903 b/db/schema_migrations/20210326190903 deleted file mode 100644 index fb98949b3ca..00000000000 --- a/db/schema_migrations/20210326190903 +++ /dev/null @@ -1 +0,0 @@ -d6181f8806592106305366f5e8ef508286ed447c1fce0de26f242de736b21809 \ No newline at end of file diff --git a/db/schema_migrations/20210328214434 b/db/schema_migrations/20210328214434 deleted file mode 100644 index a1d74aaa772..00000000000 --- a/db/schema_migrations/20210328214434 +++ /dev/null @@ -1 +0,0 @@ -134fba876b69fd48697975066a734becf337f53baddd986a5c708ea6dd7cbd75 \ No newline at end of file diff --git a/db/schema_migrations/20210329095548 b/db/schema_migrations/20210329095548 deleted file mode 100644 index a3f65e8e446..00000000000 --- a/db/schema_migrations/20210329095548 +++ /dev/null @@ -1 +0,0 @@ -412d0cedef5c933c7de3a70ca2365fe0cfaa4087429ca418854092b6c37904f1 \ No newline at end of file diff --git a/db/schema_migrations/20210329102724 b/db/schema_migrations/20210329102724 deleted file mode 100644 index b2fdccf2bb8..00000000000 --- a/db/schema_migrations/20210329102724 +++ /dev/null @@ -1 +0,0 @@ -b40c702ea6b2120da6fe11b213064a7a124dbc86bfb2d6785bfd2274c44f1e22 \ No newline at end of file diff --git a/db/schema_migrations/20210329191850 b/db/schema_migrations/20210329191850 deleted file mode 100644 index 9b436c7934d..00000000000 --- a/db/schema_migrations/20210329191850 +++ /dev/null @@ -1 +0,0 @@ -2a49d9f33f7dbcbef3cb5d5537db052c527d5268b37496435fe9918ddbb73095 \ No newline at end of file diff --git a/db/schema_migrations/20210329192716 b/db/schema_migrations/20210329192716 deleted file mode 100644 index 8767c215335..00000000000 --- a/db/schema_migrations/20210329192716 +++ /dev/null @@ -1 +0,0 @@ -d0f5341d76183882b68583bc012154566e99050c24a90c9b895d6863ad8f3273 \ No newline at end of file diff --git a/db/schema_migrations/20210330015805 b/db/schema_migrations/20210330015805 deleted file mode 100644 index 14102a0a2d1..00000000000 --- a/db/schema_migrations/20210330015805 +++ /dev/null @@ -1 +0,0 @@ -a435a211d7e8b9a972323769299fc6e537fdeaa127f8db6ab53031901a51ec36 \ No newline at end of file diff --git a/db/schema_migrations/20210330091751 b/db/schema_migrations/20210330091751 deleted file mode 100644 index 0536252e980..00000000000 --- a/db/schema_migrations/20210330091751 +++ /dev/null @@ -1 +0,0 @@ -3a195b9671846409cf6665b13caad9713541d9cdd95c9f246c22b7db225ab02c \ No newline at end of file diff --git a/db/schema_migrations/20210330130420 b/db/schema_migrations/20210330130420 deleted file mode 100644 index 331738f7f0e..00000000000 --- a/db/schema_migrations/20210330130420 +++ /dev/null @@ -1 +0,0 @@ -de04d010fabd62d9dc995938b69ba178caa5e0a8476af5a78ba68c86698633d6 \ No newline at end of file diff --git a/db/schema_migrations/20210331000934 b/db/schema_migrations/20210331000934 deleted file mode 100644 index 1d55b126d60..00000000000 --- a/db/schema_migrations/20210331000934 +++ /dev/null @@ -1 +0,0 @@ -0bd47f9055aab927a4e8efb4f995f44532880926af9892af60f7d2b8dcdef4a6 \ No newline at end of file diff --git a/db/schema_migrations/20210331105335 b/db/schema_migrations/20210331105335 deleted file mode 100644 index 5d9b8d3fea8..00000000000 --- a/db/schema_migrations/20210331105335 +++ /dev/null @@ -1 +0,0 @@ -2127018617082dbad341bcee68948afe111286fdc2ea9ce8b3d00d356f3c61e0 \ No newline at end of file diff --git a/db/schema_migrations/20210331125111 b/db/schema_migrations/20210331125111 deleted file mode 100644 index 7e6429b4289..00000000000 --- a/db/schema_migrations/20210331125111 +++ /dev/null @@ -1 +0,0 @@ -8c7343dafaa036115e85f30d2d096d14279c80de99f49b969039ed3afa5acdf6 \ No newline at end of file diff --git a/db/schema_migrations/20210331145548 b/db/schema_migrations/20210331145548 deleted file mode 100644 index c903c6f35c8..00000000000 --- a/db/schema_migrations/20210331145548 +++ /dev/null @@ -1 +0,0 @@ -f27446d1950acaf45f623b2cec7733cd7ba4b82eefddfa2203acbbaf77d59e18 \ No newline at end of file diff --git a/db/schema_migrations/20210331180118 b/db/schema_migrations/20210331180118 deleted file mode 100644 index 45e62e7154d..00000000000 --- a/db/schema_migrations/20210331180118 +++ /dev/null @@ -1 +0,0 @@ -d8a17ce963801559292265dd0a997d8dbc69d2fa8b8840622490f878bf1eaa6a \ No newline at end of file diff --git a/db/schema_migrations/20210401131948 b/db/schema_migrations/20210401131948 deleted file mode 100644 index 8b9950cd32c..00000000000 --- a/db/schema_migrations/20210401131948 +++ /dev/null @@ -1 +0,0 @@ -cbc1cd66cdbe08ac9edee14da255343acdcd8adaea6748ee82980462ae4bb88f \ No newline at end of file diff --git a/db/schema_migrations/20210401134157 b/db/schema_migrations/20210401134157 deleted file mode 100644 index 864d11258b4..00000000000 --- a/db/schema_migrations/20210401134157 +++ /dev/null @@ -1 +0,0 @@ -02f8ed673f87cb2528022d8352a1551b3c7250986d6dc387c1bbdfbc71123272 \ No newline at end of file diff --git a/db/schema_migrations/20210401134455 b/db/schema_migrations/20210401134455 deleted file mode 100644 index 20a348695e7..00000000000 --- a/db/schema_migrations/20210401134455 +++ /dev/null @@ -1 +0,0 @@ -3420d83bf8a1f44e69960849efa25525883f17a2776ae3ce28db855cd550ca8e \ No newline at end of file diff --git a/db/schema_migrations/20210401175134 b/db/schema_migrations/20210401175134 deleted file mode 100644 index 8b93c13bfdc..00000000000 --- a/db/schema_migrations/20210401175134 +++ /dev/null @@ -1 +0,0 @@ -07d527134f776dbed2199f1717c34b3a6c41caadcaa3c50e6e5866f2cfad31b0 \ No newline at end of file diff --git a/db/schema_migrations/20210401192808 b/db/schema_migrations/20210401192808 deleted file mode 100644 index fd005c98732..00000000000 --- a/db/schema_migrations/20210401192808 +++ /dev/null @@ -1 +0,0 @@ -1cd4799ed7df41bfb9d96a7d18faaa9cbb2dc03f2a804c2bc3c1a6bba15d6d3d \ No newline at end of file diff --git a/db/schema_migrations/20210402005225 b/db/schema_migrations/20210402005225 deleted file mode 100644 index 767b1307ca7..00000000000 --- a/db/schema_migrations/20210402005225 +++ /dev/null @@ -1 +0,0 @@ -6c44623655732e9c2916f7a71d51f53e819a216b8936d20d28d6acf37cc94fdf \ No newline at end of file diff --git a/db/schema_migrations/20210403022952 b/db/schema_migrations/20210403022952 deleted file mode 100644 index 581bc5f89c2..00000000000 --- a/db/schema_migrations/20210403022952 +++ /dev/null @@ -1 +0,0 @@ -c62c2e13bdad42cc1f112f9854fe8d25e1e2aa082cb28341a661c93b8587f1f8 \ No newline at end of file diff --git a/db/schema_migrations/20210406063442 b/db/schema_migrations/20210406063442 deleted file mode 100644 index 75b07b54158..00000000000 --- a/db/schema_migrations/20210406063442 +++ /dev/null @@ -1 +0,0 @@ -d29f002f88440a10674b251791fa027cb0ae1c1b0c4fd776a2078e3c94160f17 \ No newline at end of file diff --git a/db/schema_migrations/20210406140057 b/db/schema_migrations/20210406140057 deleted file mode 100644 index 924de9f2ea3..00000000000 --- a/db/schema_migrations/20210406140057 +++ /dev/null @@ -1 +0,0 @@ -b984ddc5765b6f906a3a2046005e8ad45bab360b095eee7e68c44a8ca5534679 \ No newline at end of file diff --git a/db/schema_migrations/20210406144743 b/db/schema_migrations/20210406144743 deleted file mode 100644 index 2709fa5b1c4..00000000000 --- a/db/schema_migrations/20210406144743 +++ /dev/null @@ -1 +0,0 @@ -64011f8d0bcb293bcd36125a52897901421dd18d96129f1514ea360b558f4294 \ No newline at end of file diff --git a/db/schema_migrations/20210407002511 b/db/schema_migrations/20210407002511 deleted file mode 100644 index 60a45fd29ec..00000000000 --- a/db/schema_migrations/20210407002511 +++ /dev/null @@ -1 +0,0 @@ -174d2c4dc57847060cb19405cc08fffd038c7bfbd4ad749e3e1eccf0e281230b \ No newline at end of file diff --git a/db/schema_migrations/20210407111027 b/db/schema_migrations/20210407111027 deleted file mode 100644 index 573100cba8a..00000000000 --- a/db/schema_migrations/20210407111027 +++ /dev/null @@ -1 +0,0 @@ -0ae4e5224aeb0c0a78f3730b7c83505946d3aa40680b64fa2f89370ccefdfd45 \ No newline at end of file diff --git a/db/schema_migrations/20210407140539 b/db/schema_migrations/20210407140539 deleted file mode 100644 index 3d861cfee82..00000000000 --- a/db/schema_migrations/20210407140539 +++ /dev/null @@ -1 +0,0 @@ -9f19b44a4ef3131e6ddd9cfea0d8b1eb4499754f2200bea90b5ed41eb688f622 \ No newline at end of file diff --git a/db/schema_migrations/20210407150240 b/db/schema_migrations/20210407150240 deleted file mode 100644 index cfc187d5dd7..00000000000 --- a/db/schema_migrations/20210407150240 +++ /dev/null @@ -1 +0,0 @@ -b5f83e3870dc7c70fbde6071725aa2acb3e99f7c2ed050633c34ed35e696ba1e \ No newline at end of file diff --git a/db/schema_migrations/20210409084242 b/db/schema_migrations/20210409084242 deleted file mode 100644 index 2d932018355..00000000000 --- a/db/schema_migrations/20210409084242 +++ /dev/null @@ -1 +0,0 @@ -6bd35117ca922fc0d9cb8cbd9b0e6d5d9216457182d5679e705c1f03eef05921 \ No newline at end of file diff --git a/db/schema_migrations/20210409185501 b/db/schema_migrations/20210409185501 deleted file mode 100644 index 9aa098eb495..00000000000 --- a/db/schema_migrations/20210409185501 +++ /dev/null @@ -1 +0,0 @@ -3655b51b9975a73f3b141f53a0e89aba5b90a030abb8f1dfec3d3bcbb08aa1ec \ No newline at end of file diff --git a/db/schema_migrations/20210409185531 b/db/schema_migrations/20210409185531 deleted file mode 100644 index c399a2e9258..00000000000 --- a/db/schema_migrations/20210409185531 +++ /dev/null @@ -1 +0,0 @@ -1ecd19849ca362a360719c46893f793ffc52b08bd85603305e3fd4d43f3b7ef2 \ No newline at end of file diff --git a/db/schema_migrations/20210411212813 b/db/schema_migrations/20210411212813 deleted file mode 100644 index 835191bf73c..00000000000 --- a/db/schema_migrations/20210411212813 +++ /dev/null @@ -1 +0,0 @@ -47c1d8d699a18f4c52178dd5de6434f9997166e05acd70bdc40ff85a1572a797 \ No newline at end of file diff --git a/db/schema_migrations/20210412111213 b/db/schema_migrations/20210412111213 deleted file mode 100644 index 0d271af38c2..00000000000 --- a/db/schema_migrations/20210412111213 +++ /dev/null @@ -1 +0,0 @@ -c75ab8ef4d6a4ff20109e1c5d054521bd8cd79680f96f4d9e55331d69bac73d6 \ No newline at end of file diff --git a/db/schema_migrations/20210412132736 b/db/schema_migrations/20210412132736 deleted file mode 100644 index 23cadad52aa..00000000000 --- a/db/schema_migrations/20210412132736 +++ /dev/null @@ -1 +0,0 @@ -fa3287ed845c2fa24c3c65825362b4393433e273a3e94ed454ef5cc3b373d8a3 \ No newline at end of file diff --git a/db/schema_migrations/20210412132824 b/db/schema_migrations/20210412132824 deleted file mode 100644 index 3c5d9b79115..00000000000 --- a/db/schema_migrations/20210412132824 +++ /dev/null @@ -1 +0,0 @@ -cb02cb38d6f050ac49ac2c963307da4543590cc5ebd50fbc2225c519f1c96849 \ No newline at end of file diff --git a/db/schema_migrations/20210412142223 b/db/schema_migrations/20210412142223 deleted file mode 100644 index 9ddb9b7f1e4..00000000000 --- a/db/schema_migrations/20210412142223 +++ /dev/null @@ -1 +0,0 @@ -4a1435a56b8e5cddd83b844f84374bca91810bbfc5f44faf2a53fd41f93be69c \ No newline at end of file diff --git a/db/schema_migrations/20210412172030 b/db/schema_migrations/20210412172030 deleted file mode 100644 index 50b9d2be5d5..00000000000 --- a/db/schema_migrations/20210412172030 +++ /dev/null @@ -1 +0,0 @@ -063cfa0d8a4b9d3947aaf55f0587f6a2a9521866b6e10fc307c5cc82ca3a0623 \ No newline at end of file diff --git a/db/schema_migrations/20210413092922 b/db/schema_migrations/20210413092922 deleted file mode 100644 index 08d7beaec7f..00000000000 --- a/db/schema_migrations/20210413092922 +++ /dev/null @@ -1 +0,0 @@ -2da634fa920e3989d9b8e53ddc1ba005e5bc0f4701426e3841d90a42bd2e908f \ No newline at end of file diff --git a/db/schema_migrations/20210413121101 b/db/schema_migrations/20210413121101 deleted file mode 100644 index 0eef2adc713..00000000000 --- a/db/schema_migrations/20210413121101 +++ /dev/null @@ -1 +0,0 @@ -fe98a617ac8bacf270425c1e9b9b60aee1c3c0e47d5c915fe122cb99c1c1c822 \ No newline at end of file diff --git a/db/schema_migrations/20210413123832 b/db/schema_migrations/20210413123832 deleted file mode 100644 index 4a8af15f336..00000000000 --- a/db/schema_migrations/20210413123832 +++ /dev/null @@ -1 +0,0 @@ -d166250305c2939bea8cc1970faf50d86776d32270a80a429cce668a97280aad \ No newline at end of file diff --git a/db/schema_migrations/20210413130011 b/db/schema_migrations/20210413130011 deleted file mode 100644 index c67e9705e7a..00000000000 --- a/db/schema_migrations/20210413130011 +++ /dev/null @@ -1 +0,0 @@ -943466b272406a95c478337de84f72388dae88a8cf88f3b389e3ade9d4ecd63d \ No newline at end of file diff --git a/db/schema_migrations/20210413132500 b/db/schema_migrations/20210413132500 deleted file mode 100644 index 662c7e33ef0..00000000000 --- a/db/schema_migrations/20210413132500 +++ /dev/null @@ -1 +0,0 @@ -407806cc168ef9859c9a4f1bd4db7a56aee01367e784ea0767889863b9ace35d \ No newline at end of file diff --git a/db/schema_migrations/20210413155324 b/db/schema_migrations/20210413155324 deleted file mode 100644 index ab7e4256fdb..00000000000 --- a/db/schema_migrations/20210413155324 +++ /dev/null @@ -1 +0,0 @@ -7bb8be1616a61b12392bc5ff4d716123bc605d9753744c04a23f9258bab25af6 \ No newline at end of file diff --git a/db/schema_migrations/20210414045322 b/db/schema_migrations/20210414045322 deleted file mode 100644 index f95da121569..00000000000 --- a/db/schema_migrations/20210414045322 +++ /dev/null @@ -1 +0,0 @@ -197930adaf08e3d22d54309d1cc0605bc4d6843409a38f8e0cc9ce9842ec1816 \ No newline at end of file diff --git a/db/schema_migrations/20210414095944 b/db/schema_migrations/20210414095944 deleted file mode 100644 index 67abfa19822..00000000000 --- a/db/schema_migrations/20210414095944 +++ /dev/null @@ -1 +0,0 @@ -843d9eabf8b67fe10d9eb453e887032d5b88b8594ae666bc6c6ac81e20e1ab53 \ No newline at end of file diff --git a/db/schema_migrations/20210414100914 b/db/schema_migrations/20210414100914 deleted file mode 100644 index dcbc93d9987..00000000000 --- a/db/schema_migrations/20210414100914 +++ /dev/null @@ -1 +0,0 @@ -4950567ba7071183bc008936e4bbe1391dd0100c5caa2a6821be85dc3d2423fc \ No newline at end of file diff --git a/db/schema_migrations/20210414130017 b/db/schema_migrations/20210414130017 deleted file mode 100644 index 0eaffe4ddd1..00000000000 --- a/db/schema_migrations/20210414130017 +++ /dev/null @@ -1 +0,0 @@ -202409998a03fd29c52e3ee9546ab8ec7aa3c56173ee755e9342f1cc6a5f1f6b \ No newline at end of file diff --git a/db/schema_migrations/20210414130526 b/db/schema_migrations/20210414130526 deleted file mode 100644 index ebba5c47f22..00000000000 --- a/db/schema_migrations/20210414130526 +++ /dev/null @@ -1 +0,0 @@ -2343decc3abb79b38bcde6aba5a8fd208842096d7fb7a4c51872f66f1a125296 \ No newline at end of file diff --git a/db/schema_migrations/20210414131600 b/db/schema_migrations/20210414131600 deleted file mode 100644 index 2ed1c9856ae..00000000000 --- a/db/schema_migrations/20210414131600 +++ /dev/null @@ -1 +0,0 @@ -199c8a540cb4a0dd30a86a81f993798afb3e7384f1176b71a780d5950a52eb5f \ No newline at end of file diff --git a/db/schema_migrations/20210414131807 b/db/schema_migrations/20210414131807 deleted file mode 100644 index 9a7800b86f8..00000000000 --- a/db/schema_migrations/20210414131807 +++ /dev/null @@ -1 +0,0 @@ -4db08c0fecd210b329492596cf029518484d256bdb06efff233b3a38677fd6a6 \ No newline at end of file diff --git a/db/schema_migrations/20210414133310 b/db/schema_migrations/20210414133310 deleted file mode 100644 index 9a0a224e09b..00000000000 --- a/db/schema_migrations/20210414133310 +++ /dev/null @@ -1 +0,0 @@ -f306cf9553e4bd237cfdff31d5432d4ff44302a923e475c477f76d32ccb4d257 \ No newline at end of file diff --git a/db/schema_migrations/20210415074645 b/db/schema_migrations/20210415074645 deleted file mode 100644 index d996f095dce..00000000000 --- a/db/schema_migrations/20210415074645 +++ /dev/null @@ -1 +0,0 @@ -393a7f1029f05f73c26e031c8980734e13c304846c3457d581c006dc2566d94d \ No newline at end of file diff --git a/db/schema_migrations/20210415100159 b/db/schema_migrations/20210415100159 deleted file mode 100644 index 3ee36c7de17..00000000000 --- a/db/schema_migrations/20210415100159 +++ /dev/null @@ -1 +0,0 @@ -dd6474593b6f4dd82f7f4776f558a82fa34307c45e20f13f77807f7dc96db368 \ No newline at end of file diff --git a/db/schema_migrations/20210415101228 b/db/schema_migrations/20210415101228 deleted file mode 100644 index 8edbeee69dc..00000000000 --- a/db/schema_migrations/20210415101228 +++ /dev/null @@ -1 +0,0 @@ -2ba1f8832a6ba4300796ff9f74dfa2d0ff7a648a9231db369274ad002d0e4ec8 \ No newline at end of file diff --git a/db/schema_migrations/20210415142700 b/db/schema_migrations/20210415142700 deleted file mode 100644 index 22b10173911..00000000000 --- a/db/schema_migrations/20210415142700 +++ /dev/null @@ -1 +0,0 @@ -2d6d62b036c937136dfbb11becfd3c2c705f0db1e3a38fdcefe676106168ab29 \ No newline at end of file diff --git a/db/schema_migrations/20210415144538 b/db/schema_migrations/20210415144538 deleted file mode 100644 index 6b8e0d78b65..00000000000 --- a/db/schema_migrations/20210415144538 +++ /dev/null @@ -1 +0,0 @@ -d237690af576fb5a85d984416dcca1936a140a10a9b6c968d3ff57419568fb8f \ No newline at end of file diff --git a/db/schema_migrations/20210415155043 b/db/schema_migrations/20210415155043 deleted file mode 100644 index 490e4ba5557..00000000000 --- a/db/schema_migrations/20210415155043 +++ /dev/null @@ -1 +0,0 @@ -af66cb13eca39cc6b9970e6764d08b5b353f212d844267afb5583e888c7d2c94 \ No newline at end of file diff --git a/db/schema_migrations/20210415172516 b/db/schema_migrations/20210415172516 deleted file mode 100644 index ad129261acf..00000000000 --- a/db/schema_migrations/20210415172516 +++ /dev/null @@ -1 +0,0 @@ -06d33e4eb99e46cb6caf71916e5c93c4b7eb9fe73152841c7c41d5e157ec339e \ No newline at end of file diff --git a/db/schema_migrations/20210416172516 b/db/schema_migrations/20210416172516 deleted file mode 100644 index 2ab991bb99c..00000000000 --- a/db/schema_migrations/20210416172516 +++ /dev/null @@ -1 +0,0 @@ -26f3978600808eae8396e0d5292bae95feca52ff3e44a019c04bd9708f27cc84 \ No newline at end of file diff --git a/db/schema_migrations/20210419090412 b/db/schema_migrations/20210419090412 deleted file mode 100644 index de75d4e5cfc..00000000000 --- a/db/schema_migrations/20210419090412 +++ /dev/null @@ -1 +0,0 @@ -da9c3d764a5750a40e0f6edd2e713efd77620ba3e684e48d47c7f855e47b2984 \ No newline at end of file diff --git a/db/schema_migrations/20210419090542 b/db/schema_migrations/20210419090542 deleted file mode 100644 index a6b265e4d17..00000000000 --- a/db/schema_migrations/20210419090542 +++ /dev/null @@ -1 +0,0 @@ -7a7b0eaa67851aa9300e4750fd05c6d2d0b49ca7077099a0208a89c74ac03a2c \ No newline at end of file diff --git a/db/schema_migrations/20210419203017 b/db/schema_migrations/20210419203017 deleted file mode 100644 index 8421fd7c6d9..00000000000 --- a/db/schema_migrations/20210419203017 +++ /dev/null @@ -1 +0,0 @@ -1ca5f960c233be5d5a30632b8aaad9598c259154eee817f4d76e8f1bb3e95edb \ No newline at end of file diff --git a/db/schema_migrations/20210419203018 b/db/schema_migrations/20210419203018 deleted file mode 100644 index f28ebe78fc6..00000000000 --- a/db/schema_migrations/20210419203018 +++ /dev/null @@ -1 +0,0 @@ -94404ed645a9c8a0ee462baff98cf2d0e50aecdb71bb1515fd3a82bf1a39dfda \ No newline at end of file diff --git a/db/schema_migrations/20210419224834 b/db/schema_migrations/20210419224834 deleted file mode 100644 index 61926cfb1df..00000000000 --- a/db/schema_migrations/20210419224834 +++ /dev/null @@ -1 +0,0 @@ -145782c0cb0d24617e0e43c43f49a0f1d4033df3f303e4d4085e586c48e2408e \ No newline at end of file diff --git a/db/schema_migrations/20210420012444 b/db/schema_migrations/20210420012444 deleted file mode 100644 index 5c098f44bc8..00000000000 --- a/db/schema_migrations/20210420012444 +++ /dev/null @@ -1 +0,0 @@ -f0bf8c79c1981ecd95c933f37ec5b0187ee6321792d96db26d863b192843c5ab \ No newline at end of file diff --git a/db/schema_migrations/20210420012909 b/db/schema_migrations/20210420012909 deleted file mode 100644 index e4e00349df7..00000000000 --- a/db/schema_migrations/20210420012909 +++ /dev/null @@ -1 +0,0 @@ -c9e8c49bf272ef49d906431bdc11a24abe967a9d7e95976d70c48b21b48a062b \ No newline at end of file diff --git a/db/schema_migrations/20210420103955 b/db/schema_migrations/20210420103955 deleted file mode 100644 index 001c89e1d10..00000000000 --- a/db/schema_migrations/20210420103955 +++ /dev/null @@ -1 +0,0 @@ -1ee3df66a0e7d1802196740cc1c0a899724c1f5b3dd8be4316915b354446f238 \ No newline at end of file diff --git a/db/schema_migrations/20210420120734 b/db/schema_migrations/20210420120734 deleted file mode 100644 index 124fb5b28fe..00000000000 --- a/db/schema_migrations/20210420120734 +++ /dev/null @@ -1 +0,0 @@ -5404ecd22f943671c076b0e870a487ec822cb3d594c223ad4db5b1584394ceb6 \ No newline at end of file diff --git a/db/schema_migrations/20210420121149 b/db/schema_migrations/20210420121149 deleted file mode 100644 index 1326ed9a6f6..00000000000 --- a/db/schema_migrations/20210420121149 +++ /dev/null @@ -1 +0,0 @@ -58cd21a02a395564acf9abcc39c3daafc5db90aa0b3f29133644f21bb669cdf6 \ No newline at end of file diff --git a/db/schema_migrations/20210420173030 b/db/schema_migrations/20210420173030 deleted file mode 100644 index e7e3caf8365..00000000000 --- a/db/schema_migrations/20210420173030 +++ /dev/null @@ -1 +0,0 @@ -3a223c462b10edb9eb68fc0adf42f046a45f554f35b4b4ee64a834cd7372f827 \ No newline at end of file diff --git a/db/schema_migrations/20210420210642 b/db/schema_migrations/20210420210642 deleted file mode 100644 index dd5d165df5e..00000000000 --- a/db/schema_migrations/20210420210642 +++ /dev/null @@ -1 +0,0 @@ -b7f75e3b443bfcb1aea812ad1682a31a99021f41ef4d47bdf600437db6f4f2f3 \ No newline at end of file diff --git a/db/schema_migrations/20210420221106 b/db/schema_migrations/20210420221106 deleted file mode 100644 index cfe3e6e5406..00000000000 --- a/db/schema_migrations/20210420221106 +++ /dev/null @@ -1 +0,0 @@ -62842b9e9753b7880e980b0a16335e7d00bdce8b7b42d94b1ba26828724c01dd \ No newline at end of file diff --git a/db/schema_migrations/20210421021510 b/db/schema_migrations/20210421021510 deleted file mode 100644 index 775f083ac63..00000000000 --- a/db/schema_migrations/20210421021510 +++ /dev/null @@ -1 +0,0 @@ -6a278c90b8c97fc2255528605ee6bf4547e37ac8c4c17979483ed9db562fa021 \ No newline at end of file diff --git a/db/schema_migrations/20210421022010 b/db/schema_migrations/20210421022010 deleted file mode 100644 index 75abced628d..00000000000 --- a/db/schema_migrations/20210421022010 +++ /dev/null @@ -1 +0,0 @@ -454992d01fa140896ff2a9cea66fb855c9e659a5a7969ac9a3cb5a608de36161 \ No newline at end of file diff --git a/db/schema_migrations/20210421081724 b/db/schema_migrations/20210421081724 deleted file mode 100644 index a246cfdd428..00000000000 --- a/db/schema_migrations/20210421081724 +++ /dev/null @@ -1 +0,0 @@ -9049dc22e97261115ba935a059beb5b4f2eb810f1fdcc0881f96d4b6a501ab09 \ No newline at end of file diff --git a/db/schema_migrations/20210421163509 b/db/schema_migrations/20210421163509 deleted file mode 100644 index b31e8209bbe..00000000000 --- a/db/schema_migrations/20210421163509 +++ /dev/null @@ -1 +0,0 @@ -0f6019cc094481cafbf0c9bd42f53ae09034ea87e3f360b02f9ec03192caab9d \ No newline at end of file diff --git a/db/schema_migrations/20210421190157 b/db/schema_migrations/20210421190157 deleted file mode 100644 index a33c8336763..00000000000 --- a/db/schema_migrations/20210421190157 +++ /dev/null @@ -1 +0,0 @@ -943e415d3cc1090286aece96c013e54e4c07a7c16d8a7be82b560b1a3e36d513 \ No newline at end of file diff --git a/db/schema_migrations/20210422022825 b/db/schema_migrations/20210422022825 deleted file mode 100644 index 4f1313658ac..00000000000 --- a/db/schema_migrations/20210422022825 +++ /dev/null @@ -1 +0,0 @@ -d0119a45e6ab08afa6ed73a248b81cae4a4de63d46fda25968444256355d208f \ No newline at end of file diff --git a/db/schema_migrations/20210422023046 b/db/schema_migrations/20210422023046 deleted file mode 100644 index 520db7527d3..00000000000 --- a/db/schema_migrations/20210422023046 +++ /dev/null @@ -1 +0,0 @@ -e588b2e6c612e4a25615d9c5179100af20d3507e0eec8feba52bc6b45d9befea \ No newline at end of file diff --git a/db/schema_migrations/20210422142647 b/db/schema_migrations/20210422142647 deleted file mode 100644 index f5a8b6cc29f..00000000000 --- a/db/schema_migrations/20210422142647 +++ /dev/null @@ -1 +0,0 @@ -eaefc2a0f08ce312b1ae3fb100e4a818eb3013b95c38d940371a25b605b09ca1 \ No newline at end of file diff --git a/db/schema_migrations/20210422181809 b/db/schema_migrations/20210422181809 deleted file mode 100644 index 547e44f87b3..00000000000 --- a/db/schema_migrations/20210422181809 +++ /dev/null @@ -1 +0,0 @@ -870589d3a4b4bc139ac29b0d87b0f9e777de21e854e5692c0dedd6683c83649a \ No newline at end of file diff --git a/db/schema_migrations/20210422195929 b/db/schema_migrations/20210422195929 deleted file mode 100644 index 1078f45678d..00000000000 --- a/db/schema_migrations/20210422195929 +++ /dev/null @@ -1 +0,0 @@ -d72c4cbd4d34fcfb3aae5aa11c583509b41499aa8bd107957934ab57d1756544 \ No newline at end of file diff --git a/db/schema_migrations/20210423054022 b/db/schema_migrations/20210423054022 deleted file mode 100644 index 4717a9e99b7..00000000000 --- a/db/schema_migrations/20210423054022 +++ /dev/null @@ -1 +0,0 @@ -84f7b631c9017b286665beca42fb30e064c852d5a21c2f82a8bee6f0d5e62c25 \ No newline at end of file diff --git a/db/schema_migrations/20210423054537 b/db/schema_migrations/20210423054537 deleted file mode 100644 index a530190a32e..00000000000 --- a/db/schema_migrations/20210423054537 +++ /dev/null @@ -1 +0,0 @@ -0ea5c328f9d15d73744f8847c4b1071e2a360cd52ce0da1216ca6acc768050e5 \ No newline at end of file diff --git a/db/schema_migrations/20210423054846 b/db/schema_migrations/20210423054846 deleted file mode 100644 index 08669e2427b..00000000000 --- a/db/schema_migrations/20210423054846 +++ /dev/null @@ -1 +0,0 @@ -013106237f73a94606f962f54c740af23deac637c8e075471ba03ef5d6c1b953 \ No newline at end of file diff --git a/db/schema_migrations/20210423124223 b/db/schema_migrations/20210423124223 deleted file mode 100644 index d5b07602553..00000000000 --- a/db/schema_migrations/20210423124223 +++ /dev/null @@ -1 +0,0 @@ -6b508f1a48402aa2db3862e2e31ee4ccb851f535ed59f9b949ac1bad0ff2f0e1 \ No newline at end of file diff --git a/db/schema_migrations/20210423155059 b/db/schema_migrations/20210423155059 deleted file mode 100644 index 2ac51dcdd2b..00000000000 --- a/db/schema_migrations/20210423155059 +++ /dev/null @@ -1 +0,0 @@ -c582b7dda33492e122725001200aeb470cbf4458f247728a3b2102e325c97193 \ No newline at end of file diff --git a/db/schema_migrations/20210423160427 b/db/schema_migrations/20210423160427 deleted file mode 100644 index ecae878d8a2..00000000000 --- a/db/schema_migrations/20210423160427 +++ /dev/null @@ -1 +0,0 @@ -e8f88972826a030894f38b8959418096771bf4e88a3b90f0026aaae3977d1db1 \ No newline at end of file diff --git a/db/schema_migrations/20210423164702 b/db/schema_migrations/20210423164702 deleted file mode 100644 index 3f800be3749..00000000000 --- a/db/schema_migrations/20210423164702 +++ /dev/null @@ -1 +0,0 @@ -b5e34f7827edcdf81c66250353cddc3481e39c693f983df610b8ed20c58cb65b \ No newline at end of file diff --git a/db/schema_migrations/20210423171304 b/db/schema_migrations/20210423171304 deleted file mode 100644 index 56db70a407c..00000000000 --- a/db/schema_migrations/20210423171304 +++ /dev/null @@ -1 +0,0 @@ -06ead319cbc56b25769ed06b6a246d705b467d34a5d09ab9282e2d83c55511ba \ No newline at end of file diff --git a/db/schema_migrations/20210424115725 b/db/schema_migrations/20210424115725 deleted file mode 100644 index e1b7faf5276..00000000000 --- a/db/schema_migrations/20210424115725 +++ /dev/null @@ -1 +0,0 @@ -66c4c48c53131a156c0bf45982691e9017373aefae1f7b6d7053467481b3f5cf \ No newline at end of file diff --git a/db/schema_migrations/20210424163400 b/db/schema_migrations/20210424163400 deleted file mode 100644 index ebc4b319aca..00000000000 --- a/db/schema_migrations/20210424163400 +++ /dev/null @@ -1 +0,0 @@ -808e4c1b0bb4f44afea57cce84820ef1371ae852d7cbc79ef454c04219ea956d \ No newline at end of file diff --git a/db/schema_migrations/20210426094524 b/db/schema_migrations/20210426094524 deleted file mode 100644 index 832f2728534..00000000000 --- a/db/schema_migrations/20210426094524 +++ /dev/null @@ -1 +0,0 @@ -46de2e905a591c14ce18acf041bac6fb48ec19ad9f40fababcbf27ae02f7fa75 \ No newline at end of file diff --git a/db/schema_migrations/20210426094549 b/db/schema_migrations/20210426094549 deleted file mode 100644 index 8e3c5347a50..00000000000 --- a/db/schema_migrations/20210426094549 +++ /dev/null @@ -1 +0,0 @@ -12ad8f05a4d864d9986d6ca400a687c40b2de1acb461b134a8103f9a882921e7 \ No newline at end of file diff --git a/db/schema_migrations/20210426225417 b/db/schema_migrations/20210426225417 deleted file mode 100644 index 2ba6e666520..00000000000 --- a/db/schema_migrations/20210426225417 +++ /dev/null @@ -1 +0,0 @@ -50d370d2465fa4c0d3c2bd963d5745474ca35a43609d0e754f3fe69eb7a7179f \ No newline at end of file diff --git a/db/schema_migrations/20210427045604 b/db/schema_migrations/20210427045604 deleted file mode 100644 index 6cb29994a87..00000000000 --- a/db/schema_migrations/20210427045604 +++ /dev/null @@ -1 +0,0 @@ -bdeb78403607d45d5eb779623d0e2aa1acf026f6aced6f1134824a35dfec7e74 \ No newline at end of file diff --git a/db/schema_migrations/20210427045711 b/db/schema_migrations/20210427045711 deleted file mode 100644 index bb713fc08d0..00000000000 --- a/db/schema_migrations/20210427045711 +++ /dev/null @@ -1 +0,0 @@ -3cd56794ac903d9598863215a34eda62c3dc96bed78bed5b8a99fc522e319b35 \ No newline at end of file diff --git a/db/schema_migrations/20210427062807 b/db/schema_migrations/20210427062807 deleted file mode 100644 index c9d82dfa931..00000000000 --- a/db/schema_migrations/20210427062807 +++ /dev/null @@ -1 +0,0 @@ -306bb2bc3bfd20a57f1ac473e32596e7b7e7b6c2ae41c3fe5a7f45c551ce9207 \ No newline at end of file diff --git a/db/schema_migrations/20210427084924 b/db/schema_migrations/20210427084924 deleted file mode 100644 index feaeeefa80b..00000000000 --- a/db/schema_migrations/20210427084924 +++ /dev/null @@ -1 +0,0 @@ -a2fcf3576de4ee5afdab8d07ffc6c2c8f96d6cc85c332f6ab69f2936bf9e58ae \ No newline at end of file diff --git a/db/schema_migrations/20210427085020 b/db/schema_migrations/20210427085020 deleted file mode 100644 index 7f45de093b4..00000000000 --- a/db/schema_migrations/20210427085020 +++ /dev/null @@ -1 +0,0 @@ -2e30910d106dd6805f42ffc226d9008b826fa88eaec7091960e11db850b714c4 \ No newline at end of file diff --git a/db/schema_migrations/20210427094931 b/db/schema_migrations/20210427094931 deleted file mode 100644 index 830c92e9878..00000000000 --- a/db/schema_migrations/20210427094931 +++ /dev/null @@ -1 +0,0 @@ -aa0ae491a7f94d99ea0c42250434245a4f23b0084657b709b0aaad0317dfd6b1 \ No newline at end of file diff --git a/db/schema_migrations/20210427125400 b/db/schema_migrations/20210427125400 deleted file mode 100644 index 285f1efb026..00000000000 --- a/db/schema_migrations/20210427125400 +++ /dev/null @@ -1 +0,0 @@ -7632c2442c5cb9194c177df9b9106efdb433d43b34250fc434c1e1ff2f8ed8f0 \ No newline at end of file diff --git a/db/schema_migrations/20210427194958 b/db/schema_migrations/20210427194958 deleted file mode 100644 index a707b804ba9..00000000000 --- a/db/schema_migrations/20210427194958 +++ /dev/null @@ -1 +0,0 @@ -0a7bf3fe10a5eca94392a599d0736c881065a0b2c33bb383c0b91eb5ac453db9 \ No newline at end of file diff --git a/db/schema_migrations/20210427200840 b/db/schema_migrations/20210427200840 deleted file mode 100644 index 3e84d260952..00000000000 --- a/db/schema_migrations/20210427200840 +++ /dev/null @@ -1 +0,0 @@ -7e90e64df39205c79a67acc311cd58dd9b55d2b3919d58749e3253854f99a44a \ No newline at end of file diff --git a/db/schema_migrations/20210427212034 b/db/schema_migrations/20210427212034 deleted file mode 100644 index 4954b5722a9..00000000000 --- a/db/schema_migrations/20210427212034 +++ /dev/null @@ -1 +0,0 @@ -2ffe65c4abcb8f638198943e1b74de710387438fb7c93addb05ccb3e86729934 \ No newline at end of file diff --git a/db/schema_migrations/20210428151144 b/db/schema_migrations/20210428151144 deleted file mode 100644 index 53771dd9401..00000000000 --- a/db/schema_migrations/20210428151144 +++ /dev/null @@ -1 +0,0 @@ -468373a97f7bd66197c81f01bebd27256cf96ec8fc226c5d73e579a7ecc3930d \ No newline at end of file diff --git a/db/schema_migrations/20210428151238 b/db/schema_migrations/20210428151238 deleted file mode 100644 index 3fa6ecefc42..00000000000 --- a/db/schema_migrations/20210428151238 +++ /dev/null @@ -1 +0,0 @@ -3244023441c2afa450ad76345a494975b4a7154892298daf1ec4223d27fb7ca3 \ No newline at end of file diff --git a/db/schema_migrations/20210429024843 b/db/schema_migrations/20210429024843 deleted file mode 100644 index 2016dde93b6..00000000000 --- a/db/schema_migrations/20210429024843 +++ /dev/null @@ -1 +0,0 @@ -5307ed6d22ba2575db0734eb8949b6987e58be27a845921b4943123adc2b9f41 \ No newline at end of file diff --git a/db/schema_migrations/20210429032320 b/db/schema_migrations/20210429032320 deleted file mode 100644 index a026fb1a3c5..00000000000 --- a/db/schema_migrations/20210429032320 +++ /dev/null @@ -1 +0,0 @@ -f1a5f9a394c02544be99316d8e64464adeb4f9849875200e7e8be6fe826e5e62 \ No newline at end of file diff --git a/db/schema_migrations/20210429131525 b/db/schema_migrations/20210429131525 deleted file mode 100644 index 4ab6b84eea9..00000000000 --- a/db/schema_migrations/20210429131525 +++ /dev/null @@ -1 +0,0 @@ -68ac54fa7b4e4ef99e58c31d8f960b6f986fd679c11ead235704c7a75b4617ac \ No newline at end of file diff --git a/db/schema_migrations/20210429143649 b/db/schema_migrations/20210429143649 deleted file mode 100644 index 6e7469ef4de..00000000000 --- a/db/schema_migrations/20210429143649 +++ /dev/null @@ -1 +0,0 @@ -949e1323d1fadd8db3b8b337f3071ab7b7a7c45b11dc40924fb64c074596a327 \ No newline at end of file diff --git a/db/schema_migrations/20210429181325 b/db/schema_migrations/20210429181325 deleted file mode 100644 index d778566a580..00000000000 --- a/db/schema_migrations/20210429181325 +++ /dev/null @@ -1 +0,0 @@ -9674f04640f897928925ff1e23ff6d3ff918627b7c2374713a31071678956614 \ No newline at end of file diff --git a/db/schema_migrations/20210429192653 b/db/schema_migrations/20210429192653 deleted file mode 100644 index 5e380380d72..00000000000 --- a/db/schema_migrations/20210429192653 +++ /dev/null @@ -1 +0,0 @@ -c2b5ad6786e1c71ccff391b03fcd0635dfd42d69484443291a692cef9f3ffda5 \ No newline at end of file diff --git a/db/schema_migrations/20210429193106 b/db/schema_migrations/20210429193106 deleted file mode 100644 index 49f1838a585..00000000000 --- a/db/schema_migrations/20210429193106 +++ /dev/null @@ -1 +0,0 @@ -e0898e4e439cde4e3b84808e7505490fe956cf17922f5c779b3384997d36cafd \ No newline at end of file diff --git a/db/schema_migrations/20210430034712 b/db/schema_migrations/20210430034712 deleted file mode 100644 index df9fe0755cf..00000000000 --- a/db/schema_migrations/20210430034712 +++ /dev/null @@ -1 +0,0 @@ -6b7436d7712e31ca116204d37270435ccc059ca75a128750e5c39fdddfa020e3 \ No newline at end of file diff --git a/db/schema_migrations/20210430100947 b/db/schema_migrations/20210430100947 deleted file mode 100644 index 409d807ff2a..00000000000 --- a/db/schema_migrations/20210430100947 +++ /dev/null @@ -1 +0,0 @@ -c8875e02134542370cc5a792bdaefc77b66f58a33a46720f5ef562c33c5b8f41 \ No newline at end of file diff --git a/db/schema_migrations/20210430121522 b/db/schema_migrations/20210430121522 deleted file mode 100644 index 0ad04fc386a..00000000000 --- a/db/schema_migrations/20210430121522 +++ /dev/null @@ -1 +0,0 @@ -feee3b817b18ab913071c29b5c6283d91268dc62b31ee2441c1cb116bf0d77c9 \ No newline at end of file diff --git a/db/schema_migrations/20210430121542 b/db/schema_migrations/20210430121542 deleted file mode 100644 index 40ad284a6ba..00000000000 --- a/db/schema_migrations/20210430121542 +++ /dev/null @@ -1 +0,0 @@ -00ac4ff6896f65d7ad7d259d7e5a39efcbf73b189f7c2c5a472f50aa45663235 \ No newline at end of file diff --git a/db/schema_migrations/20210430122951 b/db/schema_migrations/20210430122951 deleted file mode 100644 index 43c90a10f22..00000000000 --- a/db/schema_migrations/20210430122951 +++ /dev/null @@ -1 +0,0 @@ -476dc70eae87ad3ee30e6be8c1afb4a2aec23a09b96daba2afbd9c4e2edb12b9 \ No newline at end of file diff --git a/db/schema_migrations/20210430124212 b/db/schema_migrations/20210430124212 deleted file mode 100644 index dd3e8c1f371..00000000000 --- a/db/schema_migrations/20210430124212 +++ /dev/null @@ -1 +0,0 @@ -ebdeb56647f3a7ff5620141833c90b796a9ddfed39234bcf8063ca5b3df6c1f3 \ No newline at end of file diff --git a/db/schema_migrations/20210430124630 b/db/schema_migrations/20210430124630 deleted file mode 100644 index 2366ab58ef4..00000000000 --- a/db/schema_migrations/20210430124630 +++ /dev/null @@ -1 +0,0 @@ -7f6862205e8c315da8433083fc5391f8889951f62d466e0048063322a46f9cc7 \ No newline at end of file diff --git a/db/schema_migrations/20210430130259 b/db/schema_migrations/20210430130259 deleted file mode 100644 index b8064b30f52..00000000000 --- a/db/schema_migrations/20210430130259 +++ /dev/null @@ -1 +0,0 @@ -c4a4b214f15a1a8d7f6832782d50077189281ca9a9b1b746a0a3bc3af4a47e3c \ No newline at end of file diff --git a/db/schema_migrations/20210430134202 b/db/schema_migrations/20210430134202 deleted file mode 100644 index cb9eee98cc0..00000000000 --- a/db/schema_migrations/20210430134202 +++ /dev/null @@ -1 +0,0 @@ -77e2b8c1c6054a80122f97dda1e843149fefb7bf6694fdfa897d691d61162d81 \ No newline at end of file diff --git a/db/schema_migrations/20210430135954 b/db/schema_migrations/20210430135954 deleted file mode 100644 index 9e201905704..00000000000 --- a/db/schema_migrations/20210430135954 +++ /dev/null @@ -1 +0,0 @@ -c5fe6f74822168599ad5069bb7c793ec96a4bba99d15ad29cb161ef24291b56d \ No newline at end of file diff --git a/db/schema_migrations/20210430154631 b/db/schema_migrations/20210430154631 deleted file mode 100644 index 6369c657d5a..00000000000 --- a/db/schema_migrations/20210430154631 +++ /dev/null @@ -1 +0,0 @@ -08f4cd1f8f7ddc336d0edee7581b0cb59e0cdc7b5f3cbeb1ccdcd7a1c52d366f \ No newline at end of file diff --git a/db/schema_migrations/20210503105022 b/db/schema_migrations/20210503105022 deleted file mode 100644 index ada5b2db7da..00000000000 --- a/db/schema_migrations/20210503105022 +++ /dev/null @@ -1 +0,0 @@ -de8bf6c02589bf308914d43e5cd44dae91d3bbabcdaafcebdb96fba0a09b20bc \ No newline at end of file diff --git a/db/schema_migrations/20210503105845 b/db/schema_migrations/20210503105845 deleted file mode 100644 index ff2c910491b..00000000000 --- a/db/schema_migrations/20210503105845 +++ /dev/null @@ -1 +0,0 @@ -2fdcb66e511d8322ea8fc4de66ecce859f8e91b2a9da22336281a1e784d9b4a5 \ No newline at end of file diff --git a/db/schema_migrations/20210503131747 b/db/schema_migrations/20210503131747 deleted file mode 100644 index 52771dcb5de..00000000000 --- a/db/schema_migrations/20210503131747 +++ /dev/null @@ -1 +0,0 @@ -583c350d82c4d02e910f2c16ed2ec55ccdc880c87b55bf7bd6be3e1839958732 \ No newline at end of file diff --git a/db/schema_migrations/20210504085144 b/db/schema_migrations/20210504085144 deleted file mode 100644 index 67abcd8eece..00000000000 --- a/db/schema_migrations/20210504085144 +++ /dev/null @@ -1 +0,0 @@ -3cdf8e93c4b80867a5d8e086f3f44eaeb479e875abf16187b94b3f6238faf062 \ No newline at end of file diff --git a/db/schema_migrations/20210504135823 b/db/schema_migrations/20210504135823 deleted file mode 100644 index 24c5fd50087..00000000000 --- a/db/schema_migrations/20210504135823 +++ /dev/null @@ -1 +0,0 @@ -9d1254393da80e0b1e387fba493f83f8775f0340f23c648e638a9983f965f5c9 \ No newline at end of file diff --git a/db/schema_migrations/20210504143128 b/db/schema_migrations/20210504143128 deleted file mode 100644 index 425120e633b..00000000000 --- a/db/schema_migrations/20210504143128 +++ /dev/null @@ -1 +0,0 @@ -e5b552b21c40b83b95442341838ad5951dcac7dd473194c49630d20ce6a46ae2 \ No newline at end of file diff --git a/db/schema_migrations/20210504153354 b/db/schema_migrations/20210504153354 deleted file mode 100644 index a1f9b1d6d37..00000000000 --- a/db/schema_migrations/20210504153354 +++ /dev/null @@ -1 +0,0 @@ -c4593c1638f937618ecf3ae94a409e550dce93cc190989f581fb0007e591696d \ No newline at end of file diff --git a/db/schema_migrations/20210504164429 b/db/schema_migrations/20210504164429 deleted file mode 100644 index 2ad8695856f..00000000000 --- a/db/schema_migrations/20210504164429 +++ /dev/null @@ -1 +0,0 @@ -767cea885e6544b6958082397812357d7223b193d4b73bf09c8486dc2ec645d0 \ No newline at end of file diff --git a/db/schema_migrations/20210505070612 b/db/schema_migrations/20210505070612 deleted file mode 100644 index 454634cb74b..00000000000 --- a/db/schema_migrations/20210505070612 +++ /dev/null @@ -1 +0,0 @@ -52cc795e577a6de524cc55ce8d11f140e5d919f1164bb9983f7dd2c1ef2f0859 \ No newline at end of file diff --git a/db/schema_migrations/20210505070812 b/db/schema_migrations/20210505070812 deleted file mode 100644 index ca53caa49af..00000000000 --- a/db/schema_migrations/20210505070812 +++ /dev/null @@ -1 +0,0 @@ -7d57e1fea3652c0c04d29261d3c21b314ed443c9e61b882d22ca7f59807c312b \ No newline at end of file diff --git a/db/schema_migrations/20210505092746 b/db/schema_migrations/20210505092746 deleted file mode 100644 index b23d8ee3538..00000000000 --- a/db/schema_migrations/20210505092746 +++ /dev/null @@ -1 +0,0 @@ -ccf7bce753adabfd7dd8a68fd49853514367f11af42879cae1b6aa28e4ebe94c \ No newline at end of file diff --git a/db/schema_migrations/20210505124816 b/db/schema_migrations/20210505124816 deleted file mode 100644 index a5877ffee20..00000000000 --- a/db/schema_migrations/20210505124816 +++ /dev/null @@ -1 +0,0 @@ -56aa9590f4bc37d8f8c4ed869a4b095ba39925fb06ab58500eead895d19ee336 \ No newline at end of file diff --git a/db/schema_migrations/20210505170152 b/db/schema_migrations/20210505170152 deleted file mode 100644 index d51d04bc6ab..00000000000 --- a/db/schema_migrations/20210505170152 +++ /dev/null @@ -1 +0,0 @@ -9b16e17189d4db708553ce0d9dada1ce097be75433c3a8c09a6102e897e3123a \ No newline at end of file diff --git a/db/schema_migrations/20210506064413 b/db/schema_migrations/20210506064413 deleted file mode 100644 index 72e3336d898..00000000000 --- a/db/schema_migrations/20210506064413 +++ /dev/null @@ -1 +0,0 @@ -f400225e6caa854f825422b9799e61ea557ab4bd3e4a33dc3cd3193ed3ce1db2 \ No newline at end of file diff --git a/db/schema_migrations/20210506065000 b/db/schema_migrations/20210506065000 deleted file mode 100644 index 5ffe1800cd9..00000000000 --- a/db/schema_migrations/20210506065000 +++ /dev/null @@ -1 +0,0 @@ -d286628cce50c469afe899d5ac40f20df8dceb6ee10c6cf49c64fbaeea7e4a2e \ No newline at end of file diff --git a/db/schema_migrations/20210506150833 b/db/schema_migrations/20210506150833 deleted file mode 100644 index e63559fee8a..00000000000 --- a/db/schema_migrations/20210506150833 +++ /dev/null @@ -1 +0,0 @@ -18fdca797ea7f3a60ce5b421bec7af1ea0b0b73fbf6e1c23592acbc9d13a0a52 \ No newline at end of file diff --git a/db/schema_migrations/20210507191949 b/db/schema_migrations/20210507191949 deleted file mode 100644 index 398bcbe6638..00000000000 --- a/db/schema_migrations/20210507191949 +++ /dev/null @@ -1 +0,0 @@ -ab662ff92a4e2a7d324f0652da6f0725e1c38e387f08b89921b43816b5d35834 \ No newline at end of file diff --git a/db/schema_migrations/20210510083845 b/db/schema_migrations/20210510083845 deleted file mode 100644 index c3c67b9520e..00000000000 --- a/db/schema_migrations/20210510083845 +++ /dev/null @@ -1 +0,0 @@ -307e45d581c48b6f571fc8fa2a00dfd4360296560ee2b320540314b8f9f9e02c \ No newline at end of file diff --git a/db/schema_migrations/20210510191551 b/db/schema_migrations/20210510191551 deleted file mode 100644 index a3a58e4b59e..00000000000 --- a/db/schema_migrations/20210510191551 +++ /dev/null @@ -1 +0,0 @@ -949038f9f66788e3289afbf210617f7947762e4bbab4c7389164cbd775302642 \ No newline at end of file diff --git a/db/schema_migrations/20210510191552 b/db/schema_migrations/20210510191552 deleted file mode 100644 index ca7fd00428d..00000000000 --- a/db/schema_migrations/20210510191552 +++ /dev/null @@ -1 +0,0 @@ -e59505ee2a3ef04c1af8a426f7ebdb83874c926cf7d7f98b56e0af8cd38988f5 \ No newline at end of file diff --git a/db/schema_migrations/20210511095657 b/db/schema_migrations/20210511095657 deleted file mode 100644 index 503ccfb459a..00000000000 --- a/db/schema_migrations/20210511095657 +++ /dev/null @@ -1 +0,0 @@ -4d11cdf876786db5e827ea1a50b70e2d5b3814fd7c0b0c083ab61adad9685364 \ No newline at end of file diff --git a/db/schema_migrations/20210511095658 b/db/schema_migrations/20210511095658 deleted file mode 100644 index d3fa692768d..00000000000 --- a/db/schema_migrations/20210511095658 +++ /dev/null @@ -1 +0,0 @@ -7387c23bbbc376e26c057179ebe2796be183462acb1fc509d451f0fede13ed93 \ No newline at end of file diff --git a/db/schema_migrations/20210511104929 b/db/schema_migrations/20210511104929 deleted file mode 100644 index af4f0ae0c01..00000000000 --- a/db/schema_migrations/20210511104929 +++ /dev/null @@ -1 +0,0 @@ -7c2a036033a3f6a3f80755c8ce4a0deab5933084974af4d87e7b97cc446fcbda \ No newline at end of file diff --git a/db/schema_migrations/20210511104930 b/db/schema_migrations/20210511104930 deleted file mode 100644 index 9c07569e616..00000000000 --- a/db/schema_migrations/20210511104930 +++ /dev/null @@ -1 +0,0 @@ -51a8eeb8919e3f59579885b9e316ba8116566ae9b363b5dd750a65f42503c391 \ No newline at end of file diff --git a/db/schema_migrations/20210511142748 b/db/schema_migrations/20210511142748 deleted file mode 100644 index e0900a0b8ca..00000000000 --- a/db/schema_migrations/20210511142748 +++ /dev/null @@ -1 +0,0 @@ -def18f68ad71a1581452d52d331d2fd99ec9a3eb9b8e2fd111277eda498169fa \ No newline at end of file diff --git a/db/schema_migrations/20210511165250 b/db/schema_migrations/20210511165250 deleted file mode 100644 index d68bd28d356..00000000000 --- a/db/schema_migrations/20210511165250 +++ /dev/null @@ -1 +0,0 @@ -8f746d7eb604ae31a5941840d6a078eae2e4fa59b7185bf8cc0db9c55b463c33 \ No newline at end of file diff --git a/db/schema_migrations/20210512120122 b/db/schema_migrations/20210512120122 deleted file mode 100644 index ad8640c6068..00000000000 --- a/db/schema_migrations/20210512120122 +++ /dev/null @@ -1 +0,0 @@ -1acc251417e3230c9b0a46e294cb9a6e8768f31978b8d4f439101f8de4e9269e \ No newline at end of file diff --git a/db/schema_migrations/20210512183309 b/db/schema_migrations/20210512183309 deleted file mode 100644 index efdceb8aed5..00000000000 --- a/db/schema_migrations/20210512183309 +++ /dev/null @@ -1 +0,0 @@ -490dd9a1fe59fb1454f938763f9b8bce7a0567569ad5f7b8e29b196551d869e1 \ No newline at end of file diff --git a/db/schema_migrations/20210512183310 b/db/schema_migrations/20210512183310 deleted file mode 100644 index 7f14b53caf0..00000000000 --- a/db/schema_migrations/20210512183310 +++ /dev/null @@ -1 +0,0 @@ -d1e389755e4f5ed0075b07c5680eee5ae3557550071d14360ad3030e4c2d3ac1 \ No newline at end of file diff --git a/db/schema_migrations/20210513093418 b/db/schema_migrations/20210513093418 deleted file mode 100644 index 770d0f1ebdc..00000000000 --- a/db/schema_migrations/20210513093418 +++ /dev/null @@ -1 +0,0 @@ -f2c85121d217aa953b6ae52e32624cf4164b1f1408bcbe8ae3facafc15b037ce \ No newline at end of file diff --git a/db/schema_migrations/20210513155447 b/db/schema_migrations/20210513155447 deleted file mode 100644 index c2fd6c22a05..00000000000 --- a/db/schema_migrations/20210513155447 +++ /dev/null @@ -1 +0,0 @@ -1f5ea8527107d4cffac535b9ae3e532a98ebd69a8711abdbe68b12fe005dfbb5 \ No newline at end of file diff --git a/db/schema_migrations/20210513155546 b/db/schema_migrations/20210513155546 deleted file mode 100644 index 97f9dc2b3c0..00000000000 --- a/db/schema_migrations/20210513155546 +++ /dev/null @@ -1 +0,0 @@ -44abbe007dae17982f923b1b15fd0534d3d3a7fd154cd9e4b5409f86030de2f7 \ No newline at end of file diff --git a/db/schema_migrations/20210513155635 b/db/schema_migrations/20210513155635 deleted file mode 100644 index 57da33a0bd2..00000000000 --- a/db/schema_migrations/20210513155635 +++ /dev/null @@ -1 +0,0 @@ -d1fccf214f2e237482fc4d9e2b5d5ea6e9241ad4ace8739e7b799555afafa215 \ No newline at end of file diff --git a/db/schema_migrations/20210513163904 b/db/schema_migrations/20210513163904 deleted file mode 100644 index dc668704311..00000000000 --- a/db/schema_migrations/20210513163904 +++ /dev/null @@ -1 +0,0 @@ -3c4905fbe29227da7a2386f73d9df30e82da48efff24a1193ba3db0ac325cfcf \ No newline at end of file diff --git a/db/schema_migrations/20210514063252 b/db/schema_migrations/20210514063252 deleted file mode 100644 index 848265418d2..00000000000 --- a/db/schema_migrations/20210514063252 +++ /dev/null @@ -1 +0,0 @@ -7e52f9ba8470fd8c2e149fea723c9b06b92ecde2dac4db4512534b3e23952c61 \ No newline at end of file diff --git a/db/schema_migrations/20210517075444 b/db/schema_migrations/20210517075444 deleted file mode 100644 index 4b4aee8710c..00000000000 --- a/db/schema_migrations/20210517075444 +++ /dev/null @@ -1 +0,0 @@ -ec08c18ac37f2ae7298650df58345755eada20aaa5b7ed3dfd54ee5cea88ebdd \ No newline at end of file diff --git a/db/schema_migrations/20210517130723 b/db/schema_migrations/20210517130723 deleted file mode 100644 index 04e94d1b867..00000000000 --- a/db/schema_migrations/20210517130723 +++ /dev/null @@ -1 +0,0 @@ -3bcc5ae97f3185ea33e568f42b90d1bfd31ac7c5126dab4580b64bd9b4603721 \ No newline at end of file diff --git a/db/schema_migrations/20210517144856 b/db/schema_migrations/20210517144856 deleted file mode 100644 index 14d36163797..00000000000 --- a/db/schema_migrations/20210517144856 +++ /dev/null @@ -1 +0,0 @@ -1944c983dd384029cef6e456108a1ccfdb9c991c65343d3b7f26aff51f244816 \ No newline at end of file diff --git a/db/schema_migrations/20210517221612 b/db/schema_migrations/20210517221612 deleted file mode 100644 index 4078e0b44f0..00000000000 --- a/db/schema_migrations/20210517221612 +++ /dev/null @@ -1 +0,0 @@ -69e7297ace1301bbdb63053bd30b75c326122873fbc6c5c15f9f118166111434 \ No newline at end of file diff --git a/db/schema_migrations/20210518001450 b/db/schema_migrations/20210518001450 deleted file mode 100644 index 5f3694d8b93..00000000000 --- a/db/schema_migrations/20210518001450 +++ /dev/null @@ -1 +0,0 @@ -212a2db8b1183eb4ae313eacae7d54f2bec26c5ea3f961981d34e57ca1420ad9 \ No newline at end of file diff --git a/db/schema_migrations/20210518074332 b/db/schema_migrations/20210518074332 deleted file mode 100644 index b5c7d33eec4..00000000000 --- a/db/schema_migrations/20210518074332 +++ /dev/null @@ -1 +0,0 @@ -9eb5e68b0d79863687530ff22cbe6a2bffd2e2d31237e919134b9ce77810b1a0 \ No newline at end of file diff --git a/db/schema_migrations/20210519104931 b/db/schema_migrations/20210519104931 deleted file mode 100644 index 82f84986924..00000000000 --- a/db/schema_migrations/20210519104931 +++ /dev/null @@ -1 +0,0 @@ -c31cb40b6251704c699e7fa3e7392bb9eb73fefcd5b0268e2b8fc58df9e6075e \ No newline at end of file diff --git a/db/schema_migrations/20210519132109 b/db/schema_migrations/20210519132109 deleted file mode 100644 index 9d8537aa6b2..00000000000 --- a/db/schema_migrations/20210519132109 +++ /dev/null @@ -1 +0,0 @@ -ba464ad09f3cec0e9cf94b3041ad946e3a5a8c915ce0b9f4f95ab49cb55d305d \ No newline at end of file diff --git a/db/schema_migrations/20210519132129 b/db/schema_migrations/20210519132129 deleted file mode 100644 index da7a8212092..00000000000 --- a/db/schema_migrations/20210519132129 +++ /dev/null @@ -1 +0,0 @@ -8041e898177bdee3b4d1ad82ec7dd3b79cb7dd740f773cd91dc4306a87a397fd \ No newline at end of file diff --git a/db/schema_migrations/20210519154058 b/db/schema_migrations/20210519154058 deleted file mode 100644 index 9bd277e92db..00000000000 --- a/db/schema_migrations/20210519154058 +++ /dev/null @@ -1 +0,0 @@ -bdd82fc5cb2bbb322125c153c741002725853e23cd0ae0edbfd80563a4a87f2f \ No newline at end of file diff --git a/db/schema_migrations/20210519220019 b/db/schema_migrations/20210519220019 deleted file mode 100644 index c0578586e62..00000000000 --- a/db/schema_migrations/20210519220019 +++ /dev/null @@ -1 +0,0 @@ -6c687ffd41f242dcd0ecf1ff82652aba79130d2d54016729a817dafa0bac6184 \ No newline at end of file diff --git a/db/schema_migrations/20210520012430 b/db/schema_migrations/20210520012430 deleted file mode 100644 index d92bc8d8369..00000000000 --- a/db/schema_migrations/20210520012430 +++ /dev/null @@ -1 +0,0 @@ -86b9f1c0f4288bf83e8b2d70b06b8951b7bcef0aa9324d9546471f6f094b014b \ No newline at end of file diff --git a/db/schema_migrations/20210520102039 b/db/schema_migrations/20210520102039 deleted file mode 100644 index a850a5b07ca..00000000000 --- a/db/schema_migrations/20210520102039 +++ /dev/null @@ -1 +0,0 @@ -88d2c1507503de626dfdb3f2f0eaf0f51fad5fc2279fd147d901c5dcc7ae91eb \ No newline at end of file diff --git a/db/schema_migrations/20210520133032 b/db/schema_migrations/20210520133032 deleted file mode 100644 index 169203e33cd..00000000000 --- a/db/schema_migrations/20210520133032 +++ /dev/null @@ -1 +0,0 @@ -eddbcd18c17f9017a2cdfb6fc0144dcfcb539d3617271722b2918bdbe48c481a \ No newline at end of file diff --git a/db/schema_migrations/20210520133440 b/db/schema_migrations/20210520133440 deleted file mode 100644 index d5644ab8927..00000000000 --- a/db/schema_migrations/20210520133440 +++ /dev/null @@ -1 +0,0 @@ -3ee15db28406522a5fb591395dd3d4a46b10e958339dc60ded3751e23096864d \ No newline at end of file diff --git a/db/schema_migrations/20210521073920 b/db/schema_migrations/20210521073920 deleted file mode 100644 index e0ac7ff7f31..00000000000 --- a/db/schema_migrations/20210521073920 +++ /dev/null @@ -1 +0,0 @@ -ecef2157c20804acbad9d74df27febcf935f7f36920946fac211f3ef8b419f26 \ No newline at end of file diff --git a/db/schema_migrations/20210525075724 b/db/schema_migrations/20210525075724 deleted file mode 100644 index 539138e18a9..00000000000 --- a/db/schema_migrations/20210525075724 +++ /dev/null @@ -1 +0,0 @@ -5dc1119c5efe28225bb7ac8a9ed2c4c5cfaeaff202194ed4419cfd54eaf7483d \ No newline at end of file diff --git a/db/schema_migrations/20210525085158 b/db/schema_migrations/20210525085158 deleted file mode 100644 index c16bb8edeb9..00000000000 --- a/db/schema_migrations/20210525085158 +++ /dev/null @@ -1 +0,0 @@ -a2ce644df46a13d65eb0d01931eeb8e9f43967daadf73eed2f033b6c275ca57d \ No newline at end of file diff --git a/db/schema_migrations/20210525085325 b/db/schema_migrations/20210525085325 deleted file mode 100644 index 38967a72899..00000000000 --- a/db/schema_migrations/20210525085325 +++ /dev/null @@ -1 +0,0 @@ -f085c9a7fc2209cf4d3797cda55c2be76b462eff456e7bf92de4545e0b988053 \ No newline at end of file diff --git a/db/schema_migrations/20210525100539 b/db/schema_migrations/20210525100539 deleted file mode 100644 index 31d93a231ed..00000000000 --- a/db/schema_migrations/20210525100539 +++ /dev/null @@ -1 +0,0 @@ -6568aa11d3652fb7ee23d2e6622a1038d891914f629438608993ff0d8b46b748 \ No newline at end of file diff --git a/db/schema_migrations/20210525100603 b/db/schema_migrations/20210525100603 deleted file mode 100644 index 645d7584d3d..00000000000 --- a/db/schema_migrations/20210525100603 +++ /dev/null @@ -1 +0,0 @@ -1a877c384c1e4e9e28a64c8c521aa72965c54d528044b076efdc75aeeb83d796 \ No newline at end of file diff --git a/db/schema_migrations/20210525184900 b/db/schema_migrations/20210525184900 deleted file mode 100644 index 5e507e7a363..00000000000 --- a/db/schema_migrations/20210525184900 +++ /dev/null @@ -1 +0,0 @@ -ae91ea7481ea21ce29b4c0697f77fd83017c36d913739ed67e5c907a48c56f69 \ No newline at end of file diff --git a/db/schema_migrations/20210526135911 b/db/schema_migrations/20210526135911 deleted file mode 100644 index be8d46e3cb0..00000000000 --- a/db/schema_migrations/20210526135911 +++ /dev/null @@ -1 +0,0 @@ -9f3edf905be3bd3c7fe0149c9b97c68783590b808a96ad08873d983e3d901419 \ No newline at end of file diff --git a/db/schema_migrations/20210526155257 b/db/schema_migrations/20210526155257 deleted file mode 100644 index ab3a611d341..00000000000 --- a/db/schema_migrations/20210526155257 +++ /dev/null @@ -1 +0,0 @@ -ec4cd687062118b30e516ed7c36677dda056f25c4d96c6ee0b503e457b5a18d4 \ No newline at end of file diff --git a/db/schema_migrations/20210526160133 b/db/schema_migrations/20210526160133 deleted file mode 100644 index c61cc233c0e..00000000000 --- a/db/schema_migrations/20210526160133 +++ /dev/null @@ -1 +0,0 @@ -ee76ee2e2515c06b09fca23a77bdfb9532fa5d80fc3d5aba44a80d123b74cfa9 \ No newline at end of file diff --git a/db/schema_migrations/20210526181820 b/db/schema_migrations/20210526181820 deleted file mode 100644 index b21e0c66d2a..00000000000 --- a/db/schema_migrations/20210526181820 +++ /dev/null @@ -1 +0,0 @@ -e72471e63dc108939473232437eda4c718382630c1173ae20023002d382e5ffa \ No newline at end of file diff --git a/db/schema_migrations/20210526181821 b/db/schema_migrations/20210526181821 deleted file mode 100644 index 055ae0886b3..00000000000 --- a/db/schema_migrations/20210526181821 +++ /dev/null @@ -1 +0,0 @@ -3c53d85bec154ec68a23841d37317d10fa6c7c846bc5f54f5b7876081105ac7b \ No newline at end of file diff --git a/db/schema_migrations/20210526190259 b/db/schema_migrations/20210526190259 deleted file mode 100644 index 0c7c7b88504..00000000000 --- a/db/schema_migrations/20210526190259 +++ /dev/null @@ -1 +0,0 @@ -ae2829a06f02ff3e1adc977f5e789b17d1f760e6aaa40be44586cc6a90870c4a \ No newline at end of file diff --git a/db/schema_migrations/20210526190553 b/db/schema_migrations/20210526190553 deleted file mode 100644 index 5998df03b1c..00000000000 --- a/db/schema_migrations/20210526190553 +++ /dev/null @@ -1 +0,0 @@ -824e0930de14587f6ccaeb6b5fbec16676d243550a2dfd3a5999b67dfc16d4c8 \ No newline at end of file diff --git a/db/schema_migrations/20210526222715 b/db/schema_migrations/20210526222715 deleted file mode 100644 index 905c6a1fcb5..00000000000 --- a/db/schema_migrations/20210526222715 +++ /dev/null @@ -1 +0,0 @@ -f80787d85538cedaba34cb204c98df2d0bbbf85f438d4df8f1187d2f4d881588 \ No newline at end of file diff --git a/db/schema_migrations/20210527065005 b/db/schema_migrations/20210527065005 deleted file mode 100644 index 23df046f302..00000000000 --- a/db/schema_migrations/20210527065005 +++ /dev/null @@ -1 +0,0 @@ -983b736defaa128f7466a784d2a06de293fa6b1cee76121e533e7966d19aad73 \ No newline at end of file diff --git a/db/schema_migrations/20210527130524 b/db/schema_migrations/20210527130524 deleted file mode 100644 index 611865047ef..00000000000 --- a/db/schema_migrations/20210527130524 +++ /dev/null @@ -1 +0,0 @@ -c0d6252fc768a431513754f7d51e61c5127f5573fefb278e7e1673dcd9e1b097 \ No newline at end of file diff --git a/db/schema_migrations/20210527131039 b/db/schema_migrations/20210527131039 deleted file mode 100644 index acd89af497d..00000000000 --- a/db/schema_migrations/20210527131039 +++ /dev/null @@ -1 +0,0 @@ -c07ebd06892bacc936514798d970eb58ed08b6570049d2de07f787e93b5b3316 \ No newline at end of file diff --git a/db/schema_migrations/20210527133919 b/db/schema_migrations/20210527133919 deleted file mode 100644 index 559860de55d..00000000000 --- a/db/schema_migrations/20210527133919 +++ /dev/null @@ -1 +0,0 @@ -aaf5936c945451fa98df7c21ab34c9aa7190dcf301f536c259e5b1fe54407f36 \ No newline at end of file diff --git a/db/schema_migrations/20210527134019 b/db/schema_migrations/20210527134019 deleted file mode 100644 index de757dd355e..00000000000 --- a/db/schema_migrations/20210527134019 +++ /dev/null @@ -1 +0,0 @@ -ac4522ee51d4a4cda317b680c16be3d9ef3e1619bba80c26aefe8d5dc70f013c \ No newline at end of file diff --git a/db/schema_migrations/20210527185542 b/db/schema_migrations/20210527185542 deleted file mode 100644 index 175fe5432e3..00000000000 --- a/db/schema_migrations/20210527185542 +++ /dev/null @@ -1 +0,0 @@ -56efe7709f07ffe198b4a2068c7e4b1ba8507a878cbc9ac3b1b30a334cbd83ca \ No newline at end of file diff --git a/db/schema_migrations/20210527194558 b/db/schema_migrations/20210527194558 deleted file mode 100644 index 089b97aa90e..00000000000 --- a/db/schema_migrations/20210527194558 +++ /dev/null @@ -1 +0,0 @@ -8c0661a42edbdb79be283df0e88879707ef34ba3fe21b6756b21cd99ea9f05de \ No newline at end of file diff --git a/db/schema_migrations/20210529164247 b/db/schema_migrations/20210529164247 deleted file mode 100644 index 76637590be7..00000000000 --- a/db/schema_migrations/20210529164247 +++ /dev/null @@ -1 +0,0 @@ -8aa9e00be5f2bc6076f4a42a479aff4318b9e4d3da48798117fec67df7158db4 \ No newline at end of file diff --git a/db/schema_migrations/20210531053916 b/db/schema_migrations/20210531053916 deleted file mode 100644 index d2eb05fab3d..00000000000 --- a/db/schema_migrations/20210531053916 +++ /dev/null @@ -1 +0,0 @@ -862deb2d2845aaa114ba4c56418ae6a041d3aed3ac205cff102414423b60c969 \ No newline at end of file diff --git a/db/schema_migrations/20210531054108 b/db/schema_migrations/20210531054108 deleted file mode 100644 index 4b0372e7ffc..00000000000 --- a/db/schema_migrations/20210531054108 +++ /dev/null @@ -1 +0,0 @@ -9ffb8d6b93f1e994eaa9dd4b16b9250fe007903dca3901d34bf66a81b2f3ad44 \ No newline at end of file diff --git a/db/schema_migrations/20210531070452 b/db/schema_migrations/20210531070452 deleted file mode 100644 index 51a023a544c..00000000000 --- a/db/schema_migrations/20210531070452 +++ /dev/null @@ -1 +0,0 @@ -e569b99998d9c670af17ec747e37726671601ba06fa97da83373649adb3aab31 \ No newline at end of file diff --git a/db/schema_migrations/20210531071107 b/db/schema_migrations/20210531071107 deleted file mode 100644 index f855e0990e1..00000000000 --- a/db/schema_migrations/20210531071107 +++ /dev/null @@ -1 +0,0 @@ -38dcfcd162a3b49a9b16b45b2f9818275807bf419880729b5c552bccb0d4dc9e \ No newline at end of file diff --git a/db/schema_migrations/20210601073400 b/db/schema_migrations/20210601073400 deleted file mode 100644 index eb4eed721fe..00000000000 --- a/db/schema_migrations/20210601073400 +++ /dev/null @@ -1 +0,0 @@ -668f65ea77042e5b8054681e76f583a6061aca921b685f90d155fc4121e7ff78 \ No newline at end of file diff --git a/db/schema_migrations/20210601080039 b/db/schema_migrations/20210601080039 deleted file mode 100644 index 91d517058fe..00000000000 --- a/db/schema_migrations/20210601080039 +++ /dev/null @@ -1 +0,0 @@ -2c5c0756757a181cf8bf7968de5184664004a82c093ae3fc14c5d6931a1ab44f \ No newline at end of file diff --git a/db/schema_migrations/20210601123341 b/db/schema_migrations/20210601123341 deleted file mode 100644 index 7fd9943c89e..00000000000 --- a/db/schema_migrations/20210601123341 +++ /dev/null @@ -1 +0,0 @@ -d4a0098c30cd1acea008fa5f1cfb4c23d5b5b894eab2b72f5004acc5233f2576 \ No newline at end of file diff --git a/db/schema_migrations/20210601125410 b/db/schema_migrations/20210601125410 deleted file mode 100644 index 241a60e966a..00000000000 --- a/db/schema_migrations/20210601125410 +++ /dev/null @@ -1 +0,0 @@ -fc500e4dd555a6baad91ad3c9fb8a2f8541e1613dd64afdbdd28b19447a28caf \ No newline at end of file diff --git a/db/schema_migrations/20210601131742 b/db/schema_migrations/20210601131742 deleted file mode 100644 index 59869b190e5..00000000000 --- a/db/schema_migrations/20210601131742 +++ /dev/null @@ -1 +0,0 @@ -63cd83e097a24b39a399918422950caacb6aed8d05d0d8b7bcf66f9155a0d04e \ No newline at end of file diff --git a/db/schema_migrations/20210601132134 b/db/schema_migrations/20210601132134 deleted file mode 100644 index 3fa9505de2f..00000000000 --- a/db/schema_migrations/20210601132134 +++ /dev/null @@ -1 +0,0 @@ -966299fecd160b594f0837f19cc01b38fc365fa749982f9245c296d912e3eb2f \ No newline at end of file diff --git a/db/schema_migrations/20210601133459 b/db/schema_migrations/20210601133459 deleted file mode 100644 index 2f40fffa40f..00000000000 --- a/db/schema_migrations/20210601133459 +++ /dev/null @@ -1 +0,0 @@ -4dcf6277439e8abe52534540100fa621fedcecb3eaf71ad5685ac0230cd2e5bb \ No newline at end of file diff --git a/db/schema_migrations/20210602122213 b/db/schema_migrations/20210602122213 deleted file mode 100644 index 651f9789b36..00000000000 --- a/db/schema_migrations/20210602122213 +++ /dev/null @@ -1 +0,0 @@ -66e50071130c2bd64be2f52d5c5f348a91883b2e9a9f4241175d1d2ad2a74434 \ No newline at end of file diff --git a/db/schema_migrations/20210602122233 b/db/schema_migrations/20210602122233 deleted file mode 100644 index c52dbdfd858..00000000000 --- a/db/schema_migrations/20210602122233 +++ /dev/null @@ -1 +0,0 @@ -96c70de2567fc3e816c720ed6e4cef2446c0f0ee288d0959cd1298523913077f \ No newline at end of file diff --git a/db/schema_migrations/20210602155056 b/db/schema_migrations/20210602155056 deleted file mode 100644 index 4c6f7f95874..00000000000 --- a/db/schema_migrations/20210602155056 +++ /dev/null @@ -1 +0,0 @@ -42b3090efee66f5a7a5c06d8768d1417892c5d6745f60163a09f58e6e3722761 \ No newline at end of file diff --git a/doc/development/database/setting_multiple_values.md b/doc/development/database/setting_multiple_values.md index fb85386785d..48be7ff9f10 100644 --- a/doc/development/database/setting_multiple_values.md +++ b/doc/development/database/setting_multiple_values.md @@ -32,7 +32,7 @@ update issues where id = obj_id ``` -You can't express this in ActiveRecord, or by dropping down to [Arel](https://api.rubyonrails.org/v6.1.0/classes/Arel.html), +You can't express this in ActiveRecord, or by dropping down to [Arel](https://api.rubyonrails.org/classes/Arel.html), because the `UpdateManager` does not support `update from`. However, we supply an abstraction to help you generate these kinds of updates: `Gitlab::Database::BulkUpdate`. This abstraction constructs queries like the previous example, and uses diff --git a/doc/development/fe_guide/view_component.md b/doc/development/fe_guide/view_component.md index 90bb75514d8..f9d148d8b82 100644 --- a/doc/development/fe_guide/view_component.md +++ b/doc/development/fe_guide/view_component.md @@ -179,9 +179,9 @@ For the full list of options, see its The `Pajamas::CheckboxComponent` follows the [Pajamas Checkbox](https://design.gitlab.com/components/checkbox/) specification. NOTE: -`Pajamas::CheckboxComponent` is used internally by the [GitLab UI form builder](haml.md#use-the-gitlab-ui-form-builder) and requires an instance of [ActionView::Helpers::FormBuilder](https://api.rubyonrails.org/v6.1.0/classes/ActionView/Helpers/FormBuilder.html) to be passed as the `form` argument. +`Pajamas::CheckboxComponent` is used internally by the [GitLab UI form builder](haml.md#use-the-gitlab-ui-form-builder) and requires an instance of [ActionView::Helpers::FormBuilder](https://api.rubyonrails.org/classes/ActionView/Helpers/FormBuilder.html) to be passed as the `form` argument. It is preferred to use the [`gitlab_ui_checkbox_component`](haml.md#gitlab_ui_checkbox_component) method to render this ViewComponent. -To use a checkbox without an instance of [ActionView::Helpers::FormBuilder](https://api.rubyonrails.org/v6.1.0/classes/ActionView/Helpers/FormBuilder.html) use [CheckboxTagComponent](#checkbox-tag). +To use a checkbox without an instance of [ActionView::Helpers::FormBuilder](https://api.rubyonrails.org/classes/ActionView/Helpers/FormBuilder.html) use [CheckboxTagComponent](#checkbox-tag). For the full list of options, see its [source](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/components/pajamas/checkbox_component.rb). diff --git a/doc/development/migration_style_guide.md b/doc/development/migration_style_guide.md index bc08c19ca99..a915e72d804 100644 --- a/doc/development/migration_style_guide.md +++ b/doc/development/migration_style_guide.md @@ -253,7 +253,7 @@ Therefore, either: For example, if you create an empty table and need to build an index for it, it is recommended to use a regular single-transaction migration and the default -rails schema statement: [`add_index`](https://api.rubyonrails.org/v5.2/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_index). +rails schema statement: [`add_index`](https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html#method-i-add_index). This is a blocking operation, but it doesn't cause problems because the table is not yet used, and therefore it does not have any records yet. diff --git a/doc/development/snowplow/implementation.md b/doc/development/snowplow/implementation.md index a80d6fe70ff..40b8b7b3da8 100644 --- a/doc/development/snowplow/implementation.md +++ b/doc/development/snowplow/implementation.md @@ -115,7 +115,7 @@ You can also use it on HAML templates: ``` If you use the GitLab helper method [`nav_link`](https://gitlab.com/gitlab-org/gitlab/-/blob/master/app/helpers/tab_helper.rb#L76), you must wrap `html_options` under the `html_options` keyword argument. If you -use the `ActionView` helper method [`link_to`](https://api.rubyonrails.org/v5.2.3/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to), you don't need to wrap `html_options`. +use the `ActionView` helper method [`link_to`](https://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to), you don't need to wrap `html_options`. ```ruby # Bad diff --git a/doc/development/testing_guide/best_practices.md b/doc/development/testing_guide/best_practices.md index 6f8fbe9779a..e27d4911158 100644 --- a/doc/development/testing_guide/best_practices.md +++ b/doc/development/testing_guide/best_practices.md @@ -833,7 +833,7 @@ To resolve, use `let`, or change the factory to not use stubs. ### Time-sensitive tests -[`ActiveSupport::Testing::TimeHelpers`](https://api.rubyonrails.org/v6.0.3.1/classes/ActiveSupport/Testing/TimeHelpers.html) +[`ActiveSupport::Testing::TimeHelpers`](https://api.rubyonrails.org/classes/ActiveSupport/Testing/TimeHelpers.html) can be used to verify things that are time-sensitive. Any test that exercises or verifies something time-sensitive should make use of these helpers to prevent transient test failures. @@ -854,7 +854,7 @@ end #### RSpec helpers You can use the `:freeze_time` and `:time_travel_to` RSpec metadata tag helpers to help reduce the amount of -boilerplate code needed to wrap entire specs with the [`ActiveSupport::Testing::TimeHelpers`](https://api.rubyonrails.org/v6.0.3.1/classes/ActiveSupport/Testing/TimeHelpers.html) +boilerplate code needed to wrap entire specs with the [`ActiveSupport::Testing::TimeHelpers`](https://api.rubyonrails.org/classes/ActiveSupport/Testing/TimeHelpers.html) methods. ```ruby @@ -874,7 +874,7 @@ end ``` [Under the hood](https://gitlab.com/gitlab-org/gitlab/-/blob/master/spec/support/time_travel.rb), these helpers use the `around(:each)` hook and the block syntax of the -[`ActiveSupport::Testing::TimeHelpers`](https://api.rubyonrails.org/v6.0.3.1/classes/ActiveSupport/Testing/TimeHelpers.html) +[`ActiveSupport::Testing::TimeHelpers`](https://api.rubyonrails.org/classes/ActiveSupport/Testing/TimeHelpers.html) methods: ```ruby diff --git a/doc/user/application_security/policies/scan-result-policies.md b/doc/user/application_security/policies/scan-result-policies.md index 5df910efb15..e228b51d898 100644 --- a/doc/user/application_security/policies/scan-result-policies.md +++ b/doc/user/application_security/policies/scan-result-policies.md @@ -79,7 +79,7 @@ This rule enforces the defined actions based on the information provided. | `scanners` | `array` of `string` | `sast`, `secret_detection`, `dependency_scanning`, `container_scanning`, `dast`, `coverage_fuzzing`, `api_fuzzing` | The security scanners for this rule to consider. | | `vulnerabilities_allowed` | `integer` | Greater than or equal to zero | Number of vulnerabilities allowed before this rule is considered. | | `severity_levels` | `array` of `string` | `info`, `unknown`, `low`, `medium`, `high`, `critical`| The severity levels for this rule to consider. | -| `vulnerability_states` | `array` of `string` | `newly_detected`, `detected`, `confirmed`, `resolved`, `dismissed` | The vulnerability states for this rule to consider when the target branch is set to the default branch. The `newly_detected` state considers all newly detected vulnerabilities regardless of their status or dismissal. The other states consider findings that match the selected state and already exist in the default branch. | +| `vulnerability_states` | `array` of `string` | `newly_detected`, `detected`, `confirmed`, `resolved`, `dismissed` | All vulnerabilities fall into two categories:

**Newly Detected Vulnerabilities** - the `newly_detected` policy option covers vulnerabilities that are both `Detected` or "Dismissed` within the merge request itself where the vulnerabilities do not currently exist on the default branch. This policy option requires a pipeline to complete before the rule is evaluated so that it knows whether vulnerabilities are newly detected or not. Merge requests are blocked until the pipeline, and necessary security scans are complete.

• Detected
• Dismissed

**Pre-Existing Vulnerabilities** - these policy options are evaluated immediately and do not require a pipeline complete as they consider only vulnerabilities previously detected in the default branch.

• `Detected` - the policy looks for vulnerabilities in the detected state.
• `Confirmed` - the policy looks for vulnerabilities in the confirmed state.
• `Dismissed` - the policy looks for vulnerabilities in the dismissed state.
• `Resolved` - the policy looks for vulnerabilities in the resolved state. | ## `require_approval` action type diff --git a/lib/bulk_imports/error.rb b/lib/bulk_imports/error.rb index 5866831deec..38f26028276 100644 --- a/lib/bulk_imports/error.rb +++ b/lib/bulk_imports/error.rb @@ -7,7 +7,8 @@ module BulkImports end def self.scope_validation_failure - self.new("Import aborted as the provided personal access token does not have the required 'api' scope.") + self.new("Import aborted as the provided personal access token does not have the required 'api' scope or " \ + "is no longer valid.") end def self.invalid_url diff --git a/lib/gitlab/ci/config/entry/reports.rb b/lib/gitlab/ci/config/entry/reports.rb index 16844fa88db..6408f412e6f 100644 --- a/lib/gitlab/ci/config/entry/reports.rb +++ b/lib/gitlab/ci/config/entry/reports.rb @@ -54,7 +54,7 @@ module Gitlab end def value - @config.transform_values do |value| + @config.compact.transform_values do |value| if value.is_a?(Hash) value else diff --git a/lib/gitlab/memory/watchdog.rb b/lib/gitlab/memory/watchdog.rb index 3682d6e4462..c94dbed1d46 100644 --- a/lib/gitlab/memory/watchdog.rb +++ b/lib/gitlab/memory/watchdog.rb @@ -65,7 +65,7 @@ module Gitlab while @alive sleep(sleep_time_seconds) - monitor if Feature.enabled?(:gitlab_memory_watchdog, type: :ops) + monitor end event_reporter.stopped(log_labels(memwd_reason: @stop_reason).compact) diff --git a/locale/gitlab.pot b/locale/gitlab.pot index cfc98c7b64f..308c3167a52 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -44049,6 +44049,9 @@ msgstr "" msgid "Token valid until revoked" msgstr "" +msgid "TokenRevocation|This Personal Access Token has been automatically revoked on detection. Consider investigating and rotating before marking this vulnerability as resolved." +msgstr "" + msgid "Tokens|Scopes set the permission levels granted to the token." msgstr "" diff --git a/spec/controllers/import/bulk_imports_controller_spec.rb b/spec/controllers/import/bulk_imports_controller_spec.rb index a757c7915c9..a0d5b576e74 100644 --- a/spec/controllers/import/bulk_imports_controller_spec.rb +++ b/spec/controllers/import/bulk_imports_controller_spec.rb @@ -18,6 +18,13 @@ RSpec.describe Import::BulkImportsController, feature_category: :importers do end describe 'POST configure' do + before do + allow_next_instance_of(BulkImports::Clients::HTTP) do |instance| + allow(instance).to receive(:validate_instance_version!).and_return(true) + allow(instance).to receive(:validate_import_scopes!).and_return(true) + end + end + context 'when no params are passed in' do it 'clears out existing session' do post :configure @@ -30,8 +37,57 @@ RSpec.describe Import::BulkImportsController, feature_category: :importers do end end + context 'when URL is invalid' do + it 'redirects to initial import page' do + token = 'token' + url = 'http://192.168.0.1' + + post :configure, params: { bulk_import_gitlab_access_token: token, bulk_import_gitlab_url: url } + + expect(response).to redirect_to new_group_path(anchor: 'import-group-pane') + expect(flash[:alert]).to include('Specified URL cannot be used') + end + end + + context 'when token scope is invalid' do + before do + allow_next_instance_of(BulkImports::Clients::HTTP) do |instance| + allow(instance).to receive(:validate_instance_version!).and_return(true) + allow(instance).to receive(:validate_import_scopes!).and_raise(BulkImports::Error.new('Error!')) + end + end + + it 'redirects to initial import page' do + token = 'token' + url = 'https://gitlab.example' + + post :configure, params: { bulk_import_gitlab_access_token: token, bulk_import_gitlab_url: url } + + expect(response).to redirect_to new_group_path(anchor: 'import-group-pane') + expect(flash[:alert]).to include('Error!') + end + end + + context 'when instance version is incompatible' do + before do + allow_next_instance_of(BulkImports::Clients::HTTP) do |instance| + allow(instance).to receive(:validate_instance_version!).and_raise(BulkImports::Error.new('Error!')) + end + end + + it 'redirects to initial import page' do + token = 'token' + url = 'https://gitlab.example' + + post :configure, params: { bulk_import_gitlab_access_token: token, bulk_import_gitlab_url: url } + + expect(response).to redirect_to new_group_path(anchor: 'import-group-pane') + expect(flash[:alert]).to include('Error!') + end + end + it 'sets the session variables' do - token = 'token' + token = 'invalid token' url = 'https://gitlab.example' post :configure, params: { bulk_import_gitlab_access_token: token, bulk_import_gitlab_url: url } diff --git a/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/artifacts.yml b/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/artifacts.yml index 29f4a0cd76d..1902131de0a 100644 --- a/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/artifacts.yml +++ b/spec/frontend/editor/schema/ci/yaml_tests/negative_tests/artifacts.yml @@ -1,5 +1,17 @@ -# invalid artifact:reports:cyclonedx +# invalid artifacts:when +artifacts-when-unknown: + artifacts: + when: unknown +artifacts-when-array: + artifacts: + when: [always] + +artifacts-when-boolean: + artifacts: + when: true + +# invalid artifact:reports:cyclonedx cyclonedx no paths: artifacts: reports: @@ -17,15 +29,8 @@ cyclonedx not an array or string: - foo - bar -# invalid artifacts:when -artifacts-when-unknown: +# invalid artifacts:reports:coverage_report +coverage-report-is-string: artifacts: - when: unknown - -artifacts-when-array: - artifacts: - when: [always] - -artifacts-when-boolean: - artifacts: - when: true + reports: + coverage_report: cobertura \ No newline at end of file diff --git a/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/artifacts.yml b/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/artifacts.yml index a5c9153ee13..37de2d00382 100644 --- a/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/artifacts.yml +++ b/spec/frontend/editor/schema/ci/yaml_tests/positive_tests/artifacts.yml @@ -1,5 +1,14 @@ -# valid artifact:reports:cyclonedx +# valid artifacts:when +artifacts-when-on-failure: + artifacts: + when: on_failure +artifacts-no-when: + artifacts: + paths: + - binaries/ + +# valid artifact:reports:cyclonedx cyclonedx string path: artifacts: reports: @@ -24,12 +33,15 @@ cylonedx mixed list of string paths and globs: - ./foo - "bar/*.baz" -# valid artifacts:when -artifacts-when-on-failure: +# valid artifacts:reports:coverage_report +coverage-report-cobertura: artifacts: - when: on_failure + reports: + coverage_report: + coverage_format: cobertura + path: coverage/cobertura-coverage.xml -artifacts-no-when: +coverage-report-null: artifacts: - paths: - - binaries/ + reports: + coverage_report: null \ No newline at end of file diff --git a/spec/frontend/members/components/table/role_dropdown_spec.js b/spec/frontend/members/components/table/role_dropdown_spec.js index 3815064b3f6..a11f67be8f5 100644 --- a/spec/frontend/members/components/table/role_dropdown_spec.js +++ b/spec/frontend/members/components/table/role_dropdown_spec.js @@ -36,6 +36,10 @@ describe('RoleDropdown', () => { wrapper = mount(RoleDropdown, { provide: { namespace: MEMBER_TYPES.user, + group: { + name: 'groupname', + path: '/grouppath/', + }, }, propsData: { member, @@ -125,10 +129,10 @@ describe('RoleDropdown', () => { expect($toast.show).toHaveBeenCalledWith('Role updated successfully.'); }); - it('disables dropdown while waiting for `updateMemberRole` to resolve', async () => { + it('puts dropdown in loading state while waiting for `updateMemberRole` to resolve', async () => { await getDropdownItemByText('Developer').trigger('click'); - expect(findDropdown().props('disabled')).toBe(true); + expect(findDropdown().props('loading')).toBe(true); }); it('enables dropdown after `updateMemberRole` resolves', async () => { diff --git a/spec/helpers/groups/group_members_helper_spec.rb b/spec/helpers/groups/group_members_helper_spec.rb index 4d1280533dd..a9c6822e2c1 100644 --- a/spec/helpers/groups/group_members_helper_spec.rb +++ b/spec/helpers/groups/group_members_helper_spec.rb @@ -55,7 +55,9 @@ RSpec.describe Groups::GroupMembersHelper do expected = { source_id: shared_group.id, can_manage_members: true, - can_manage_access_requests: true + can_manage_access_requests: true, + group_name: shared_group.name, + group_path: shared_group.full_path } expect(subject).to include(expected) diff --git a/spec/helpers/issues_helper_spec.rb b/spec/helpers/issues_helper_spec.rb index 0bee80b05ff..cfd4f18990b 100644 --- a/spec/helpers/issues_helper_spec.rb +++ b/spec/helpers/issues_helper_spec.rb @@ -476,36 +476,6 @@ RSpec.describe IssuesHelper do end end - describe '#status_box_variant' do - context 'when object is expired' do - it 'returns warning badge' do - milestone = build(:milestone, due_date: Date.today.prev_month) - expect(helper.status_box_variant(milestone)).to eq('warning') - end - end - - context 'when object is closed' do - it 'returns danger badge' do - milestone = build(:milestone, :closed) - expect(helper.status_box_variant(milestone)).to eq('danger') - end - end - - context 'when object is upcoming' do - it 'returns neutral badge' do - milestone = build(:milestone, start_date: Date.today.next_month) - expect(helper.status_box_variant(milestone)).to eq('neutral') - end - end - - context 'when object is opened' do - it 'returns success badge' do - milestone = build(:milestone) - expect(helper.status_box_variant(milestone)).to eq('success') - end - end - end - describe '#issue_hidden?' do context 'when issue is hidden' do let_it_be(:banned_user) { build(:user, :banned) } diff --git a/spec/helpers/projects/project_members_helper_spec.rb b/spec/helpers/projects/project_members_helper_spec.rb index f3201ce0e14..2cc87e8aeb9 100644 --- a/spec/helpers/projects/project_members_helper_spec.rb +++ b/spec/helpers/projects/project_members_helper_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Projects::ProjectMembersHelper do include MembersPresentation let_it_be(:current_user) { create(:user) } - let_it_be(:project) { create(:project) } + let_it_be(:project) { create(:project, group: create(:group)) } before do allow(helper).to receive(:current_user).and_return(current_user) @@ -42,7 +42,9 @@ RSpec.describe Projects::ProjectMembersHelper do expected = { source_id: project.id, can_manage_members: true, - can_manage_access_requests: true + can_manage_access_requests: true, + group_name: project.group.name, + group_path: project.group.path }.as_json expect(subject).to include(expected) @@ -138,8 +140,8 @@ RSpec.describe Projects::ProjectMembersHelper do where(:include_relations, :result) do [:inherited, :direct] | lazy { [group_link_7, group_link_4, group_link_9, group_link_5, group_link_3].map(&:id) } - [:inherited] | lazy { [group_link_1, group_link_4, group_link_5, group_link_3].map(&:id) } - [:direct] | lazy { [group_link_7, group_link_8, group_link_9].map(&:id) } + [:inherited] | lazy { [group_link_1, group_link_4, group_link_5, group_link_3].map(&:id) } + [:direct] | lazy { [group_link_7, group_link_8, group_link_9].map(&:id) } end with_them do diff --git a/spec/helpers/timeboxes_helper_spec.rb b/spec/helpers/timeboxes_helper_spec.rb index f9fb40a616b..f1f8683825e 100644 --- a/spec/helpers/timeboxes_helper_spec.rb +++ b/spec/helpers/timeboxes_helper_spec.rb @@ -2,8 +2,16 @@ require 'spec_helper' -RSpec.describe TimeboxesHelper do - describe "#timebox_date_range" do +RSpec.describe TimeboxesHelper, feature_category: :team_planning do + using RSpec::Parameterized::TableSyntax + + let_it_be(:milestone_expired) { build(:milestone, due_date: Date.today.prev_month) } + let_it_be(:milestone_closed) { build(:milestone, :closed) } + let_it_be(:milestone_upcoming) { build(:milestone, start_date: Date.today.next_month) } + let_it_be(:milestone_open) { build(:milestone) } + let_it_be(:milestone_closed_and_expired) { build(:milestone, :closed, due_date: Date.today.prev_month) } + + describe '#timebox_date_range' do let(:yesterday) { Date.yesterday } let(:tomorrow) { yesterday + 2 } let(:format) { '%b %-d, %Y' } @@ -24,11 +32,11 @@ RSpec.describe TimeboxesHelper do end end - describe "#group_milestone_route" do + describe '#group_milestone_route' do let(:group) { build_stubbed(:group) } - let(:subgroup) { build_stubbed(:group, parent: group, name: "Test Subgrp") } + let(:subgroup) { build_stubbed(:group, parent: group, name: 'Test Subgrp') } - context "when in subgroup" do + context 'when in subgroup' do let(:milestone) { build_stubbed(:group_milestone, group: subgroup) } it 'generates correct url despite assigned @group' do @@ -39,22 +47,53 @@ RSpec.describe TimeboxesHelper do end end - describe "#recent_releases_with_counts" do - let_it_be(:milestone) { create(:milestone) } - let_it_be(:project) { milestone.project } + describe '#recent_releases_with_counts' do + let_it_be(:project) { milestone_open.project } let_it_be(:user) { create(:user) } - subject { helper.recent_releases_with_counts(milestone, user) } + subject { helper.recent_releases_with_counts(milestone_open, user) } before do project.add_developer(user) end - it "returns releases with counts" do - _old_releases = create_list(:release, 2, project: project, milestones: [milestone]) - recent_public_releases = create_list(:release, 3, project: project, milestones: [milestone], released_at: '2022-01-01T18:00:00Z') + it 'returns releases with counts' do + _old_releases = create_list(:release, 2, project: project, milestones: [milestone_open]) + recent_public_releases = create_list(:release, 3, project: project, milestones: [milestone_open], released_at: '2022-01-01T18:00:00Z') is_expected.to match([match_array(recent_public_releases), 5, 2]) end end + + describe '#milestone_status_string' do + where(:milestone, :status) do + lazy { milestone_expired } | 'Expired' + lazy { milestone_closed } | 'Closed' + lazy { milestone_closed_and_expired } | 'Closed' + lazy { milestone_upcoming } | 'Upcoming' + lazy { milestone_open } | 'Open' + end + + with_them do + it 'returns status string' do + expect(helper.milestone_status_string(milestone)).to eq(status) + end + end + end + + describe '#milestone_badge_variant' do + where(:milestone, :variant) do + lazy { milestone_expired } | :warning + lazy { milestone_closed } | :danger + lazy { milestone_closed_and_expired } | :danger + lazy { milestone_upcoming } | :neutral + lazy { milestone_open } | :success + end + + with_them do + it 'returns badge variant' do + expect(helper.milestone_badge_variant(milestone)).to eq(variant) + end + end + end end diff --git a/spec/lib/bulk_imports/clients/http_spec.rb b/spec/lib/bulk_imports/clients/http_spec.rb index 583052b3f99..780f61f8c61 100644 --- a/spec/lib/bulk_imports/clients/http_spec.rb +++ b/spec/lib/bulk_imports/clients/http_spec.rb @@ -229,7 +229,9 @@ RSpec.describe BulkImports::Clients::HTTP, feature_category: :importers do stub_request(:get, 'http://gitlab.example/api/v4/metadata?private_token=token') .to_return(status: 401, body: "", headers: { 'Content-Type' => 'application/json' }) - expect { subject.instance_version }.to raise_exception(BulkImports::Error, "Import aborted as the provided personal access token does not have the required 'api' scope.") + expect { subject.instance_version }.to raise_exception(BulkImports::Error, + "Import aborted as the provided personal access token does not have the required 'api' scope or " \ + "is no longer valid.") end end @@ -239,7 +241,9 @@ RSpec.describe BulkImports::Clients::HTTP, feature_category: :importers do stub_request(:get, 'http://gitlab.example/api/v4/metadata?private_token=token') .to_return(status: 403, body: "", headers: { 'Content-Type' => 'application/json' }) - expect { subject.instance_version }.to raise_exception(BulkImports::Error, "Import aborted as the provided personal access token does not have the required 'api' scope.") + expect { subject.instance_version }.to raise_exception(BulkImports::Error, + "Import aborted as the provided personal access token does not have the required 'api' scope or " \ + "is no longer valid.") end end diff --git a/spec/lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2_spec.rb b/spec/lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2_spec.rb index 8db45ac0f57..96adea03d43 100644 --- a/spec/lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_jira_tracker_deployment_type2_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillJiraTrackerDeploymentType2, :migration, schema: 20210301200959 do +RSpec.describe Gitlab::BackgroundMigration::BackfillJiraTrackerDeploymentType2, :migration, schema: 20210602155110 do let!(:jira_integration_temp) { described_class::JiraServiceTemp } let!(:jira_tracker_data_temp) { described_class::JiraTrackerDataTemp } let!(:atlassian_host) { 'https://api.atlassian.net' } diff --git a/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_children_spec.rb b/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_children_spec.rb index 35928deff82..15956d2ea80 100644 --- a/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_children_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_children_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsChildren, :migration, schema: 20210506065000 do +RSpec.describe Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsChildren, :migration, schema: 20210602155110 do let(:namespaces_table) { table(:namespaces) } let!(:user_namespace) { namespaces_table.create!(id: 1, name: 'user', path: 'user', type: nil) } diff --git a/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots_spec.rb b/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots_spec.rb index 96e43275972..019c6d54068 100644 --- a/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_namespace_traversal_ids_roots_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsRoots, :migration, schema: 20210506065000 do +RSpec.describe Gitlab::BackgroundMigration::BackfillNamespaceTraversalIdsRoots, :migration, schema: 20210602155110 do let(:namespaces_table) { table(:namespaces) } let!(:user_namespace) { namespaces_table.create!(id: 1, name: 'user', path: 'user', type: nil) } diff --git a/spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb b/spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb index 1c2e0e991d9..8d5aa6236a7 100644 --- a/spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_snippet_repositories_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillSnippetRepositories, :migration, schema: 2021_03_13_045845 do +RSpec.describe Gitlab::BackgroundMigration::BackfillSnippetRepositories, :migration, schema: 20210602155110 do let(:gitlab_shell) { Gitlab::Shell.new } let(:users) { table(:users) } let(:snippets) { table(:snippets) } diff --git a/spec/lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects_spec.rb b/spec/lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects_spec.rb index dd202acc372..0d9d9eb929c 100644 --- a/spec/lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects_spec.rb +++ b/spec/lib/gitlab/background_migration/cleanup_orphaned_lfs_objects_projects_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::CleanupOrphanedLfsObjectsProjects, schema: 20210514063252 do +RSpec.describe Gitlab::BackgroundMigration::CleanupOrphanedLfsObjectsProjects, schema: 20210602155110 do let(:lfs_objects_projects) { table(:lfs_objects_projects) } let(:lfs_objects) { table(:lfs_objects) } let(:projects) { table(:projects) } diff --git a/spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb b/spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb index ba04f2d20a7..66e16b16270 100644 --- a/spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb +++ b/spec/lib/gitlab/background_migration/drop_invalid_vulnerabilities_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::DropInvalidVulnerabilities, schema: 20210301200959 do +RSpec.describe Gitlab::BackgroundMigration::DropInvalidVulnerabilities, schema: 20210602155110 do let!(:background_migration_jobs) { table(:background_migration_jobs) } let!(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') } let!(:users) { table(:users) } diff --git a/spec/lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics_spec.rb b/spec/lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics_spec.rb index 5495d786a48..4d7c836cff4 100644 --- a/spec/lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_project_taggings_context_from_tags_to_topics_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe Gitlab::BackgroundMigration::MigrateProjectTaggingsContextFromTagsToTopics, - :suppress_gitlab_schemas_validate_connection, schema: 20210511095658 do + :suppress_gitlab_schemas_validate_connection, schema: 20210602155110 do it 'correctly migrates project taggings context from tags to topics' do taggings = table(:taggings) diff --git a/spec/lib/gitlab/background_migration/migrate_u2f_webauthn_spec.rb b/spec/lib/gitlab/background_migration/migrate_u2f_webauthn_spec.rb index fc957a7c425..fe45eaac3b7 100644 --- a/spec/lib/gitlab/background_migration/migrate_u2f_webauthn_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_u2f_webauthn_spec.rb @@ -4,7 +4,7 @@ require 'spec_helper' require 'webauthn/u2f_migrator' -RSpec.describe Gitlab::BackgroundMigration::MigrateU2fWebauthn, :migration, schema: 20210301200959 do +RSpec.describe Gitlab::BackgroundMigration::MigrateU2fWebauthn, :migration, schema: 20210602155110 do let(:users) { table(:users) } let(:user) { users.create!(email: 'email@email.com', name: 'foo', username: 'foo', projects_limit: 0) } diff --git a/spec/lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature_spec.rb b/spec/lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature_spec.rb index 79b5567f5b3..cafddb6aeaf 100644 --- a/spec/lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature_spec.rb +++ b/spec/lib/gitlab/background_migration/move_container_registry_enabled_to_project_feature_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::MoveContainerRegistryEnabledToProjectFeature, :migration, schema: 20210301200959 do +RSpec.describe Gitlab::BackgroundMigration::MoveContainerRegistryEnabledToProjectFeature, :migration, schema: 20210602155110 do let(:enabled) { 20 } let(:disabled) { 0 } diff --git a/spec/lib/gitlab/background_migration/update_timelogs_project_id_spec.rb b/spec/lib/gitlab/background_migration/update_timelogs_project_id_spec.rb index fc4d776b8be..7261758e010 100644 --- a/spec/lib/gitlab/background_migration/update_timelogs_project_id_spec.rb +++ b/spec/lib/gitlab/background_migration/update_timelogs_project_id_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::UpdateTimelogsProjectId, schema: 20210427212034 do +RSpec.describe Gitlab::BackgroundMigration::UpdateTimelogsProjectId, schema: 20210602155110 do let!(:namespace) { table(:namespaces).create!(name: 'namespace', path: 'namespace') } let!(:project1) { table(:projects).create!(namespace_id: namespace.id) } let!(:project2) { table(:projects).create!(namespace_id: namespace.id) } diff --git a/spec/lib/gitlab/background_migration/update_users_where_two_factor_auth_required_from_group_spec.rb b/spec/lib/gitlab/background_migration/update_users_where_two_factor_auth_required_from_group_spec.rb index e14328b6150..4599491b580 100644 --- a/spec/lib/gitlab/background_migration/update_users_where_two_factor_auth_required_from_group_spec.rb +++ b/spec/lib/gitlab/background_migration/update_users_where_two_factor_auth_required_from_group_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::UpdateUsersWhereTwoFactorAuthRequiredFromGroup, :migration, schema: 20210519154058 do +RSpec.describe Gitlab::BackgroundMigration::UpdateUsersWhereTwoFactorAuthRequiredFromGroup, :migration, schema: 20210602155110 do include MigrationHelpers::NamespacesHelpers let(:group_with_2fa_parent) { create_namespace('parent', Gitlab::VisibilityLevel::PRIVATE, require_two_factor_authentication: true) } diff --git a/spec/lib/gitlab/ci/config/entry/reports/coverage_report_spec.rb b/spec/lib/gitlab/ci/config/entry/reports/coverage_report_spec.rb index 0fd9a83a4fa..ccd6f6ab427 100644 --- a/spec/lib/gitlab/ci/config/entry/reports/coverage_report_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/reports/coverage_report_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::Ci::Config::Entry::Reports::CoverageReport do +RSpec.describe Gitlab::Ci::Config::Entry::Reports::CoverageReport, feature_category: :pipeline_authoring do let(:entry) { described_class.new(config) } describe 'validations' do @@ -14,6 +14,16 @@ RSpec.describe Gitlab::Ci::Config::Entry::Reports::CoverageReport do it { expect(entry.value).to eq(config) } end + context 'when it is not a hash' do + where(:config) { ['string', true, []] } + + with_them do + it { expect(entry).not_to be_valid } + + it { expect(entry.errors).to include /should be a hash/ } + end + end + context 'with unsupported coverage format' do let(:config) { { coverage_format: 'jacoco', path: 'jacoco.xml' } } diff --git a/spec/lib/gitlab/ci/config/entry/reports_spec.rb b/spec/lib/gitlab/ci/config/entry/reports_spec.rb index 45aa859a356..715cb18fb92 100644 --- a/spec/lib/gitlab/ci/config/entry/reports_spec.rb +++ b/spec/lib/gitlab/ci/config/entry/reports_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::Ci::Config::Entry::Reports do +RSpec.describe Gitlab::Ci::Config::Entry::Reports, feature_category: :pipeline_authoring do let(:entry) { described_class.new(config) } describe 'validates ALLOWED_KEYS' do @@ -90,6 +90,18 @@ RSpec.describe Gitlab::Ci::Config::Entry::Reports do end end end + + context 'when coverage_report is nil' do + let(:config) { { coverage_report: nil } } + + it 'is valid' do + expect(entry).to be_valid + end + + it 'returns artifacts configuration as an empty hash' do + expect(entry.value).to eq({}) + end + end end context 'when entry value is not correct' do diff --git a/spec/lib/gitlab/memory/watchdog_spec.rb b/spec/lib/gitlab/memory/watchdog_spec.rb index 8a4e6589301..0b2f24476d9 100644 --- a/spec/lib/gitlab/memory/watchdog_spec.rb +++ b/spec/lib/gitlab/memory/watchdog_spec.rb @@ -105,16 +105,6 @@ RSpec.describe Gitlab::Memory::Watchdog, :aggregate_failures, feature_category: watchdog.call end - context 'when gitlab_memory_watchdog ops toggle is off' do - before do - stub_feature_flags(gitlab_memory_watchdog: false) - end - - it 'does not trigger any monitor' do - expect(configuration).not_to receive(:monitors) - end - end - context 'when process does not exceed threshold' do it 'does not report violations event' do expect(reporter).not_to receive(:threshold_violated) diff --git a/spec/mailers/emails/profile_spec.rb b/spec/mailers/emails/profile_spec.rb index 9621612217b..1fd2a92866d 100644 --- a/spec/mailers/emails/profile_spec.rb +++ b/spec/mailers/emails/profile_spec.rb @@ -281,7 +281,7 @@ RSpec.describe Emails::Profile do end context 'when source is provided' do - subject { Notify.access_token_revoked_email(user, token.name, 'secret_detection') } + subject { Notify.access_token_revoked_email(user, token.name, :secret_detection) } it_behaves_like 'an email sent from GitLab' it_behaves_like 'it should not have Gmail Actions links' diff --git a/spec/migrations/20210406144743_backfill_total_tuple_count_for_batched_migrations_spec.rb b/spec/migrations/20210406144743_backfill_total_tuple_count_for_batched_migrations_spec.rb deleted file mode 100644 index 18aa8e92560..00000000000 --- a/spec/migrations/20210406144743_backfill_total_tuple_count_for_batched_migrations_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe BackfillTotalTupleCountForBatchedMigrations, :migration, schema: 20210406140057, - feature_category: :database do - let!(:table_name) { 'projects' } - - let!(:migrations) { table(:batched_background_migrations) } - - let!(:migration) do - migrations.create!( - created_at: Time.now, - updated_at: Time.now, - min_value: 1, - max_value: 10_000, - batch_size: 1_000, - sub_batch_size: 100, - interval: 120, - status: 0, - job_class_name: 'Foo', - table_name: table_name, - column_name: :id, - total_tuple_count: nil - ) - end - - describe '#up' do - before do - expect(Gitlab::Database::PgClass).to receive(:for_table).with(table_name).and_return(estimate) - end - - let(:estimate) { double('estimate', cardinality_estimate: 42) } - - it 'updates total_tuple_count attribute' do - migrate! - - migrations.all.each do |migration| - expect(migration.total_tuple_count).to eq(estimate.cardinality_estimate) - end - end - end -end diff --git a/spec/migrations/20210423160427_schedule_drop_invalid_vulnerabilities_spec.rb b/spec/migrations/20210423160427_schedule_drop_invalid_vulnerabilities_spec.rb deleted file mode 100644 index 258bf7a3e69..00000000000 --- a/spec/migrations/20210423160427_schedule_drop_invalid_vulnerabilities_spec.rb +++ /dev/null @@ -1,114 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe ScheduleDropInvalidVulnerabilities, :migration, feature_category: :value_stream_management do - let!(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') } - let!(:users) { table(:users) } - let!(:user) { create_user! } - let!(:project) { table(:projects).create!(id: 123, namespace_id: namespace.id) } - - let!(:scanners) { table(:vulnerability_scanners) } - let!(:scanner) { scanners.create!(project_id: project.id, external_id: 'test 1', name: 'test scanner 1') } - let!(:different_scanner) { scanners.create!(project_id: project.id, external_id: 'test 2', name: 'test scanner 2') } - - let!(:vulnerabilities) { table(:vulnerabilities) } - let!(:vulnerability_with_finding) do - create_vulnerability!( - project_id: project.id, - author_id: user.id - ) - end - - let!(:vulnerability_without_finding) do - create_vulnerability!( - project_id: project.id, - author_id: user.id - ) - end - - let!(:vulnerability_identifiers) { table(:vulnerability_identifiers) } - let!(:primary_identifier) do - vulnerability_identifiers.create!( - project_id: project.id, - external_type: 'uuid-v5', - external_id: 'uuid-v5', - fingerprint: '7e394d1b1eb461a7406d7b1e08f057a1cf11287a', - name: 'Identifier for UUIDv5') - end - - let!(:vulnerabilities_findings) { table(:vulnerability_occurrences) } - let!(:finding) do - create_finding!( - vulnerability_id: vulnerability_with_finding.id, - project_id: project.id, - scanner_id: scanner.id, - primary_identifier_id: primary_identifier.id - ) - end - - before do - stub_const("#{described_class}::BATCH_SIZE", 1) - end - - around do |example| - freeze_time { Sidekiq::Testing.fake! { example.run } } - end - - it 'schedules background migrations' do - migrate! - - expect(BackgroundMigrationWorker.jobs.size).to eq(2) - expect(described_class::MIGRATION).to be_scheduled_migration(vulnerability_with_finding.id, vulnerability_with_finding.id) - expect(described_class::MIGRATION).to be_scheduled_migration(vulnerability_without_finding.id, vulnerability_without_finding.id) - end - - private - - def create_vulnerability!(project_id:, author_id:, title: 'test', severity: 7, confidence: 7, report_type: 0) - vulnerabilities.create!( - project_id: project_id, - author_id: author_id, - title: title, - severity: severity, - confidence: confidence, - report_type: report_type - ) - end - - # rubocop:disable Metrics/ParameterLists - def create_finding!( - vulnerability_id:, project_id:, scanner_id:, primary_identifier_id:, - name: "test", severity: 7, confidence: 7, report_type: 0, - project_fingerprint: '123qweasdzxc', location_fingerprint: 'test', - metadata_version: 'test', raw_metadata: 'test', uuid: SecureRandom.uuid) - vulnerabilities_findings.create!( - vulnerability_id: vulnerability_id, - project_id: project_id, - name: name, - severity: severity, - confidence: confidence, - report_type: report_type, - project_fingerprint: project_fingerprint, - scanner_id: scanner_id, - primary_identifier_id: primary_identifier_id, - location_fingerprint: location_fingerprint, - metadata_version: metadata_version, - raw_metadata: raw_metadata, - uuid: uuid - ) - end - # rubocop:enable Metrics/ParameterLists - - def create_user!(name: "Example User", email: "user@example.com", user_type: nil) - users.create!( - name: name, - email: email, - username: name, - projects_limit: 0, - user_type: user_type, - confirmed_at: Time.current - ) - end -end diff --git a/spec/migrations/20210430134202_copy_adoption_snapshot_namespace_spec.rb b/spec/migrations/20210430134202_copy_adoption_snapshot_namespace_spec.rb deleted file mode 100644 index 688fc5eb23a..00000000000 --- a/spec/migrations/20210430134202_copy_adoption_snapshot_namespace_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true -# -require 'spec_helper' - -require_migration! - -RSpec.describe CopyAdoptionSnapshotNamespace, :migration, schema: 20210430124630, feature_category: :devops_reports do - let(:namespaces_table) { table(:namespaces) } - let(:segments_table) { table(:analytics_devops_adoption_segments) } - let(:snapshots_table) { table(:analytics_devops_adoption_snapshots) } - - it 'updates all snapshots without namespace set' do - namespaces_table.create!(id: 123, name: 'group1', path: 'group1') - namespaces_table.create!(id: 124, name: 'group2', path: 'group2') - - segments_table.create!(id: 1, namespace_id: 123) - segments_table.create!(id: 2, namespace_id: 124) - - create_snapshot(id: 1, segment_id: 1) - create_snapshot(id: 2, segment_id: 2) - create_snapshot(id: 3, segment_id: 2, namespace_id: 123) - - migrate! - - expect(snapshots_table.find(1).namespace_id).to eq 123 - expect(snapshots_table.find(2).namespace_id).to eq 124 - expect(snapshots_table.find(3).namespace_id).to eq 123 - end - - def create_snapshot(**additional_params) - defaults = { - recorded_at: Time.zone.now, - issue_opened: true, - merge_request_opened: true, - merge_request_approved: true, - runner_configured: true, - pipeline_succeeded: true, - deploy_succeeded: true, - end_time: Time.zone.now.end_of_month - } - - snapshots_table.create!(defaults.merge(additional_params)) - end -end diff --git a/spec/migrations/20210430135954_copy_adoption_segments_namespace_spec.rb b/spec/migrations/20210430135954_copy_adoption_segments_namespace_spec.rb deleted file mode 100644 index 0fb3029ec6a..00000000000 --- a/spec/migrations/20210430135954_copy_adoption_segments_namespace_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -require_migration! - -RSpec.describe CopyAdoptionSegmentsNamespace, :migration, feature_category: :devops_reports do - let(:namespaces_table) { table(:namespaces) } - let(:segments_table) { table(:analytics_devops_adoption_segments) } - - before do - namespaces_table.create!(id: 123, name: 'group1', path: 'group1') - namespaces_table.create!(id: 124, name: 'group2', path: 'group2') - - segments_table.create!(id: 1, namespace_id: 123, display_namespace_id: nil) - segments_table.create!(id: 2, namespace_id: 124, display_namespace_id: 123) - end - - it 'updates all segments without display namespace' do - migrate! - - expect(segments_table.find(1).display_namespace_id).to eq 123 - expect(segments_table.find(2).display_namespace_id).to eq 123 - end -end diff --git a/spec/migrations/20210503105845_add_project_value_stream_id_to_project_stages_spec.rb b/spec/migrations/20210503105845_add_project_value_stream_id_to_project_stages_spec.rb deleted file mode 100644 index 07a90c2d276..00000000000 --- a/spec/migrations/20210503105845_add_project_value_stream_id_to_project_stages_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -require_migration! - -RSpec.describe AddProjectValueStreamIdToProjectStages, schema: 20210503105022, - feature_category: :value_stream_management do - let(:stages) { table(:analytics_cycle_analytics_project_stages) } - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - - let(:namespace) { table(:namespaces).create!(name: 'ns1', path: 'nsq1') } - - before do - project = projects.create!(name: 'p1', namespace_id: namespace.id) - - stages.create!( - project_id: project.id, - created_at: Time.now, - updated_at: Time.now, - start_event_identifier: 1, - end_event_identifier: 2, - name: 'stage 1' - ) - - stages.create!( - project_id: project.id, - created_at: Time.now, - updated_at: Time.now, - start_event_identifier: 3, - end_event_identifier: 4, - name: 'stage 2' - ) - end - - it 'deletes the existing rows' do - migrate! - - expect(stages.count).to eq(0) - end -end diff --git a/spec/migrations/20210511142748_schedule_drop_invalid_vulnerabilities2_spec.rb b/spec/migrations/20210511142748_schedule_drop_invalid_vulnerabilities2_spec.rb deleted file mode 100644 index b514c92c52d..00000000000 --- a/spec/migrations/20210511142748_schedule_drop_invalid_vulnerabilities2_spec.rb +++ /dev/null @@ -1,120 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe ScheduleDropInvalidVulnerabilities2, :migration, feature_category: :value_stream_management do - let!(:background_migration_jobs) { table(:background_migration_jobs) } - - let!(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') } - let!(:users) { table(:users) } - let!(:user) { create_user! } - let!(:project) { table(:projects).create!(id: 123, namespace_id: namespace.id) } - - let!(:scanners) { table(:vulnerability_scanners) } - let!(:scanner) { scanners.create!(project_id: project.id, external_id: 'test 1', name: 'test scanner 1') } - let!(:different_scanner) { scanners.create!(project_id: project.id, external_id: 'test 2', name: 'test scanner 2') } - - let!(:vulnerabilities) { table(:vulnerabilities) } - let!(:vulnerability_with_finding) do - create_vulnerability!( - project_id: project.id, - author_id: user.id - ) - end - - let!(:vulnerability_without_finding) do - create_vulnerability!( - project_id: project.id, - author_id: user.id - ) - end - - let!(:vulnerability_identifiers) { table(:vulnerability_identifiers) } - let!(:primary_identifier) do - vulnerability_identifiers.create!( - project_id: project.id, - external_type: 'uuid-v5', - external_id: 'uuid-v5', - fingerprint: '7e394d1b1eb461a7406d7b1e08f057a1cf11287a', - name: 'Identifier for UUIDv5') - end - - let!(:vulnerabilities_findings) { table(:vulnerability_occurrences) } - let!(:finding) do - create_finding!( - vulnerability_id: vulnerability_with_finding.id, - project_id: project.id, - scanner_id: scanner.id, - primary_identifier_id: primary_identifier.id - ) - end - - before do - stub_const("#{described_class}::BATCH_SIZE", 1) - end - - around do |example| - freeze_time { Sidekiq::Testing.fake! { example.run } } - end - - it 'schedules background migrations' do - migrate! - - expect(background_migration_jobs.count).to eq(2) - expect(background_migration_jobs.first.arguments).to eq([vulnerability_with_finding.id, vulnerability_with_finding.id]) - expect(background_migration_jobs.second.arguments).to eq([vulnerability_without_finding.id, vulnerability_without_finding.id]) - - expect(BackgroundMigrationWorker.jobs.size).to eq(2) - expect(described_class::MIGRATION).to be_scheduled_delayed_migration(2.minutes, vulnerability_with_finding.id, vulnerability_with_finding.id) - expect(described_class::MIGRATION).to be_scheduled_delayed_migration(4.minutes, vulnerability_without_finding.id, vulnerability_without_finding.id) - end - - private - - def create_vulnerability!(project_id:, author_id:, title: 'test', severity: 7, confidence: 7, report_type: 0) - vulnerabilities.create!( - project_id: project_id, - author_id: author_id, - title: title, - severity: severity, - confidence: confidence, - report_type: report_type - ) - end - - # rubocop:disable Metrics/ParameterLists - def create_finding!( - vulnerability_id:, project_id:, scanner_id:, primary_identifier_id:, - name: "test", severity: 7, confidence: 7, report_type: 0, - project_fingerprint: '123qweasdzxc', location_fingerprint: 'test', - metadata_version: 'test', raw_metadata: 'test', uuid: SecureRandom.uuid) - vulnerabilities_findings.create!( - vulnerability_id: vulnerability_id, - project_id: project_id, - name: name, - severity: severity, - confidence: confidence, - report_type: report_type, - project_fingerprint: project_fingerprint, - scanner_id: scanner_id, - primary_identifier_id: primary_identifier_id, - location_fingerprint: location_fingerprint, - metadata_version: metadata_version, - raw_metadata: raw_metadata, - uuid: uuid - ) - end - # rubocop:enable Metrics/ParameterLists - - def create_user!(name: "Example User", email: "user@example.com", user_type: nil) - users.create!( - name: name, - email: email, - username: name, - projects_limit: 0, - user_type: user_type, - confirmed_at: Time.current - ) - end -end diff --git a/spec/migrations/20210514063252_schedule_cleanup_orphaned_lfs_objects_projects_spec.rb b/spec/migrations/20210514063252_schedule_cleanup_orphaned_lfs_objects_projects_spec.rb deleted file mode 100644 index 1992f9db7fb..00000000000 --- a/spec/migrations/20210514063252_schedule_cleanup_orphaned_lfs_objects_projects_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe ScheduleCleanupOrphanedLfsObjectsProjects, schema: 20210511165250, feature_category: :source_code_management do - let(:lfs_objects_projects) { table(:lfs_objects_projects) } - let(:projects) { table(:projects) } - let(:namespaces) { table(:namespaces) } - let(:lfs_objects) { table(:lfs_objects) } - - let(:namespace) { namespaces.create!(name: 'namespace', path: 'namespace') } - let(:project) { projects.create!(namespace_id: namespace.id) } - let(:another_project) { projects.create!(namespace_id: namespace.id) } - let(:lfs_object) { lfs_objects.create!(oid: 'abcdef', size: 1) } - let(:another_lfs_object) { lfs_objects.create!(oid: '1abcde', size: 2) } - - describe '#up' do - it 'schedules CleanupOrphanedLfsObjectsProjects background jobs' do - stub_const("#{described_class}::BATCH_SIZE", 2) - - lfs_objects_project1 = lfs_objects_projects.create!(project_id: project.id, lfs_object_id: lfs_object.id) - lfs_objects_project2 = lfs_objects_projects.create!(project_id: another_project.id, lfs_object_id: lfs_object.id) - lfs_objects_project3 = lfs_objects_projects.create!(project_id: project.id, lfs_object_id: another_lfs_object.id) - lfs_objects_project4 = lfs_objects_projects.create!(project_id: another_project.id, lfs_object_id: another_lfs_object.id) - - freeze_time do - migrate! - - expect(described_class::MIGRATION).to be_scheduled_delayed_migration(2.minutes, lfs_objects_project1.id, lfs_objects_project2.id) - expect(described_class::MIGRATION).to be_scheduled_delayed_migration(4.minutes, lfs_objects_project3.id, lfs_objects_project4.id) - - expect(BackgroundMigrationWorker.jobs.size).to eq(2) - end - end - end -end diff --git a/spec/migrations/20210601073400_fix_total_stage_in_vsa_spec.rb b/spec/migrations/20210601073400_fix_total_stage_in_vsa_spec.rb deleted file mode 100644 index 24a71e48035..00000000000 --- a/spec/migrations/20210601073400_fix_total_stage_in_vsa_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe FixTotalStageInVsa, :migration, schema: 20210518001450, feature_category: :devops_reports do - let(:namespaces) { table(:namespaces) } - let(:group_value_streams) { table(:analytics_cycle_analytics_group_value_streams) } - let(:group_stages) { table(:analytics_cycle_analytics_group_stages) } - - let!(:group) { namespaces.create!(name: 'ns1', path: 'ns1', type: 'Group') } - let!(:group_vs_1) { group_value_streams.create!(name: 'default', group_id: group.id) } - let!(:group_vs_2) { group_value_streams.create!(name: 'other', group_id: group.id) } - let!(:group_vs_3) { group_value_streams.create!(name: 'another', group_id: group.id) } - let!(:group_stage_total) { group_stages.create!(name: 'Total', custom: false, group_id: group.id, group_value_stream_id: group_vs_1.id, start_event_identifier: 1, end_event_identifier: 2) } - let!(:group_stage_different_name) { group_stages.create!(name: 'Issue', custom: false, group_id: group.id, group_value_stream_id: group_vs_2.id, start_event_identifier: 1, end_event_identifier: 2) } - let!(:group_stage_total_custom) { group_stages.create!(name: 'Total', custom: true, group_id: group.id, group_value_stream_id: group_vs_3.id, start_event_identifier: 1, end_event_identifier: 2) } - - it 'deduplicates issue_metrics table' do - migrate! - - group_stage_total.reload - group_stage_different_name.reload - group_stage_total_custom.reload - - expect(group_stage_total.custom).to eq(true) - expect(group_stage_different_name.custom).to eq(false) - expect(group_stage_total_custom.custom).to eq(true) - end -end diff --git a/spec/migrations/20210601080039_group_protected_environments_add_index_and_constraint_spec.rb b/spec/migrations/20210601080039_group_protected_environments_add_index_and_constraint_spec.rb deleted file mode 100644 index 592497805de..00000000000 --- a/spec/migrations/20210601080039_group_protected_environments_add_index_and_constraint_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe GroupProtectedEnvironmentsAddIndexAndConstraint, feature_category: :continuous_delivery do - let(:migration) { described_class.new } - let(:protected_environments) { table(:protected_environments) } - let(:group) { table(:namespaces).create!(name: 'group', path: 'group') } - let(:project) { table(:projects).create!(name: 'project', path: 'project', namespace_id: group.id) } - - describe '#down' do - it 'deletes only group-level configurations' do - migration.up - - project_protections = [ - protected_environments.create!(project_id: project.id, name: 'production'), - protected_environments.create!(project_id: project.id, name: 'staging') - ] - protected_environments.create!(group_id: group.id, name: 'production') - protected_environments.create!(group_id: group.id, name: 'staging') - - migration.down - - expect(protected_environments.pluck(:id)) - .to match_array project_protections.map(&:id) - end - end -end diff --git a/spec/migrations/add_new_trail_plans_spec.rb b/spec/migrations/add_new_trail_plans_spec.rb deleted file mode 100644 index 6f8de8435c6..00000000000 --- a/spec/migrations/add_new_trail_plans_spec.rb +++ /dev/null @@ -1,95 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -require_migration! - -RSpec.describe AddNewTrailPlans, :migration, feature_category: :purchase do - describe '#up' do - before do - allow(Gitlab).to receive(:com?).and_return true - end - - it 'creates 2 entries within the plans table' do - expect { migrate! }.to change { AddNewTrailPlans::Plan.count }.by 2 - expect(AddNewTrailPlans::Plan.last(2).pluck(:name)).to match_array(%w(ultimate_trial premium_trial)) - end - - it 'creates 2 entries for plan limits' do - expect { migrate! }.to change { AddNewTrailPlans::PlanLimits.count }.by 2 - end - - context 'when the plan limits for gold and silver exists' do - before do - table(:plans).create!(id: 1, name: 'gold', title: 'Gold') - table(:plan_limits).create!(id: 1, plan_id: 1, storage_size_limit: 2000) - table(:plans).create!(id: 2, name: 'silver', title: 'Silver') - table(:plan_limits).create!(id: 2, plan_id: 2, storage_size_limit: 1000) - end - - it 'duplicates the gold and silvers plan limits entries' do - migrate! - - ultimate_plan_limits = AddNewTrailPlans::Plan.find_by(name: 'ultimate_trial').limits - expect(ultimate_plan_limits.storage_size_limit).to be 2000 - - premium_plan_limits = AddNewTrailPlans::Plan.find_by(name: 'premium_trial').limits - expect(premium_plan_limits.storage_size_limit).to be 1000 - end - end - - context 'when the instance is not SaaS' do - before do - allow(Gitlab).to receive(:com?).and_return false - end - - it 'does not create plans and plan limits and returns' do - expect { migrate! }.not_to change { AddNewTrailPlans::Plan.count } - expect { migrate! }.not_to change { AddNewTrailPlans::Plan.count } - end - end - end - - describe '#down' do - before do - table(:plans).create!(id: 3, name: 'other') - table(:plan_limits).create!(plan_id: 3) - end - - context 'when the instance is SaaS' do - before do - allow(Gitlab).to receive(:com?).and_return true - end - - it 'removes the newly added ultimate and premium trial entries' do - migrate! - - expect { described_class.new.down }.to change { AddNewTrailPlans::Plan.count }.by(-2) - expect(AddNewTrailPlans::Plan.find_by(name: 'premium_trial')).to be_nil - expect(AddNewTrailPlans::Plan.find_by(name: 'ultimate_trial')).to be_nil - - other_plan = AddNewTrailPlans::Plan.find_by(name: 'other') - expect(other_plan).to be_persisted - expect(AddNewTrailPlans::PlanLimits.count).to eq(1) - expect(AddNewTrailPlans::PlanLimits.first.plan_id).to eq(other_plan.id) - end - end - - context 'when the instance is not SaaS' do - before do - allow(Gitlab).to receive(:com?).and_return false - table(:plans).create!(id: 1, name: 'ultimate_trial', title: 'Ultimate Trial') - table(:plans).create!(id: 2, name: 'premium_trial', title: 'Premium Trial') - table(:plan_limits).create!(id: 1, plan_id: 1) - table(:plan_limits).create!(id: 2, plan_id: 2) - end - - it 'does not delete plans and plan limits and returns' do - migrate! - - expect { described_class.new.down }.not_to change { AddNewTrailPlans::Plan.count } - expect(AddNewTrailPlans::PlanLimits.count).to eq(3) - end - end - end -end diff --git a/spec/migrations/backfill_clusters_integration_prometheus_enabled_spec.rb b/spec/migrations/backfill_clusters_integration_prometheus_enabled_spec.rb deleted file mode 100644 index 1c7745a64ef..00000000000 --- a/spec/migrations/backfill_clusters_integration_prometheus_enabled_spec.rb +++ /dev/null @@ -1,80 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe BackfillClustersIntegrationPrometheusEnabled, :migration, feature_category: :clusters_applications_prometheus do - def create_cluster!(label = rand(2**64).to_s) - table(:clusters).create!( - name: "cluster: #{label}", - created_at: 1.day.ago, - updated_at: 1.day.ago - ) - end - - def create_clusters_applications_prometheus!(label, status:, cluster_id: nil) - table(:clusters_applications_prometheus).create!( - cluster_id: cluster_id || create_cluster!(label).id, - status: status, - version: "#{label}: version", - created_at: 1.day.ago, # artificially aged - updated_at: 1.day.ago, # artificially aged - encrypted_alert_manager_token: "#{label}: token", - encrypted_alert_manager_token_iv: "#{label}: iv" - ) - end - - def create_clusters_integration_prometheus! - table(:clusters_integration_prometheus).create!( - cluster_id: create_cluster!.id, - enabled: false, - created_at: 1.day.ago, - updated_at: 1.day.ago - ) - end - - RSpec::Matchers.define :be_enabled_and_match_application_values do |application| - match do |actual| - actual.enabled == true && - actual.encrypted_alert_manager_token == application.encrypted_alert_manager_token && - actual.encrypted_alert_manager_token_iv == application.encrypted_alert_manager_token_iv - end - end - - describe '#up' do - it 'backfills the enabled status and alert manager credentials from clusters_applications_prometheus' do - status_installed = 3 - status_externally_installed = 11 - status_installable = 0 - - existing_integration = create_clusters_integration_prometheus! - unaffected_existing_integration = create_clusters_integration_prometheus! - app_installed = create_clusters_applications_prometheus!('installed', status: status_installed) - app_installed_existing_integration = create_clusters_applications_prometheus!('installed, existing integration', status: status_installed, cluster_id: existing_integration.cluster_id) - app_externally_installed = create_clusters_applications_prometheus!('externally installed', status: status_externally_installed) - app_other_status = create_clusters_applications_prometheus!('other status', status: status_installable) - - migrate! - - integrations = table(:clusters_integration_prometheus).all.index_by(&:cluster_id) - - expect(unaffected_existing_integration.reload).to eq unaffected_existing_integration - - integration_installed = integrations[app_installed.cluster_id] - expect(integration_installed).to be_enabled_and_match_application_values(app_installed) - expect(integration_installed.updated_at).to be >= 1.minute.ago # recently updated - expect(integration_installed.updated_at).to eq(integration_installed.created_at) # recently created - - expect(existing_integration.reload).to be_enabled_and_match_application_values(app_installed_existing_integration) - expect(existing_integration.updated_at).to be >= 1.minute.ago # recently updated - expect(existing_integration.updated_at).not_to eq(existing_integration.created_at) # but not recently created - - integration_externally_installed = integrations[app_externally_installed.cluster_id] - expect(integration_externally_installed).to be_enabled_and_match_application_values(app_externally_installed) - expect(integration_externally_installed.updated_at).to be >= 1.minute.ago # recently updated - expect(integration_externally_installed.updated_at).to eq(integration_externally_installed.created_at) # recently created - - expect(integrations[app_other_status.cluster_id]).to be_nil - end - end -end diff --git a/spec/migrations/backfill_escalation_policies_for_oncall_schedules_spec.rb b/spec/migrations/backfill_escalation_policies_for_oncall_schedules_spec.rb deleted file mode 100644 index aa77a5c228a..00000000000 --- a/spec/migrations/backfill_escalation_policies_for_oncall_schedules_spec.rb +++ /dev/null @@ -1,103 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe BackfillEscalationPoliciesForOncallSchedules, feature_category: :incident_management do - let!(:projects) { table(:projects) } - let!(:schedules) { table(:incident_management_oncall_schedules) } - let!(:policies) { table(:incident_management_escalation_policies) } - let!(:rules) { table(:incident_management_escalation_rules) } - - # Project with no schedules - let!(:namespace) { table(:namespaces).create!(name: 'gitlab', path: 'gitlab') } - let!(:project_a) { projects.create!(namespace_id: namespace.id) } - - context 'with backfill-able schedules' do - # Project with one schedule - let!(:project_b) { projects.create!(namespace_id: namespace.id) } - let!(:schedule_b1) { schedules.create!(project_id: project_b.id, iid: 1, name: 'Schedule B1') } - - # Project with multiple schedules - let!(:project_c) { projects.create!(namespace_id: namespace.id) } - let!(:schedule_c1) { schedules.create!(project_id: project_c.id, iid: 1, name: 'Schedule C1') } - let!(:schedule_c2) { schedules.create!(project_id: project_c.id, iid: 2, name: 'Schedule C2') } - - # Project with a single schedule which already has a policy - let!(:project_d) { projects.create!(namespace_id: namespace.id) } - let!(:schedule_d1) { schedules.create!(project_id: project_d.id, iid: 1, name: 'Schedule D1') } - let!(:policy_d1) { policies.create!(project_id: project_d.id, name: 'Policy D1') } - let!(:rule_d1) { rules.create!(policy_id: policy_d1.id, oncall_schedule_id: schedule_d1.id, status: 2, elapsed_time_seconds: 60) } - - # Project with a multiple schedule, one of which already has a policy - let!(:project_e) { projects.create!(namespace_id: namespace.id) } - let!(:schedule_e1) { schedules.create!(project_id: project_e.id, iid: 1, name: 'Schedule E1') } - let!(:schedule_e2) { schedules.create!(project_id: project_e.id, iid: 2, name: 'Schedule E2') } - let!(:policy_e1) { policies.create!(project_id: project_e.id, name: 'Policy E1') } - let!(:rule_e1) { rules.create!(policy_id: policy_e1.id, oncall_schedule_id: schedule_e2.id, status: 2, elapsed_time_seconds: 60) } - - # Project with a multiple schedule, with multiple policies - let!(:project_f) { projects.create!(namespace_id: namespace.id) } - let!(:schedule_f1) { schedules.create!(project_id: project_f.id, iid: 1, name: 'Schedule F1') } - let!(:schedule_f2) { schedules.create!(project_id: project_f.id, iid: 2, name: 'Schedule F2') } - let!(:policy_f1) { policies.create!(project_id: project_f.id, name: 'Policy F1') } - let!(:rule_f1) { rules.create!(policy_id: policy_f1.id, oncall_schedule_id: schedule_f1.id, status: 2, elapsed_time_seconds: 60) } - let!(:rule_f2) { rules.create!(policy_id: policy_f1.id, oncall_schedule_id: schedule_f2.id, status: 2, elapsed_time_seconds: 60) } - let!(:policy_f2) { policies.create!(project_id: project_f.id, name: 'Policy F2') } - let!(:rule_f3) { rules.create!(policy_id: policy_f2.id, oncall_schedule_id: schedule_f2.id, status: 1, elapsed_time_seconds: 10) } - - it 'backfills escalation policies correctly' do - expect { migrate! } - .to change(policies, :count).by(2) - .and change(rules, :count).by(3) - - new_policy_b1, new_policy_c1 = new_polices = policies.last(2) - new_rules = rules.last(3) - - expect(new_polices).to all have_attributes(name: 'On-call Escalation Policy') - expect(new_policy_b1.description).to eq('Immediately notify Schedule B1') - expect(new_policy_c1.description).to eq('Immediately notify Schedule C1') - expect(policies.pluck(:project_id)).to eq( - [ - project_d.id, - project_e.id, - project_f.id, - project_f.id, - project_b.id, - project_c.id - ]) - - expect(new_rules).to all have_attributes(status: 1, elapsed_time_seconds: 0) - expect(rules.pluck(:policy_id)).to eq( - [ - rule_d1.policy_id, - rule_e1.policy_id, - rule_f1.policy_id, - rule_f2.policy_id, - rule_f3.policy_id, - new_policy_b1.id, - new_policy_c1.id, - new_policy_c1.id - ]) - expect(rules.pluck(:oncall_schedule_id)).to eq( - [ - rule_d1.oncall_schedule_id, - rule_e1.oncall_schedule_id, - rule_f1.oncall_schedule_id, - rule_f2.oncall_schedule_id, - rule_f3.oncall_schedule_id, - schedule_b1.id, - schedule_c1.id, - schedule_c2.id - ]) - end - end - - context 'with no schedules' do - it 'does nothing' do - expect { migrate! } - .to not_change(policies, :count) - .and not_change(rules, :count) - end - end -end diff --git a/spec/migrations/backfill_nuget_temporary_packages_to_processing_status_spec.rb b/spec/migrations/backfill_nuget_temporary_packages_to_processing_status_spec.rb deleted file mode 100644 index ae2656eaf98..00000000000 --- a/spec/migrations/backfill_nuget_temporary_packages_to_processing_status_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -require_migration! - -RSpec.describe BackfillNugetTemporaryPackagesToProcessingStatus, :migration, feature_category: :package_registry do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:packages) { table(:packages_packages) } - - before do - namespace = namespaces.create!(id: 123, name: 'test_namespace', path: 'test_namespace') - project = projects.create!(id: 111, name: 'sample_project', path: 'sample_project', namespace_id: namespace.id) - - packages.create!(name: 'NuGet.Temporary.Package', version: '0.1.1', package_type: 4, status: 0, project_id: project.id) - packages.create!(name: 'foo', version: '0.1.1', package_type: 4, status: 0, project_id: project.id) - packages.create!(name: 'NuGet.Temporary.Package', version: '0.1.1', package_type: 4, status: 2, project_id: project.id) - packages.create!(name: 'NuGet.Temporary.Package', version: '0.1.1', package_type: 1, status: 2, project_id: project.id) - packages.create!(name: 'NuGet.Temporary.Package', version: '0.1.1', package_type: 1, status: 0, project_id: project.id) - end - - it 'updates the applicable packages to processing status', :aggregate_failures do - expect(packages.where(status: 0).count).to eq(3) - expect(packages.where(status: 2).count).to eq(2) - expect(packages.where(name: 'NuGet.Temporary.Package', package_type: 4, status: 0).count).to eq(1) - - migrate! - - expect(packages.where(status: 0).count).to eq(2) - expect(packages.where(status: 2).count).to eq(3) - expect(packages.where(name: 'NuGet.Temporary.Package', package_type: 4, status: 0).count).to eq(0) - end -end diff --git a/spec/migrations/change_web_hook_events_default_spec.rb b/spec/migrations/change_web_hook_events_default_spec.rb deleted file mode 100644 index c6c3f285ff1..00000000000 --- a/spec/migrations/change_web_hook_events_default_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe ChangeWebHookEventsDefault, feature_category: :integrations do - let(:web_hooks) { table(:web_hooks) } - let(:projects) { table(:projects) } - let(:groups) { table(:namespaces) } - - let(:group) { groups.create!(name: 'gitlab', path: 'gitlab-org') } - let(:project) { projects.create!(name: 'gitlab', path: 'gitlab', namespace_id: group.id) } - let(:hook) { web_hooks.create!(project_id: project.id, type: 'ProjectHook') } - let(:group_hook) { web_hooks.create!(group_id: group.id, type: 'GroupHook') } - - before do - # Simulate the wrong schema - %w(push_events issues_events merge_requests_events tag_push_events).each do |column| - ActiveRecord::Base.connection.execute "ALTER TABLE web_hooks ALTER COLUMN #{column} DROP DEFAULT" - end - end - - it 'sets default values' do - migrate! - - expect(hook.push_events).to be true - expect(hook.issues_events).to be false - expect(hook.merge_requests_events).to be false - expect(hook.tag_push_events).to be false - - expect(group_hook.push_events).to be true - expect(group_hook.issues_events).to be false - expect(group_hook.merge_requests_events).to be false - expect(group_hook.tag_push_events).to be false - end -end diff --git a/spec/migrations/clean_up_pending_builds_table_spec.rb b/spec/migrations/clean_up_pending_builds_table_spec.rb deleted file mode 100644 index e044d4a702b..00000000000 --- a/spec/migrations/clean_up_pending_builds_table_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe CleanUpPendingBuildsTable, :suppress_gitlab_schemas_validate_connection, -feature_category: :continuous_integration do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:queue) { table(:ci_pending_builds) } - let(:builds) { table(:ci_builds) } - - before do - namespaces.create!(id: 123, name: 'sample', path: 'sample') - projects.create!(id: 123, name: 'sample', path: 'sample', namespace_id: 123) - - builds.create!(id: 1, project_id: 123, status: 'pending', type: 'Ci::Build') - builds.create!(id: 2, project_id: 123, status: 'pending', type: 'GenericCommitStatus') - builds.create!(id: 3, project_id: 123, status: 'success', type: 'Ci::Bridge') - builds.create!(id: 4, project_id: 123, status: 'success', type: 'Ci::Build') - builds.create!(id: 5, project_id: 123, status: 'running', type: 'Ci::Build') - builds.create!(id: 6, project_id: 123, status: 'created', type: 'Ci::Build') - - queue.create!(id: 1, project_id: 123, build_id: 1) - queue.create!(id: 2, project_id: 123, build_id: 4) - queue.create!(id: 3, project_id: 123, build_id: 5) - end - - it 'removes duplicated data from pending builds table' do - migrate! - - expect(queue.all.count).to eq 1 - expect(queue.first.id).to eq 1 - expect(builds.all.count).to eq 6 - end - - context 'when there are multiple batches' do - before do - stub_const("#{described_class}::BATCH_SIZE", 1) - end - - it 'iterates the data correctly' do - migrate! - - expect(queue.all.count).to eq 1 - end - end -end diff --git a/spec/migrations/cleanup_move_container_registry_enabled_to_project_feature_spec.rb b/spec/migrations/cleanup_move_container_registry_enabled_to_project_feature_spec.rb deleted file mode 100644 index 1badde62526..00000000000 --- a/spec/migrations/cleanup_move_container_registry_enabled_to_project_feature_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe CleanupMoveContainerRegistryEnabledToProjectFeature, :migration, feature_category: :navigation do - let(:namespace) { table(:namespaces).create!(name: 'gitlab', path: 'gitlab-org') } - let(:non_null_project_features) { { pages_access_level: 20 } } - let(:bg_class_name) { 'MoveContainerRegistryEnabledToProjectFeature' } - - let!(:project1) { table(:projects).create!(namespace_id: namespace.id, name: 'project 1', container_registry_enabled: true) } - let!(:project2) { table(:projects).create!(namespace_id: namespace.id, name: 'project 2', container_registry_enabled: false) } - let!(:project3) { table(:projects).create!(namespace_id: namespace.id, name: 'project 3', container_registry_enabled: nil) } - - let!(:project4) { table(:projects).create!(namespace_id: namespace.id, name: 'project 4', container_registry_enabled: true) } - let!(:project5) { table(:projects).create!(namespace_id: namespace.id, name: 'project 5', container_registry_enabled: false) } - let!(:project6) { table(:projects).create!(namespace_id: namespace.id, name: 'project 6', container_registry_enabled: nil) } - - let!(:project_feature1) { table(:project_features).create!(project_id: project1.id, container_registry_access_level: 20, **non_null_project_features) } - let!(:project_feature2) { table(:project_features).create!(project_id: project2.id, container_registry_access_level: 0, **non_null_project_features) } - let!(:project_feature3) { table(:project_features).create!(project_id: project3.id, container_registry_access_level: 0, **non_null_project_features) } - - let!(:project_feature4) { table(:project_features).create!(project_id: project4.id, container_registry_access_level: 0, **non_null_project_features) } - let!(:project_feature5) { table(:project_features).create!(project_id: project5.id, container_registry_access_level: 20, **non_null_project_features) } - let!(:project_feature6) { table(:project_features).create!(project_id: project6.id, container_registry_access_level: 20, **non_null_project_features) } - - let!(:background_migration_job1) { table(:background_migration_jobs).create!(class_name: bg_class_name, arguments: [project4.id, project5.id], status: 0) } - let!(:background_migration_job2) { table(:background_migration_jobs).create!(class_name: bg_class_name, arguments: [project6.id, project6.id], status: 0) } - let!(:background_migration_job3) { table(:background_migration_jobs).create!(class_name: bg_class_name, arguments: [project1.id, project3.id], status: 1) } - - it 'steals remaining jobs, updates any remaining rows and deletes background_migration_jobs rows' do - expect(Gitlab::BackgroundMigration).to receive(:steal).with(bg_class_name).and_call_original - - migrate! - - expect(project_feature1.reload.container_registry_access_level).to eq(20) - expect(project_feature2.reload.container_registry_access_level).to eq(0) - expect(project_feature3.reload.container_registry_access_level).to eq(0) - expect(project_feature4.reload.container_registry_access_level).to eq(20) - expect(project_feature5.reload.container_registry_access_level).to eq(0) - expect(project_feature6.reload.container_registry_access_level).to eq(0) - - expect(table(:background_migration_jobs).where(class_name: bg_class_name).count).to eq(0) - end -end diff --git a/spec/migrations/confirm_support_bot_user_spec.rb b/spec/migrations/confirm_support_bot_user_spec.rb deleted file mode 100644 index 863bdb13585..00000000000 --- a/spec/migrations/confirm_support_bot_user_spec.rb +++ /dev/null @@ -1,86 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe ConfirmSupportBotUser, :migration, feature_category: :users do - let(:users) { table(:users) } - - context 'when support bot user is currently unconfirmed' do - let!(:support_bot) do - create_user!( - created_at: 2.days.ago, - user_type: User::USER_TYPES['support_bot'] - ) - end - - it 'updates the `confirmed_at` attribute' do - expect { migrate! }.to change { support_bot.reload.confirmed_at } - end - - it 'sets `confirmed_at` to be the same as their `created_at` attribute' do - migrate! - - expect(support_bot.reload.confirmed_at).to eq(support_bot.created_at) - end - end - - context 'when support bot user is already confirmed' do - let!(:confirmed_support_bot) do - create_user!( - user_type: User::USER_TYPES['support_bot'], - confirmed_at: 1.day.ago - ) - end - - it 'does not change their `confirmed_at` attribute' do - expect { migrate! }.not_to change { confirmed_support_bot.reload.confirmed_at } - end - end - - context 'when support bot user created_at is null' do - let!(:support_bot) do - create_user!( - user_type: User::USER_TYPES['support_bot'], - confirmed_at: nil, - record_timestamps: false - ) - end - - it 'updates the `confirmed_at` attribute' do - expect { migrate! }.to change { support_bot.reload.confirmed_at }.from(nil) - end - - it 'does not change the `created_at` attribute' do - expect { migrate! }.not_to change { support_bot.reload.created_at }.from(nil) - end - end - - context 'with human users that are currently unconfirmed' do - let!(:unconfirmed_human) do - create_user!( - name: 'human', - email: 'human@example.com', - user_type: nil - ) - end - - it 'does not update their `confirmed_at` attribute' do - expect { migrate! }.not_to change { unconfirmed_human.reload.confirmed_at } - end - end - - private - - def create_user!(user_type:, name: 'GitLab Support Bot', email: 'support@example.com', created_at: Time.now, confirmed_at: nil, record_timestamps: true) - users.create!( - name: name, - email: email, - username: name, - projects_limit: 0, - user_type: user_type, - confirmed_at: confirmed_at, - record_timestamps: record_timestamps - ) - end -end diff --git a/spec/migrations/delete_security_findings_without_uuid_spec.rb b/spec/migrations/delete_security_findings_without_uuid_spec.rb deleted file mode 100644 index e4c17288384..00000000000 --- a/spec/migrations/delete_security_findings_without_uuid_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe DeleteSecurityFindingsWithoutUuid, :suppress_gitlab_schemas_validate_connection, -feature_category: :vulnerability_management do - let(:users) { table(:users) } - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:ci_pipelines) { table(:ci_pipelines) } - let(:ci_builds) { table(:ci_builds) } - let(:ci_artifacts) { table(:ci_job_artifacts) } - let(:scanners) { table(:vulnerability_scanners) } - let(:security_scans) { table(:security_scans) } - let(:security_findings) { table(:security_findings) } - let(:sast_file_type) { 5 } - let(:sast_scan_type) { 1 } - - let(:user) { users.create!(email: 'test@gitlab.com', projects_limit: 5) } - let(:namespace) { namespaces.create!(name: 'gitlab', path: 'gitlab-org') } - let(:project) { projects.create!(namespace_id: namespace.id, name: 'foo') } - let(:ci_pipeline) { ci_pipelines.create!(project_id: project.id, ref: 'master', sha: 'adf43c3a', status: 'success') } - let(:ci_build) { ci_builds.create!(commit_id: ci_pipeline.id, retried: false, type: 'Ci::Build') } - let(:ci_artifact) { ci_artifacts.create!(project_id: project.id, job_id: ci_build.id, file_type: sast_file_type, file_format: 1) } - let(:scanner) { scanners.create!(project_id: project.id, external_id: 'bandit', name: 'Bandit') } - let(:security_scan) { security_scans.create!(build_id: ci_build.id, scan_type: sast_scan_type) } - - let!(:finding_1) { security_findings.create!(scan_id: security_scan.id, scanner_id: scanner.id, severity: 0, confidence: 0, project_fingerprint: Digest::SHA1.hexdigest(SecureRandom.uuid)) } - let!(:finding_2) { security_findings.create!(scan_id: security_scan.id, scanner_id: scanner.id, severity: 0, confidence: 0, project_fingerprint: Digest::SHA1.hexdigest(SecureRandom.uuid), uuid: SecureRandom.uuid) } - - it 'successfully runs and does not schedule any job' do - expect { migrate! }.to change { described_class::SecurityFinding.count }.by(-1) - .and change { described_class::SecurityFinding.where(id: finding_1) } - end -end diff --git a/spec/migrations/insert_ci_daily_pipeline_schedule_triggers_plan_limits_spec.rb b/spec/migrations/insert_ci_daily_pipeline_schedule_triggers_plan_limits_spec.rb deleted file mode 100644 index 9358b71132c..00000000000 --- a/spec/migrations/insert_ci_daily_pipeline_schedule_triggers_plan_limits_spec.rb +++ /dev/null @@ -1,73 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe InsertCiDailyPipelineScheduleTriggersPlanLimits, feature_category: :purchase do - let!(:plans) { table(:plans) } - let!(:plan_limits) { table(:plan_limits) } - - context 'when on Gitlab.com' do - let(:free_plan) { plans.create!(name: 'free') } - let(:bronze_plan) { plans.create!(name: 'bronze') } - let(:silver_plan) { plans.create!(name: 'silver') } - let(:gold_plan) { plans.create!(name: 'gold') } - - before do - allow(Gitlab).to receive(:com?).and_return(true) - - plan_limits.create!(plan_id: free_plan.id) - plan_limits.create!(plan_id: bronze_plan.id) - plan_limits.create!(plan_id: silver_plan.id) - plan_limits.create!(plan_id: gold_plan.id) - end - - it 'correctly migrates up and down' do - reversible_migration do |migration| - migration.before -> { - expect(plan_limits.pluck(:plan_id, :ci_daily_pipeline_schedule_triggers)).to contain_exactly( - [free_plan.id, 0], - [bronze_plan.id, 0], - [silver_plan.id, 0], - [gold_plan.id, 0] - ) - } - - migration.after -> { - expect(plan_limits.pluck(:plan_id, :ci_daily_pipeline_schedule_triggers)).to contain_exactly( - [free_plan.id, 24], - [bronze_plan.id, 288], - [silver_plan.id, 288], - [gold_plan.id, 288] - ) - } - end - end - end - - context 'when on self hosted' do - let(:default_plan) { plans.create!(name: 'default') } - - before do - allow(Gitlab).to receive(:com?).and_return(false) - - plan_limits.create!(plan_id: default_plan.id) - end - - it 'does nothing' do - reversible_migration do |migration| - migration.before -> { - expect(plan_limits.pluck(:plan_id, :ci_daily_pipeline_schedule_triggers)).to contain_exactly( - [default_plan.id, 0] - ) - } - - migration.after -> { - expect(plan_limits.pluck(:plan_id, :ci_daily_pipeline_schedule_triggers)).to contain_exactly( - [default_plan.id, 0] - ) - } - end - end - end -end diff --git a/spec/migrations/migrate_elastic_index_settings_spec.rb b/spec/migrations/migrate_elastic_index_settings_spec.rb deleted file mode 100644 index b67c4d902c7..00000000000 --- a/spec/migrations/migrate_elastic_index_settings_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -require_migration! - -RSpec.describe MigrateElasticIndexSettings, feature_category: :global_search do - let(:elastic_index_settings) { table(:elastic_index_settings) } - let(:application_settings) { table(:application_settings) } - - context 'with application_settings present' do - before do - application_settings.create!(elasticsearch_replicas: 2, elasticsearch_shards: 15) - end - - it 'migrates settings' do - migrate! - - settings = elastic_index_settings.all - - expect(settings.size).to eq 1 - - setting = settings.first - - expect(setting.number_of_replicas).to eq(2) - expect(setting.number_of_shards).to eq(15) - end - end - - context 'without application_settings present' do - it 'migrates settings' do - migrate! - - settings = elastic_index_settings.all - - expect(settings.size).to eq 1 - - setting = elastic_index_settings.first - - expect(setting.number_of_replicas).to eq(1) - expect(setting.number_of_shards).to eq(5) - end - end -end diff --git a/spec/migrations/move_container_registry_enabled_to_project_features3_spec.rb b/spec/migrations/move_container_registry_enabled_to_project_features3_spec.rb deleted file mode 100644 index 25e0ef439bd..00000000000 --- a/spec/migrations/move_container_registry_enabled_to_project_features3_spec.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe MoveContainerRegistryEnabledToProjectFeatures3, :migration, feature_category: :container_registry do - let(:namespace) { table(:namespaces).create!(name: 'gitlab', path: 'gitlab-org') } - - let!(:background_jobs) do - table(:background_migration_jobs).create!(class_name: described_class::MIGRATION, arguments: [-1, -2]) - table(:background_migration_jobs).create!(class_name: described_class::MIGRATION, arguments: [-3, -4]) - end - - let!(:projects) do - [ - table(:projects).create!(namespace_id: namespace.id, name: 'project 1'), - table(:projects).create!(namespace_id: namespace.id, name: 'project 2'), - table(:projects).create!(namespace_id: namespace.id, name: 'project 3'), - table(:projects).create!(namespace_id: namespace.id, name: 'project 4') - ] - end - - before do - stub_const("#{described_class.name}::BATCH_SIZE", 3) - end - - around do |example| - Sidekiq::Testing.fake! do - freeze_time do - example.call - end - end - end - - it 'schedules jobs for ranges of projects' do - # old entries in background_migration_jobs should be deleted. - expect(table(:background_migration_jobs).count).to eq(2) - expect(table(:background_migration_jobs).first.arguments).to eq([-1, -2]) - expect(table(:background_migration_jobs).second.arguments).to eq([-3, -4]) - - migrate! - - # Since track_jobs is true, each job should have an entry in the background_migration_jobs - # table. - expect(table(:background_migration_jobs).count).to eq(2) - expect(table(:background_migration_jobs).first.arguments).to eq([projects[0].id, projects[2].id]) - expect(table(:background_migration_jobs).second.arguments).to eq([projects[3].id, projects[3].id]) - - expect(described_class::MIGRATION) - .to be_scheduled_delayed_migration(2.minutes, projects[0].id, projects[2].id) - - expect(described_class::MIGRATION) - .to be_scheduled_delayed_migration(4.minutes, projects[3].id, projects[3].id) - end - - it 'schedules jobs according to the configured batch size' do - expect { migrate! }.to change { BackgroundMigrationWorker.jobs.size }.by(2) - end -end diff --git a/spec/migrations/populate_dismissal_information_for_vulnerabilities_spec.rb b/spec/migrations/populate_dismissal_information_for_vulnerabilities_spec.rb deleted file mode 100644 index 66fd5eb5ae5..00000000000 --- a/spec/migrations/populate_dismissal_information_for_vulnerabilities_spec.rb +++ /dev/null @@ -1,61 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe PopulateDismissalInformationForVulnerabilities, feature_category: :vulnerability_management do - let(:users) { table(:users) } - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:vulnerabilities) { table(:vulnerabilities) } - - let(:existing_dismissed_at) { Time.now } - let(:states) { { detected: 1, dismissed: 2, resolved: 3, confirmed: 4 } } - let!(:namespace) { namespaces.create!(name: "foo", path: "bar") } - let!(:user_1) { users.create!(name: 'John Doe', email: 'john_doe+1@example.com', projects_limit: 5) } - let!(:user_2) { users.create!(name: 'John Doe', email: 'john_doe+2@example.com', projects_limit: 5) } - let!(:project) { projects.create!(namespace_id: namespace.id) } - let!(:vulnerability_params) do - { - project_id: project.id, - author_id: user_1.id, - title: 'Vulnerability', - severity: 5, - confidence: 5, - report_type: 5 - } - end - - let!(:detected_vulnerability) { vulnerabilities.create!(**vulnerability_params, state: states[:detected]) } - let!(:resolved_vulnerability) { vulnerabilities.create!(**vulnerability_params, state: states[:resolved]) } - let!(:confirmed_vulnerability) { vulnerabilities.create!(**vulnerability_params, state: states[:confirmed]) } - - let!(:dismissed_vulnerability_1) { vulnerabilities.create!(**vulnerability_params, state: states[:dismissed], updated_by_id: user_2.id) } - let!(:dismissed_vulnerability_2) { vulnerabilities.create!(**vulnerability_params, state: states[:dismissed], last_edited_by_id: user_2.id) } - let!(:dismissed_vulnerability_3) { vulnerabilities.create!(**vulnerability_params, state: states[:dismissed], dismissed_at: existing_dismissed_at, author_id: user_2.id) } - let!(:dismissed_vulnerability_4) { vulnerabilities.create!(**vulnerability_params, state: states[:dismissed], dismissed_by_id: user_1.id, author_id: user_2.id) } - let!(:dismissed_vulnerability_5) { vulnerabilities.create!(**vulnerability_params, state: states[:dismissed], dismissed_at: existing_dismissed_at, dismissed_by_id: user_1.id, updated_by_id: user_2.id) } - - around do |example| - freeze_time { example.run } - end - - it 'updates the dismissal information for vulnerabilities' do - expect { migrate! }.to change { dismissed_vulnerability_1.reload.dismissed_at }.from(nil).to(dismissed_vulnerability_1.updated_at) - .and change { dismissed_vulnerability_1.reload.dismissed_by_id }.from(nil).to(user_2.id) - .and change { dismissed_vulnerability_2.reload.dismissed_at }.from(nil).to(dismissed_vulnerability_2.updated_at) - .and change { dismissed_vulnerability_2.reload.dismissed_by_id }.from(nil).to(user_2.id) - .and change { dismissed_vulnerability_3.reload.dismissed_by_id }.from(nil).to(user_2.id) - .and change { dismissed_vulnerability_4.reload.dismissed_at }.from(nil).to(dismissed_vulnerability_4.updated_at) - .and not_change { dismissed_vulnerability_3.reload.dismissed_at }.from(existing_dismissed_at) - .and not_change { dismissed_vulnerability_4.reload.dismissed_by_id }.from(user_1.id) - .and not_change { dismissed_vulnerability_5.reload.dismissed_at }.from(existing_dismissed_at) - .and not_change { dismissed_vulnerability_5.reload.dismissed_by_id }.from(user_1.id) - .and not_change { detected_vulnerability.reload.dismissed_at }.from(nil) - .and not_change { detected_vulnerability.reload.dismissed_by_id }.from(nil) - .and not_change { resolved_vulnerability.reload.dismissed_at }.from(nil) - .and not_change { resolved_vulnerability.reload.dismissed_by_id }.from(nil) - .and not_change { confirmed_vulnerability.reload.dismissed_at }.from(nil) - .and not_change { confirmed_vulnerability.reload.dismissed_by_id }.from(nil) - end -end diff --git a/spec/migrations/remove_hipchat_service_records_spec.rb b/spec/migrations/remove_hipchat_service_records_spec.rb deleted file mode 100644 index b89572b069e..00000000000 --- a/spec/migrations/remove_hipchat_service_records_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe RemoveHipchatServiceRecords, feature_category: :integrations do - let(:services) { table(:services) } - - before do - services.create!(type: 'HipchatService') - services.create!(type: 'SomeOtherType') - end - - it 'removes services records of type HipchatService' do - expect(services.count).to eq(2) - - migrate! - - expect(services.count).to eq(1) - expect(services.first.type).to eq('SomeOtherType') - expect(services.where(type: 'HipchatService')).to be_empty - end -end diff --git a/spec/migrations/remove_records_without_group_from_webhooks_table_spec.rb b/spec/migrations/remove_records_without_group_from_webhooks_table_spec.rb deleted file mode 100644 index eabf6271ded..00000000000 --- a/spec/migrations/remove_records_without_group_from_webhooks_table_spec.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -require_migration! -require_migration!('add_not_valid_foreign_key_to_group_hooks') - -RSpec.describe RemoveRecordsWithoutGroupFromWebhooksTable, schema: 20210330091751, feature_category: :integrations do - let(:web_hooks) { table(:web_hooks) } - let(:groups) { table(:namespaces) } - - before do - group = groups.create!(name: 'gitlab', path: 'gitlab-org') - web_hooks.create!(group_id: group.id, type: 'GroupHook') - web_hooks.create!(group_id: nil) - - AddNotValidForeignKeyToGroupHooks.new.down - web_hooks.create!(group_id: non_existing_record_id, type: 'GroupHook') - AddNotValidForeignKeyToGroupHooks.new.up - end - - it 'removes group hooks where the referenced group does not exist', :aggregate_failures do - expect { RemoveRecordsWithoutGroupFromWebhooksTable.new.up }.to change { web_hooks.count }.by(-1) - expect(web_hooks.where.not(group_id: groups.select(:id)).count).to eq(0) - expect(web_hooks.where.not(group_id: nil).count).to eq(1) - end -end diff --git a/spec/migrations/schedule_disable_expiration_policies_linked_to_no_container_images_spec.rb b/spec/migrations/schedule_disable_expiration_policies_linked_to_no_container_images_spec.rb deleted file mode 100644 index ebcc3fda0a3..00000000000 --- a/spec/migrations/schedule_disable_expiration_policies_linked_to_no_container_images_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -require_migration! - -RSpec.describe ScheduleDisableExpirationPoliciesLinkedToNoContainerImages, feature_category: :container_registry do - let!(:projects) { table(:projects) } - let!(:container_expiration_policies) { table(:container_expiration_policies) } - let!(:container_repositories) { table(:container_repositories) } - let!(:namespaces) { table(:namespaces) } - let!(:namespace) { namespaces.create!(name: 'test', path: 'test') } - - let!(:policy1) { create_expiration_policy(id: 1, enabled: true) } - let!(:policy2) { create_expiration_policy(id: 2, enabled: false) } - let!(:policy3) { create_expiration_policy(id: 3, enabled: false) } - let!(:policy4) { create_expiration_policy(id: 4, enabled: true) } - let!(:policy5) { create_expiration_policy(id: 5, enabled: false) } - let!(:policy6) { create_expiration_policy(id: 6, enabled: false) } - let!(:policy7) { create_expiration_policy(id: 7, enabled: true) } - let!(:policy8) { create_expiration_policy(id: 8, enabled: true) } - let!(:policy9) { create_expiration_policy(id: 9, enabled: true) } - - it 'schedules background migrations', :aggregate_failures do - stub_const("#{described_class}::BATCH_SIZE", 2) - - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - expect(described_class::MIGRATION).to be_scheduled_delayed_migration(2.minutes, 1, 4) - expect(described_class::MIGRATION).to be_scheduled_delayed_migration(4.minutes, 7, 8) - expect(described_class::MIGRATION).to be_scheduled_delayed_migration(6.minutes, 9, 9) - - expect(BackgroundMigrationWorker.jobs.size).to eq(3) - end - end - end - - def create_expiration_policy(id:, enabled:) - project = projects.create!(id: id, namespace_id: namespace.id, name: "gitlab-#{id}") - container_expiration_policies.create!( - enabled: enabled, - project_id: project.id - ) - end -end diff --git a/spec/migrations/schedule_update_timelogs_project_id_spec.rb b/spec/migrations/schedule_update_timelogs_project_id_spec.rb deleted file mode 100644 index 5ce3f7dd36c..00000000000 --- a/spec/migrations/schedule_update_timelogs_project_id_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe ScheduleUpdateTimelogsProjectId, feature_category: :team_planning do - let!(:namespace) { table(:namespaces).create!(name: 'namespace', path: 'namespace') } - let!(:project) { table(:projects).create!(namespace_id: namespace.id) } - let!(:issue) { table(:issues).create!(project_id: project.id) } - let!(:merge_request) { table(:merge_requests).create!(target_project_id: project.id, source_branch: 'master', target_branch: 'feature') } - let!(:timelog1) { table(:timelogs).create!(issue_id: issue.id, time_spent: 60) } - let!(:timelog2) { table(:timelogs).create!(merge_request_id: merge_request.id, time_spent: 600) } - let!(:timelog3) { table(:timelogs).create!(merge_request_id: merge_request.id, time_spent: 60) } - let!(:timelog4) { table(:timelogs).create!(issue_id: issue.id, time_spent: 600) } - - it 'correctly schedules background migrations' do - stub_const("#{described_class}::BATCH_SIZE", 2) - - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - expect(described_class::MIGRATION) - .to be_scheduled_delayed_migration(2.minutes, timelog1.id, timelog2.id) - - expect(described_class::MIGRATION) - .to be_scheduled_delayed_migration(4.minutes, timelog3.id, timelog4.id) - - expect(BackgroundMigrationWorker.jobs.size).to eq(2) - end - end - end -end diff --git a/spec/migrations/schedule_update_users_where_two_factor_auth_required_from_group_spec.rb b/spec/migrations/schedule_update_users_where_two_factor_auth_required_from_group_spec.rb deleted file mode 100644 index c9f22c02a0b..00000000000 --- a/spec/migrations/schedule_update_users_where_two_factor_auth_required_from_group_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe ScheduleUpdateUsersWhereTwoFactorAuthRequiredFromGroup, feature_category: :require_two_factor_authentication_from_group do - let(:users) { table(:users) } - let!(:user_1) { users.create!(require_two_factor_authentication_from_group: false, name: "user1", email: "user1@example.com", projects_limit: 1) } - let!(:user_2) { users.create!(require_two_factor_authentication_from_group: true, name: "user2", email: "user2@example.com", projects_limit: 1) } - let!(:user_3) { users.create!(require_two_factor_authentication_from_group: false, name: "user3", email: "user3@example.com", projects_limit: 1) } - - before do - stub_const("#{described_class.name}::BATCH_SIZE", 1) - end - - it 'schedules jobs for users that do not require two factor authentication' do - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - expect(described_class::MIGRATION).to be_scheduled_delayed_migration( - 2.minutes, user_1.id, user_1.id) - expect(described_class::MIGRATION).to be_scheduled_delayed_migration( - 4.minutes, user_3.id, user_3.id) - expect(BackgroundMigrationWorker.jobs.size).to eq(2) - end - end - end -end diff --git a/spec/migrations/update_invalid_web_hooks_spec.rb b/spec/migrations/update_invalid_web_hooks_spec.rb deleted file mode 100644 index 9e69d3637b8..00000000000 --- a/spec/migrations/update_invalid_web_hooks_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -require_migration! - -RSpec.describe UpdateInvalidWebHooks, feature_category: :integrations do - let(:web_hooks) { table(:web_hooks) } - let(:groups) { table(:namespaces) } - let(:projects) { table(:projects) } - - before do - group = groups.create!(name: 'gitlab', path: 'gitlab-org') - project = projects.create!(namespace_id: group.id) - - web_hooks.create!(group_id: group.id, type: 'GroupHook') - web_hooks.create!(project_id: project.id, type: 'ProjectHook') - web_hooks.create!(group_id: group.id, project_id: project.id, type: 'ProjectHook') - end - - it 'clears group_id when ProjectHook type and project_id are present', :aggregate_failures do - expect(web_hooks.where.not(group_id: nil).where.not(project_id: nil).count).to eq(1) - - migrate! - - expect(web_hooks.where.not(group_id: nil).where.not(project_id: nil).count).to eq(0) - expect(web_hooks.where(type: 'GroupHook').count).to eq(1) - expect(web_hooks.where(type: 'ProjectHook').count).to eq(2) - end -end diff --git a/spec/services/bulk_imports/create_service_spec.rb b/spec/services/bulk_imports/create_service_spec.rb index 062f6833a69..24e07493aa2 100644 --- a/spec/services/bulk_imports/create_service_spec.rb +++ b/spec/services/bulk_imports/create_service_spec.rb @@ -74,7 +74,8 @@ RSpec.describe BulkImports::CreateService, feature_category: :importers do expect(result).to be_error expect(result.message) .to eq( - "Import aborted as the provided personal access token does not have the required 'api' scope." + "Import aborted as the provided personal access token does not have the required 'api' scope or is " \ + "no longer valid." ) end end diff --git a/spec/services/personal_access_tokens/revoke_service_spec.rb b/spec/services/personal_access_tokens/revoke_service_spec.rb index 562d6017405..a9b4df9749f 100644 --- a/spec/services/personal_access_tokens/revoke_service_spec.rb +++ b/spec/services/personal_access_tokens/revoke_service_spec.rb @@ -71,26 +71,30 @@ RSpec.describe PersonalAccessTokens::RevokeService do let_it_be(:current_user) { nil } context 'when source is valid' do - let_it_be(:source) { 'secret_detection' } + let_it_be(:source) { :secret_detection } let_it_be(:token) { create(:personal_access_token) } it_behaves_like 'a successfully revoked token' do - let(:revoked_by) { 'secret_detection' } + let(:revoked_by) { :secret_detection } end end context 'when source is invalid' do - let_it_be(:source) { 'external_request' } + let_it_be(:source) { :external_request } let_it_be(:token) { create(:personal_access_token) } - it_behaves_like 'an unsuccessfully revoked token' + it 'raises ArgumentError' do + expect { subject }.to raise_error ArgumentError + end end context 'when source is missing' do let_it_be(:source) { nil } let_it_be(:token) { create(:personal_access_token) } - it_behaves_like 'an unsuccessfully revoked token' + it 'raises ArgumentError' do + expect { subject }.to raise_error ArgumentError + end end end end diff --git a/spec/simplecov_env.rb b/spec/simplecov_env.rb index 70bd01091ba..07a23021ef5 100644 --- a/spec/simplecov_env.rb +++ b/spec/simplecov_env.rb @@ -57,6 +57,7 @@ module SimpleCovEnv add_filter '/vendor/ruby/' add_filter '/bin/' add_filter 'db/fixtures/development/' # Matches EE files as well + add_filter %r|db/migrate/\d{14}_init_schema\.rb\z| add_group 'Channels', 'app/channels' # Matches EE files as well add_group 'Controllers', 'app/controllers' # Matches EE files as well