diff options
1094 files changed, 11298 insertions, 18530 deletions
diff --git a/app/assets/javascripts/packages/shared/constants.js b/app/assets/javascripts/packages/shared/constants.js index f15c31b85c1..c284b8358b4 100644 --- a/app/assets/javascripts/packages/shared/constants.js +++ b/app/assets/javascripts/packages/shared/constants.js @@ -1,5 +1,4 @@ -/* eslint-disable @gitlab/require-string-literal-i18n-helpers */ -import { __, s__ } from '~/locale'; +import { s__ } from '~/locale'; export const PackageType = { CONAN: 'conan', @@ -38,7 +37,7 @@ export const DELETE_PACKAGE_ERROR_MESSAGE = s__( 'PackageRegistry|Something went wrong while deleting the package.', ); export const DELETE_PACKAGE_FILE_ERROR_MESSAGE = s__( - __('PackageRegistry|Something went wrong while deleting the package file.'), + 'PackageRegistry|Something went wrong while deleting the package file.', ); export const DELETE_PACKAGE_FILE_SUCCESS_MESSAGE = s__( 'PackageRegistry|Package file deleted successfully', diff --git a/config/feature_flags/development/use_cte_for_any_project_with_shared_runners_enabled.yml b/config/feature_flags/development/use_cte_for_any_project_with_shared_runners_enabled.yml deleted file mode 100644 index bca2aacf6a9..00000000000 --- a/config/feature_flags/development/use_cte_for_any_project_with_shared_runners_enabled.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: use_cte_for_any_project_with_shared_runners_enabled -introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/71452 -rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/342024 -milestone: '14.4' -type: development -group: group::optimize -default_enabled: true diff --git a/config/metrics/counts_28d/20210216175055_merge_requests.yml b/config/metrics/counts_28d/20210216175055_merge_requests.yml index dca4f81eeea..06c46964954 100644 --- a/config/metrics/counts_28d/20210216175055_merge_requests.yml +++ b/config/metrics/counts_28d/20210216175055_merge_requests.yml @@ -1,7 +1,7 @@ --- data_category: optional key_path: usage_activity_by_stage_monthly.create.merge_requests -description: Count of the number of users creating merge requests +description: Count distinct authors of merge requests product_section: dev product_stage: create product_group: group::code review diff --git a/config/metrics/counts_28d/20210216175101_merge_requests_users.yml b/config/metrics/counts_28d/20210216175101_merge_requests_users.yml index 04f0f124e8f..2b43fbf8131 100644 --- a/config/metrics/counts_28d/20210216175101_merge_requests_users.yml +++ b/config/metrics/counts_28d/20210216175101_merge_requests_users.yml @@ -1,7 +1,7 @@ --- data_category: optional key_path: usage_activity_by_stage_monthly.create.merge_requests_users -description: Monthly count of the number of merge request users +description: Distinct count of users performing merge request actions like closed, merged, created, commented product_section: dev product_stage: create product_group: group::code review diff --git a/db/init_structure.sql b/db/init_structure.sql new file mode 100644 index 00000000000..e2048e436ed --- /dev/null +++ b/db/init_structure.sql @@ -0,0 +1,11226 @@ +CREATE EXTENSION IF NOT EXISTS pg_trgm; + +CREATE TABLE abuse_reports ( + id integer NOT NULL, + reporter_id integer, + user_id integer, + message text, + created_at timestamp without time zone, + updated_at timestamp without time zone, + message_html text, + cached_markdown_version integer +); + +CREATE SEQUENCE abuse_reports_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE abuse_reports_id_seq OWNED BY abuse_reports.id; + +CREATE TABLE alerts_service_data ( + id bigint NOT NULL, + service_id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + encrypted_token character varying(255), + encrypted_token_iv character varying(255) +); + +CREATE SEQUENCE alerts_service_data_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE alerts_service_data_id_seq OWNED BY alerts_service_data.id; + +CREATE TABLE allowed_email_domains ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + group_id integer NOT NULL, + domain character varying(255) NOT NULL +); + +CREATE SEQUENCE allowed_email_domains_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE allowed_email_domains_id_seq OWNED BY allowed_email_domains.id; + +CREATE TABLE analytics_cycle_analytics_group_stages ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + relative_position integer, + start_event_identifier integer NOT NULL, + end_event_identifier integer NOT NULL, + group_id bigint NOT NULL, + start_event_label_id bigint, + end_event_label_id bigint, + hidden boolean DEFAULT false NOT NULL, + custom boolean DEFAULT true NOT NULL, + name character varying(255) NOT NULL +); + +CREATE SEQUENCE analytics_cycle_analytics_group_stages_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE analytics_cycle_analytics_group_stages_id_seq OWNED BY analytics_cycle_analytics_group_stages.id; + +CREATE TABLE analytics_cycle_analytics_project_stages ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + relative_position integer, + start_event_identifier integer NOT NULL, + end_event_identifier integer NOT NULL, + project_id bigint NOT NULL, + start_event_label_id bigint, + end_event_label_id bigint, + hidden boolean DEFAULT false NOT NULL, + custom boolean DEFAULT true NOT NULL, + name character varying(255) NOT NULL +); + +CREATE SEQUENCE analytics_cycle_analytics_project_stages_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE analytics_cycle_analytics_project_stages_id_seq OWNED BY analytics_cycle_analytics_project_stages.id; + +CREATE TABLE analytics_language_trend_repository_languages ( + file_count integer DEFAULT 0 NOT NULL, + programming_language_id bigint NOT NULL, + project_id bigint NOT NULL, + loc integer DEFAULT 0 NOT NULL, + bytes integer DEFAULT 0 NOT NULL, + percentage smallint DEFAULT 0 NOT NULL, + snapshot_date date NOT NULL +); + +CREATE TABLE analytics_repository_file_commits ( + id bigint NOT NULL, + analytics_repository_file_id bigint NOT NULL, + project_id bigint NOT NULL, + committed_date date NOT NULL, + commit_count smallint NOT NULL +); + +CREATE SEQUENCE analytics_repository_file_commits_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE analytics_repository_file_commits_id_seq OWNED BY analytics_repository_file_commits.id; + +CREATE TABLE analytics_repository_file_edits ( + id bigint NOT NULL, + project_id bigint NOT NULL, + analytics_repository_file_id bigint NOT NULL, + committed_date date NOT NULL, + num_edits integer DEFAULT 0 NOT NULL +); + +CREATE SEQUENCE analytics_repository_file_edits_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE analytics_repository_file_edits_id_seq OWNED BY analytics_repository_file_edits.id; + +CREATE TABLE analytics_repository_files ( + id bigint NOT NULL, + project_id bigint NOT NULL, + file_path character varying(4096) NOT NULL +); + +CREATE SEQUENCE analytics_repository_files_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE analytics_repository_files_id_seq OWNED BY analytics_repository_files.id; + +CREATE TABLE appearances ( + id integer NOT NULL, + title character varying NOT NULL, + description text NOT NULL, + header_logo character varying, + logo character varying, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + description_html text, + cached_markdown_version integer, + favicon character varying, + new_project_guidelines text, + new_project_guidelines_html text, + header_message text, + header_message_html text, + footer_message text, + footer_message_html text, + message_background_color text, + message_font_color text, + email_header_and_footer_enabled boolean DEFAULT false NOT NULL, + updated_by integer +); + +CREATE SEQUENCE appearances_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE appearances_id_seq OWNED BY appearances.id; + +CREATE TABLE application_setting_terms ( + id integer NOT NULL, + cached_markdown_version integer, + terms text NOT NULL, + terms_html text +); + +CREATE SEQUENCE application_setting_terms_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE application_setting_terms_id_seq OWNED BY application_setting_terms.id; + +CREATE TABLE application_settings ( + id integer NOT NULL, + default_projects_limit integer, + signup_enabled boolean, + gravatar_enabled boolean, + sign_in_text text, + created_at timestamp without time zone, + updated_at timestamp without time zone, + home_page_url character varying, + default_branch_protection integer DEFAULT 2, + restricted_visibility_levels text, + version_check_enabled boolean DEFAULT true, + max_attachment_size integer DEFAULT 10 NOT NULL, + default_project_visibility integer DEFAULT 0 NOT NULL, + default_snippet_visibility integer DEFAULT 0 NOT NULL, + domain_whitelist text, + user_oauth_applications boolean DEFAULT true, + after_sign_out_path character varying, + session_expire_delay integer DEFAULT 10080 NOT NULL, + import_sources text, + help_page_text text, + admin_notification_email character varying, + shared_runners_enabled boolean DEFAULT true NOT NULL, + max_artifacts_size integer DEFAULT 100 NOT NULL, + runners_registration_token character varying, + max_pages_size integer DEFAULT 100 NOT NULL, + require_two_factor_authentication boolean DEFAULT false, + two_factor_grace_period integer DEFAULT 48, + metrics_enabled boolean DEFAULT false, + metrics_host character varying DEFAULT 'localhost'::character varying, + metrics_pool_size integer DEFAULT 16, + metrics_timeout integer DEFAULT 10, + metrics_method_call_threshold integer DEFAULT 10, + recaptcha_enabled boolean DEFAULT false, + metrics_port integer DEFAULT 8089, + akismet_enabled boolean DEFAULT false, + metrics_sample_interval integer DEFAULT 15, + email_author_in_body boolean DEFAULT false, + default_group_visibility integer, + repository_checks_enabled boolean DEFAULT false, + shared_runners_text text, + metrics_packet_size integer DEFAULT 1, + disabled_oauth_sign_in_sources text, + health_check_access_token character varying, + send_user_confirmation_email boolean DEFAULT false, + container_registry_token_expire_delay integer DEFAULT 5, + after_sign_up_text text, + user_default_external boolean DEFAULT false NOT NULL, + repository_storages character varying DEFAULT 'default'::character varying, + enabled_git_access_protocol character varying, + domain_blacklist_enabled boolean DEFAULT false, + domain_blacklist text, + usage_ping_enabled boolean DEFAULT true NOT NULL, + sign_in_text_html text, + help_page_text_html text, + shared_runners_text_html text, + after_sign_up_text_html text, + rsa_key_restriction integer DEFAULT 0 NOT NULL, + dsa_key_restriction integer DEFAULT '-1'::integer NOT NULL, + ecdsa_key_restriction integer DEFAULT 0 NOT NULL, + ed25519_key_restriction integer DEFAULT 0 NOT NULL, + housekeeping_enabled boolean DEFAULT true NOT NULL, + housekeeping_bitmaps_enabled boolean DEFAULT true NOT NULL, + housekeeping_incremental_repack_period integer DEFAULT 10 NOT NULL, + housekeeping_full_repack_period integer DEFAULT 50 NOT NULL, + housekeeping_gc_period integer DEFAULT 200 NOT NULL, + html_emails_enabled boolean DEFAULT true, + plantuml_url character varying, + plantuml_enabled boolean, + terminal_max_session_time integer DEFAULT 0 NOT NULL, + unique_ips_limit_per_user integer, + unique_ips_limit_time_window integer, + unique_ips_limit_enabled boolean DEFAULT false NOT NULL, + default_artifacts_expire_in character varying DEFAULT '0'::character varying NOT NULL, + uuid character varying, + polling_interval_multiplier numeric DEFAULT 1.0 NOT NULL, + cached_markdown_version integer, + prometheus_metrics_enabled boolean DEFAULT true NOT NULL, + authorized_keys_enabled boolean DEFAULT true NOT NULL, + help_page_hide_commercial_content boolean DEFAULT false, + help_page_support_url character varying, + performance_bar_allowed_group_id integer, + hashed_storage_enabled boolean DEFAULT true NOT NULL, + project_export_enabled boolean DEFAULT true NOT NULL, + auto_devops_enabled boolean DEFAULT true NOT NULL, + throttle_unauthenticated_enabled boolean DEFAULT false NOT NULL, + throttle_unauthenticated_requests_per_period integer DEFAULT 3600 NOT NULL, + throttle_unauthenticated_period_in_seconds integer DEFAULT 3600 NOT NULL, + throttle_authenticated_api_enabled boolean DEFAULT false NOT NULL, + throttle_authenticated_api_requests_per_period integer DEFAULT 7200 NOT NULL, + throttle_authenticated_api_period_in_seconds integer DEFAULT 3600 NOT NULL, + throttle_authenticated_web_enabled boolean DEFAULT false NOT NULL, + throttle_authenticated_web_requests_per_period integer DEFAULT 7200 NOT NULL, + throttle_authenticated_web_period_in_seconds integer DEFAULT 3600 NOT NULL, + gitaly_timeout_default integer DEFAULT 55 NOT NULL, + gitaly_timeout_medium integer DEFAULT 30 NOT NULL, + gitaly_timeout_fast integer DEFAULT 10 NOT NULL, + password_authentication_enabled_for_web boolean, + password_authentication_enabled_for_git boolean DEFAULT true NOT NULL, + external_authorization_service_enabled boolean DEFAULT false NOT NULL, + external_authorization_service_url character varying, + external_authorization_service_default_label character varying, + default_project_creation integer DEFAULT 2 NOT NULL, + auto_devops_domain character varying, + pages_domain_verification_enabled boolean DEFAULT true NOT NULL, + user_default_internal_regex character varying, + external_authorization_service_timeout double precision DEFAULT 0.5, + external_auth_client_cert text, + encrypted_external_auth_client_key text, + encrypted_external_auth_client_key_iv character varying, + encrypted_external_auth_client_key_pass character varying, + encrypted_external_auth_client_key_pass_iv character varying, + enforce_terms boolean DEFAULT false, + mirror_available boolean DEFAULT true NOT NULL, + hide_third_party_offers boolean DEFAULT false NOT NULL, + instance_statistics_visibility_private boolean DEFAULT false NOT NULL, + receive_max_input_size integer, + web_ide_clientside_preview_enabled boolean DEFAULT false NOT NULL, + user_show_add_ssh_key_message boolean DEFAULT true NOT NULL, + outbound_local_requests_whitelist character varying(255)[] DEFAULT '{}'::character varying[] NOT NULL, + usage_stats_set_by_user_id integer, + diff_max_patch_bytes integer DEFAULT 102400 NOT NULL, + archive_builds_in_seconds integer, + commit_email_hostname character varying, + first_day_of_week integer DEFAULT 0 NOT NULL, + protected_ci_variables boolean DEFAULT false NOT NULL, + runners_registration_token_encrypted character varying, + local_markdown_version integer DEFAULT 0 NOT NULL, + asset_proxy_enabled boolean DEFAULT false NOT NULL, + asset_proxy_url character varying, + asset_proxy_whitelist text, + encrypted_asset_proxy_secret_key text, + encrypted_asset_proxy_secret_key_iv character varying, + lets_encrypt_notification_email character varying, + lets_encrypt_terms_of_service_accepted boolean DEFAULT false NOT NULL, + help_text text, + elasticsearch_indexing boolean DEFAULT false NOT NULL, + elasticsearch_search boolean DEFAULT false NOT NULL, + shared_runners_minutes integer DEFAULT 0 NOT NULL, + repository_size_limit bigint DEFAULT 0, + elasticsearch_url character varying DEFAULT 'http://localhost:9200'::character varying, + elasticsearch_aws boolean DEFAULT false NOT NULL, + elasticsearch_aws_region character varying DEFAULT 'us-east-1'::character varying, + elasticsearch_aws_access_key character varying, + geo_status_timeout integer DEFAULT 10, + elasticsearch_experimental_indexer boolean, + check_namespace_plan boolean DEFAULT false NOT NULL, + mirror_max_delay integer DEFAULT 300 NOT NULL, + mirror_max_capacity integer DEFAULT 100 NOT NULL, + mirror_capacity_threshold integer DEFAULT 50 NOT NULL, + slack_app_enabled boolean DEFAULT false, + slack_app_id character varying, + allow_group_owners_to_manage_ldap boolean DEFAULT true NOT NULL, + email_additional_text character varying, + file_template_project_id integer, + pseudonymizer_enabled boolean DEFAULT false NOT NULL, + snowplow_enabled boolean DEFAULT false NOT NULL, + snowplow_cookie_domain character varying, + custom_project_templates_group_id integer, + elasticsearch_limit_indexing boolean DEFAULT false NOT NULL, + geo_node_allowed_ips character varying DEFAULT '0.0.0.0/0, ::/0'::character varying, + elasticsearch_shards integer DEFAULT 5 NOT NULL, + elasticsearch_replicas integer DEFAULT 1 NOT NULL, + encrypted_lets_encrypt_private_key text, + encrypted_lets_encrypt_private_key_iv text, + required_instance_ci_template character varying, + dns_rebinding_protection_enabled boolean DEFAULT true NOT NULL, + lock_memberships_to_ldap boolean DEFAULT false NOT NULL, + default_project_deletion_protection boolean DEFAULT false NOT NULL, + time_tracking_limit_to_hours boolean DEFAULT false NOT NULL, + grafana_enabled boolean DEFAULT false NOT NULL, + grafana_url character varying DEFAULT '/-/grafana'::character varying NOT NULL, + raw_blob_request_limit integer DEFAULT 300 NOT NULL, + login_recaptcha_protection_enabled boolean DEFAULT false NOT NULL, + static_objects_external_storage_url character varying(255), + static_objects_external_storage_auth_token character varying(255), + instance_administration_project_id bigint, + allow_local_requests_from_web_hooks_and_services boolean DEFAULT false, + allow_local_requests_from_system_hooks boolean DEFAULT true NOT NULL, + throttle_protected_paths_enabled boolean DEFAULT false NOT NULL, + throttle_protected_paths_requests_per_period integer DEFAULT 10 NOT NULL, + throttle_protected_paths_period_in_seconds integer DEFAULT 60 NOT NULL, + protected_paths character varying(255)[] DEFAULT '{/users/password,/users/sign_in,/api/v3/session.json,/api/v3/session,/api/v4/session.json,/api/v4/session,/users,/users/confirmation,/unsubscribes/,/import/github/personal_access_token,/admin/session}'::character varying[], + snowplow_collector_hostname character varying, + sourcegraph_enabled boolean DEFAULT false NOT NULL, + sourcegraph_url character varying(255), + max_personal_access_token_lifetime integer, + throttle_incident_management_notification_enabled boolean DEFAULT false NOT NULL, + throttle_incident_management_notification_period_in_seconds integer DEFAULT 3600, + throttle_incident_management_notification_per_period integer DEFAULT 3600, + push_event_hooks_limit integer DEFAULT 3 NOT NULL, + productivity_analytics_start_date timestamp with time zone, + push_event_activities_limit integer DEFAULT 3 NOT NULL, + custom_http_clone_url_root character varying(511), + snowplow_iglu_registry_url character varying(255), + deletion_adjourned_period integer DEFAULT 7 NOT NULL, + snowplow_app_id character varying, + eks_integration_enabled boolean DEFAULT false NOT NULL, + eks_account_id character varying(128), + eks_access_key_id character varying(128), + encrypted_eks_secret_access_key_iv character varying(255), + encrypted_eks_secret_access_key text, + license_trial_ends_on date, + sourcegraph_public_only boolean DEFAULT true NOT NULL, + default_ci_config_path character varying(255), + snippet_size_limit bigint DEFAULT 52428800 NOT NULL, + encrypted_akismet_api_key text, + encrypted_akismet_api_key_iv character varying(255), + encrypted_elasticsearch_aws_secret_access_key text, + encrypted_elasticsearch_aws_secret_access_key_iv character varying(255), + encrypted_recaptcha_private_key text, + encrypted_recaptcha_private_key_iv character varying(255), + encrypted_recaptcha_site_key text, + encrypted_recaptcha_site_key_iv character varying(255), + encrypted_slack_app_secret text, + encrypted_slack_app_secret_iv character varying(255), + encrypted_slack_app_verification_token text, + encrypted_slack_app_verification_token_iv character varying(255), + minimum_password_length integer DEFAULT 8 NOT NULL, + updating_name_disabled_for_users boolean DEFAULT false NOT NULL, + force_pages_access_control boolean DEFAULT false NOT NULL, + CONSTRAINT check_b4f67a6296 CHECK ((allow_local_requests_from_web_hooks_and_services IS NOT NULL)) +); + +CREATE SEQUENCE application_settings_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE application_settings_id_seq OWNED BY application_settings.id; + +CREATE TABLE approval_merge_request_rule_sources ( + id bigint NOT NULL, + approval_merge_request_rule_id bigint NOT NULL, + approval_project_rule_id bigint NOT NULL +); + +CREATE SEQUENCE approval_merge_request_rule_sources_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE approval_merge_request_rule_sources_id_seq OWNED BY approval_merge_request_rule_sources.id; + +CREATE TABLE approval_merge_request_rules ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + merge_request_id integer NOT NULL, + approvals_required smallint DEFAULT 0 NOT NULL, + code_owner boolean DEFAULT false NOT NULL, + name character varying NOT NULL, + rule_type smallint DEFAULT 1 NOT NULL, + report_type smallint +); + +CREATE TABLE approval_merge_request_rules_approved_approvers ( + id bigint NOT NULL, + approval_merge_request_rule_id bigint NOT NULL, + user_id integer NOT NULL +); + +CREATE SEQUENCE approval_merge_request_rules_approved_approvers_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE approval_merge_request_rules_approved_approvers_id_seq OWNED BY approval_merge_request_rules_approved_approvers.id; + +CREATE TABLE approval_merge_request_rules_groups ( + id bigint NOT NULL, + approval_merge_request_rule_id bigint NOT NULL, + group_id integer NOT NULL +); + +CREATE SEQUENCE approval_merge_request_rules_groups_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE approval_merge_request_rules_groups_id_seq OWNED BY approval_merge_request_rules_groups.id; + +CREATE SEQUENCE approval_merge_request_rules_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE approval_merge_request_rules_id_seq OWNED BY approval_merge_request_rules.id; + +CREATE TABLE approval_merge_request_rules_users ( + id bigint NOT NULL, + approval_merge_request_rule_id bigint NOT NULL, + user_id integer NOT NULL +); + +CREATE SEQUENCE approval_merge_request_rules_users_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE approval_merge_request_rules_users_id_seq OWNED BY approval_merge_request_rules_users.id; + +CREATE TABLE approval_project_rules ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id integer NOT NULL, + approvals_required smallint DEFAULT 0 NOT NULL, + name character varying NOT NULL, + rule_type smallint DEFAULT 0 NOT NULL +); + +CREATE TABLE approval_project_rules_groups ( + id bigint NOT NULL, + approval_project_rule_id bigint NOT NULL, + group_id integer NOT NULL +); + +CREATE SEQUENCE approval_project_rules_groups_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE approval_project_rules_groups_id_seq OWNED BY approval_project_rules_groups.id; + +CREATE SEQUENCE approval_project_rules_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE approval_project_rules_id_seq OWNED BY approval_project_rules.id; + +CREATE TABLE approval_project_rules_users ( + id bigint NOT NULL, + approval_project_rule_id bigint NOT NULL, + user_id integer NOT NULL +); + +CREATE SEQUENCE approval_project_rules_users_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE approval_project_rules_users_id_seq OWNED BY approval_project_rules_users.id; + +CREATE TABLE approvals ( + id integer NOT NULL, + merge_request_id integer NOT NULL, + user_id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone +); + +CREATE SEQUENCE approvals_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE approvals_id_seq OWNED BY approvals.id; + +CREATE TABLE approver_groups ( + id integer NOT NULL, + target_id integer NOT NULL, + target_type character varying NOT NULL, + group_id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone +); + +CREATE SEQUENCE approver_groups_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE approver_groups_id_seq OWNED BY approver_groups.id; + +CREATE TABLE approvers ( + id integer NOT NULL, + target_id integer NOT NULL, + target_type character varying, + user_id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone +); + +CREATE SEQUENCE approvers_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE approvers_id_seq OWNED BY approvers.id; + +CREATE TABLE audit_events ( + id integer NOT NULL, + author_id integer NOT NULL, + type character varying NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + created_at timestamp without time zone, + updated_at timestamp without time zone +); + +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 award_emoji ( + id integer NOT NULL, + name character varying, + user_id integer, + awardable_type character varying, + awardable_id integer, + created_at timestamp without time zone, + updated_at timestamp without time zone +); + +CREATE SEQUENCE award_emoji_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE award_emoji_id_seq OWNED BY award_emoji.id; + +CREATE TABLE aws_roles ( + user_id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + role_arn character varying(2048) NOT NULL, + role_external_id character varying(64) NOT NULL +); + +CREATE TABLE badges ( + id integer NOT NULL, + link_url character varying NOT NULL, + image_url character varying NOT NULL, + project_id integer, + group_id integer, + type character varying NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + name character varying(255) +); + +CREATE SEQUENCE badges_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE badges_id_seq OWNED BY badges.id; + +CREATE TABLE board_assignees ( + id integer NOT NULL, + board_id integer NOT NULL, + assignee_id integer NOT NULL +); + +CREATE SEQUENCE board_assignees_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE board_assignees_id_seq OWNED BY board_assignees.id; + +CREATE TABLE board_group_recent_visits ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + user_id integer, + board_id integer, + group_id integer +); + +CREATE SEQUENCE board_group_recent_visits_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE board_group_recent_visits_id_seq OWNED BY board_group_recent_visits.id; + +CREATE TABLE board_labels ( + id integer NOT NULL, + board_id integer NOT NULL, + label_id integer NOT NULL +); + +CREATE SEQUENCE board_labels_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE board_labels_id_seq OWNED BY board_labels.id; + +CREATE TABLE board_project_recent_visits ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + user_id integer, + project_id integer, + board_id integer +); + +CREATE SEQUENCE board_project_recent_visits_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE board_project_recent_visits_id_seq OWNED BY board_project_recent_visits.id; + +CREATE TABLE boards ( + id integer NOT NULL, + project_id integer, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + group_id integer, + milestone_id integer, + weight integer, + name character varying DEFAULT 'Development'::character varying NOT NULL +); + +CREATE SEQUENCE boards_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE boards_id_seq OWNED BY boards.id; + +CREATE TABLE broadcast_messages ( + id integer NOT NULL, + message text NOT NULL, + starts_at timestamp without time zone NOT NULL, + ends_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + color character varying, + font character varying, + message_html text NOT NULL, + cached_markdown_version integer, + dismissable boolean, + target_path character varying(255), + broadcast_type smallint DEFAULT 1 NOT NULL +); + +CREATE SEQUENCE broadcast_messages_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE broadcast_messages_id_seq OWNED BY broadcast_messages.id; + +CREATE TABLE chat_names ( + id integer NOT NULL, + user_id integer NOT NULL, + service_id integer NOT NULL, + team_id character varying NOT NULL, + team_domain character varying, + chat_id character varying NOT NULL, + chat_name character varying, + last_used_at timestamp without time zone, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE chat_names_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE chat_names_id_seq OWNED BY chat_names.id; + +CREATE TABLE chat_teams ( + id integer NOT NULL, + namespace_id integer NOT NULL, + team_id character varying, + name character varying, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE chat_teams_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE chat_teams_id_seq OWNED BY chat_teams.id; + +CREATE TABLE ci_build_needs ( + id integer NOT NULL, + build_id integer NOT NULL, + name text NOT NULL, + artifacts boolean DEFAULT true NOT NULL +); + +CREATE SEQUENCE ci_build_needs_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_build_needs_id_seq OWNED BY ci_build_needs.id; + +CREATE TABLE ci_build_trace_chunks ( + id bigint NOT NULL, + build_id integer NOT NULL, + chunk_index integer NOT NULL, + data_store integer NOT NULL, + raw_data bytea +); + +CREATE SEQUENCE ci_build_trace_chunks_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_build_trace_chunks_id_seq OWNED BY ci_build_trace_chunks.id; + +CREATE TABLE ci_build_trace_section_names ( + id integer NOT NULL, + project_id integer NOT NULL, + name character varying NOT NULL +); + +CREATE SEQUENCE ci_build_trace_section_names_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_build_trace_section_names_id_seq OWNED BY ci_build_trace_section_names.id; + +CREATE TABLE ci_build_trace_sections ( + project_id integer NOT NULL, + date_start timestamp with time zone NOT NULL, + date_end timestamp with time zone NOT NULL, + byte_start bigint NOT NULL, + byte_end bigint NOT NULL, + build_id integer NOT NULL, + section_name_id integer NOT NULL +); + +CREATE TABLE ci_builds ( + id integer NOT NULL, + status character varying, + finished_at timestamp without time zone, + trace text, + created_at timestamp without time zone, + updated_at timestamp without time zone, + started_at timestamp without time zone, + runner_id integer, + coverage double precision, + commit_id integer, + commands text, + name character varying, + options text, + allow_failure boolean DEFAULT false NOT NULL, + stage character varying, + trigger_request_id integer, + stage_idx integer, + tag boolean, + ref character varying, + user_id integer, + type character varying, + target_url character varying, + description character varying, + artifacts_file text, + project_id integer, + artifacts_metadata text, + erased_by_id integer, + erased_at timestamp without time zone, + artifacts_expire_at timestamp without time zone, + environment character varying, + artifacts_size bigint, + "when" character varying, + yaml_variables text, + queued_at timestamp without time zone, + token character varying, + lock_version integer, + coverage_regex character varying, + auto_canceled_by_id integer, + retried boolean, + stage_id integer, + artifacts_file_store integer, + artifacts_metadata_store integer, + protected boolean, + failure_reason integer, + scheduled_at timestamp with time zone, + token_encrypted character varying, + upstream_pipeline_id integer, + processed boolean, + resource_group_id bigint, + waiting_for_resource_at timestamp with time zone, + scheduling_type smallint +); + +CREATE SEQUENCE ci_builds_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_builds_id_seq OWNED BY ci_builds.id; + +CREATE TABLE ci_builds_metadata ( + id integer NOT NULL, + build_id integer NOT NULL, + project_id integer NOT NULL, + timeout integer, + timeout_source integer DEFAULT 1 NOT NULL, + config_options jsonb, + config_variables jsonb, + interruptible boolean, + has_exposed_artifacts boolean, + environment_auto_stop_in character varying(255) +); + +CREATE SEQUENCE ci_builds_metadata_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_builds_metadata_id_seq OWNED BY ci_builds_metadata.id; + +CREATE TABLE ci_builds_runner_session ( + id bigint NOT NULL, + build_id integer NOT NULL, + url character varying NOT NULL, + certificate character varying, + "authorization" character varying +); + +CREATE SEQUENCE ci_builds_runner_session_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_builds_runner_session_id_seq OWNED BY ci_builds_runner_session.id; + +CREATE TABLE ci_group_variables ( + id integer NOT NULL, + key character varying NOT NULL, + value text, + encrypted_value text, + encrypted_value_salt character varying, + encrypted_value_iv character varying, + group_id integer NOT NULL, + protected boolean DEFAULT false NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + masked boolean DEFAULT false NOT NULL, + variable_type smallint DEFAULT 1 NOT NULL +); + +CREATE SEQUENCE ci_group_variables_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_group_variables_id_seq OWNED BY ci_group_variables.id; + +CREATE TABLE ci_job_artifacts ( + id integer NOT NULL, + project_id integer NOT NULL, + job_id integer NOT NULL, + file_type integer NOT NULL, + size bigint, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + expire_at timestamp with time zone, + file character varying, + file_store integer, + file_sha256 bytea, + file_format smallint, + file_location smallint +); + +CREATE SEQUENCE ci_job_artifacts_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_job_artifacts_id_seq OWNED BY ci_job_artifacts.id; + +CREATE TABLE ci_job_variables ( + id bigint NOT NULL, + key character varying NOT NULL, + encrypted_value text, + encrypted_value_iv character varying, + job_id bigint NOT NULL, + variable_type smallint DEFAULT 1 NOT NULL +); + +CREATE SEQUENCE ci_job_variables_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_job_variables_id_seq OWNED BY ci_job_variables.id; + +CREATE TABLE ci_pipeline_chat_data ( + id bigint NOT NULL, + pipeline_id integer NOT NULL, + chat_name_id integer NOT NULL, + response_url text NOT NULL +); + +CREATE SEQUENCE ci_pipeline_chat_data_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_pipeline_chat_data_id_seq OWNED BY ci_pipeline_chat_data.id; + +CREATE TABLE ci_pipeline_schedule_variables ( + id integer NOT NULL, + key character varying NOT NULL, + value text, + encrypted_value text, + encrypted_value_salt character varying, + encrypted_value_iv character varying, + pipeline_schedule_id integer NOT NULL, + created_at timestamp with time zone, + updated_at timestamp with time zone, + variable_type smallint DEFAULT 1 NOT NULL +); + +CREATE SEQUENCE ci_pipeline_schedule_variables_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_pipeline_schedule_variables_id_seq OWNED BY ci_pipeline_schedule_variables.id; + +CREATE TABLE ci_pipeline_schedules ( + id integer NOT NULL, + description character varying, + ref character varying, + cron character varying, + cron_timezone character varying, + next_run_at timestamp without time zone, + project_id integer, + owner_id integer, + active boolean DEFAULT true, + created_at timestamp without time zone, + updated_at timestamp without time zone +); + +CREATE SEQUENCE ci_pipeline_schedules_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_pipeline_schedules_id_seq OWNED BY ci_pipeline_schedules.id; + +CREATE TABLE ci_pipeline_variables ( + id integer NOT NULL, + key character varying NOT NULL, + value text, + encrypted_value text, + encrypted_value_salt character varying, + encrypted_value_iv character varying, + pipeline_id integer NOT NULL, + variable_type smallint DEFAULT 1 NOT NULL +); + +CREATE SEQUENCE ci_pipeline_variables_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_pipeline_variables_id_seq OWNED BY ci_pipeline_variables.id; + +CREATE TABLE ci_pipelines ( + id integer NOT NULL, + ref character varying, + sha character varying, + before_sha character varying, + created_at timestamp without time zone, + updated_at timestamp without time zone, + tag boolean DEFAULT false, + yaml_errors text, + committed_at timestamp without time zone, + project_id integer, + status character varying, + started_at timestamp without time zone, + finished_at timestamp without time zone, + duration integer, + user_id integer, + lock_version integer, + auto_canceled_by_id integer, + pipeline_schedule_id integer, + source integer, + protected boolean, + config_source integer, + failure_reason integer, + iid integer, + merge_request_id integer, + source_sha bytea, + target_sha bytea, + external_pull_request_id bigint +); + +CREATE TABLE ci_pipelines_config ( + pipeline_id bigint NOT NULL, + content text NOT NULL +); + +CREATE SEQUENCE ci_pipelines_config_pipeline_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_pipelines_config_pipeline_id_seq OWNED BY ci_pipelines_config.pipeline_id; + +CREATE SEQUENCE ci_pipelines_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_pipelines_id_seq OWNED BY ci_pipelines.id; + +CREATE TABLE ci_refs ( + id bigint NOT NULL, + project_id integer NOT NULL, + lock_version integer DEFAULT 0, + last_updated_by_pipeline_id integer, + tag boolean DEFAULT false NOT NULL, + ref character varying(255) NOT NULL, + status character varying(255) NOT NULL +); + +CREATE SEQUENCE ci_refs_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_refs_id_seq OWNED BY ci_refs.id; + +CREATE TABLE ci_resource_groups ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id bigint NOT NULL, + key character varying(255) NOT NULL +); + +CREATE SEQUENCE ci_resource_groups_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_resource_groups_id_seq OWNED BY ci_resource_groups.id; + +CREATE TABLE ci_resources ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + resource_group_id bigint NOT NULL, + build_id bigint +); + +CREATE SEQUENCE ci_resources_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_resources_id_seq OWNED BY ci_resources.id; + +CREATE TABLE ci_runner_namespaces ( + id integer NOT NULL, + runner_id integer, + namespace_id integer +); + +CREATE SEQUENCE ci_runner_namespaces_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_runner_namespaces_id_seq OWNED BY ci_runner_namespaces.id; + +CREATE TABLE ci_runner_projects ( + id integer NOT NULL, + runner_id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + project_id integer +); + +CREATE SEQUENCE ci_runner_projects_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_runner_projects_id_seq OWNED BY ci_runner_projects.id; + +CREATE TABLE ci_runners ( + id integer NOT NULL, + token character varying, + created_at timestamp without time zone, + updated_at timestamp without time zone, + description character varying, + contacted_at timestamp without time zone, + active boolean DEFAULT true NOT NULL, + is_shared boolean DEFAULT false, + name character varying, + version character varying, + revision character varying, + platform character varying, + architecture character varying, + run_untagged boolean DEFAULT true NOT NULL, + locked boolean DEFAULT false NOT NULL, + access_level integer DEFAULT 0 NOT NULL, + maximum_timeout integer, + ip_address character varying, + runner_type smallint NOT NULL, + token_encrypted character varying +); + +CREATE SEQUENCE ci_runners_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_runners_id_seq OWNED BY ci_runners.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 +); + +CREATE SEQUENCE ci_sources_pipelines_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_sources_pipelines_id_seq OWNED BY ci_sources_pipelines.id; + +CREATE TABLE ci_stages ( + id integer NOT NULL, + project_id integer, + pipeline_id integer, + created_at timestamp without time zone, + updated_at timestamp without time zone, + name character varying, + status integer, + lock_version integer, + "position" integer +); + +CREATE SEQUENCE ci_stages_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_stages_id_seq OWNED BY ci_stages.id; + +CREATE TABLE ci_subscriptions_projects ( + id bigint NOT NULL, + downstream_project_id bigint NOT NULL, + upstream_project_id bigint NOT NULL +); + +CREATE SEQUENCE ci_subscriptions_projects_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_subscriptions_projects_id_seq OWNED BY ci_subscriptions_projects.id; + +CREATE TABLE ci_trigger_requests ( + id integer NOT NULL, + trigger_id integer NOT NULL, + variables text, + created_at timestamp without time zone, + updated_at timestamp without time zone, + commit_id integer +); + +CREATE SEQUENCE ci_trigger_requests_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_trigger_requests_id_seq OWNED BY ci_trigger_requests.id; + +CREATE TABLE ci_triggers ( + id integer NOT NULL, + token character varying, + created_at timestamp without time zone, + updated_at timestamp without time zone, + project_id integer, + owner_id integer NOT NULL, + description character varying, + ref character varying +); + +CREATE SEQUENCE ci_triggers_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_triggers_id_seq OWNED BY ci_triggers.id; + +CREATE TABLE ci_variables ( + id integer NOT NULL, + key character varying NOT NULL, + value text, + encrypted_value text, + encrypted_value_salt character varying, + encrypted_value_iv character varying, + project_id integer NOT NULL, + protected boolean DEFAULT false NOT NULL, + environment_scope character varying DEFAULT '*'::character varying NOT NULL, + masked boolean DEFAULT false NOT NULL, + variable_type smallint DEFAULT 1 NOT NULL +); + +CREATE SEQUENCE ci_variables_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_variables_id_seq OWNED BY ci_variables.id; + +CREATE TABLE cluster_groups ( + id integer NOT NULL, + cluster_id integer NOT NULL, + group_id integer NOT NULL +); + +CREATE SEQUENCE cluster_groups_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE cluster_groups_id_seq OWNED BY cluster_groups.id; + +CREATE TABLE cluster_platforms_kubernetes ( + id integer NOT NULL, + cluster_id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + api_url text, + ca_cert text, + namespace character varying, + username character varying, + encrypted_password text, + encrypted_password_iv character varying, + encrypted_token text, + encrypted_token_iv character varying, + authorization_type smallint +); + +CREATE SEQUENCE cluster_platforms_kubernetes_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE cluster_platforms_kubernetes_id_seq OWNED BY cluster_platforms_kubernetes.id; + +CREATE TABLE cluster_projects ( + id integer NOT NULL, + project_id integer NOT NULL, + cluster_id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE cluster_projects_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE cluster_projects_id_seq OWNED BY cluster_projects.id; + +CREATE TABLE cluster_providers_aws ( + id bigint NOT NULL, + cluster_id bigint NOT NULL, + created_by_user_id integer, + num_nodes integer NOT NULL, + status integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + key_name character varying(255) NOT NULL, + role_arn character varying(2048) NOT NULL, + region character varying(255) NOT NULL, + vpc_id character varying(255) NOT NULL, + subnet_ids character varying(255)[] DEFAULT '{}'::character varying[] NOT NULL, + security_group_id character varying(255) NOT NULL, + instance_type character varying(255) NOT NULL, + access_key_id character varying(255), + encrypted_secret_access_key_iv character varying(255), + encrypted_secret_access_key text, + session_token text, + status_reason text +); + +CREATE SEQUENCE cluster_providers_aws_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE cluster_providers_aws_id_seq OWNED BY cluster_providers_aws.id; + +CREATE TABLE cluster_providers_gcp ( + id integer NOT NULL, + cluster_id integer NOT NULL, + status integer, + num_nodes integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + status_reason text, + gcp_project_id character varying NOT NULL, + zone character varying NOT NULL, + machine_type character varying, + operation_id character varying, + endpoint character varying, + encrypted_access_token text, + encrypted_access_token_iv character varying, + legacy_abac boolean DEFAULT false NOT NULL, + cloud_run boolean DEFAULT false NOT NULL +); + +CREATE SEQUENCE cluster_providers_gcp_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE cluster_providers_gcp_id_seq OWNED BY cluster_providers_gcp.id; + +CREATE TABLE clusters ( + id integer NOT NULL, + user_id integer, + provider_type integer, + platform_type integer, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + enabled boolean DEFAULT true, + name character varying NOT NULL, + environment_scope character varying DEFAULT '*'::character varying NOT NULL, + cluster_type smallint DEFAULT 3 NOT NULL, + domain character varying, + managed boolean DEFAULT true NOT NULL, + namespace_per_environment boolean DEFAULT true NOT NULL, + cleanup_status smallint DEFAULT 1 NOT NULL, + cleanup_status_reason text, + management_project_id integer +); + +CREATE TABLE clusters_applications_cert_managers ( + id integer NOT NULL, + cluster_id integer NOT NULL, + status integer NOT NULL, + version character varying NOT NULL, + email character varying NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + status_reason text +); + +CREATE SEQUENCE clusters_applications_cert_managers_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE clusters_applications_cert_managers_id_seq OWNED BY clusters_applications_cert_managers.id; + +CREATE TABLE clusters_applications_crossplane ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + cluster_id bigint NOT NULL, + status integer NOT NULL, + version character varying(255) NOT NULL, + stack character varying(255) NOT NULL, + status_reason text +); + +CREATE SEQUENCE clusters_applications_crossplane_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE clusters_applications_crossplane_id_seq OWNED BY clusters_applications_crossplane.id; + +CREATE TABLE clusters_applications_elastic_stacks ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + cluster_id bigint NOT NULL, + status integer NOT NULL, + version character varying(255) NOT NULL, + kibana_hostname character varying(255), + status_reason text +); + +CREATE SEQUENCE clusters_applications_elastic_stacks_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE clusters_applications_elastic_stacks_id_seq OWNED BY clusters_applications_elastic_stacks.id; + +CREATE TABLE clusters_applications_helm ( + id integer NOT NULL, + cluster_id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + status integer NOT NULL, + version character varying NOT NULL, + status_reason text, + encrypted_ca_key text, + encrypted_ca_key_iv text, + ca_cert text +); + +CREATE SEQUENCE clusters_applications_helm_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE clusters_applications_helm_id_seq OWNED BY clusters_applications_helm.id; + +CREATE TABLE clusters_applications_ingress ( + id integer NOT NULL, + cluster_id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + status integer NOT NULL, + ingress_type integer NOT NULL, + version character varying NOT NULL, + cluster_ip character varying, + status_reason text, + external_ip character varying, + external_hostname character varying, + modsecurity_enabled boolean +); + +CREATE SEQUENCE clusters_applications_ingress_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE clusters_applications_ingress_id_seq OWNED BY clusters_applications_ingress.id; + +CREATE TABLE clusters_applications_jupyter ( + id integer NOT NULL, + cluster_id integer NOT NULL, + oauth_application_id integer, + status integer NOT NULL, + version character varying NOT NULL, + hostname character varying, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + status_reason text +); + +CREATE SEQUENCE clusters_applications_jupyter_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE clusters_applications_jupyter_id_seq OWNED BY clusters_applications_jupyter.id; + +CREATE TABLE clusters_applications_knative ( + id integer NOT NULL, + cluster_id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + status integer NOT NULL, + version character varying NOT NULL, + hostname character varying, + status_reason text, + external_ip character varying, + external_hostname character varying +); + +CREATE SEQUENCE clusters_applications_knative_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE clusters_applications_knative_id_seq OWNED BY clusters_applications_knative.id; + +CREATE TABLE clusters_applications_prometheus ( + id integer NOT NULL, + cluster_id integer NOT NULL, + status integer NOT NULL, + version character varying NOT NULL, + status_reason text, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + encrypted_alert_manager_token character varying, + encrypted_alert_manager_token_iv character varying, + last_update_started_at timestamp with time zone +); + +CREATE SEQUENCE clusters_applications_prometheus_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE clusters_applications_prometheus_id_seq OWNED BY clusters_applications_prometheus.id; + +CREATE TABLE clusters_applications_runners ( + id integer NOT NULL, + cluster_id integer NOT NULL, + runner_id integer, + status integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + version character varying NOT NULL, + status_reason text, + privileged boolean DEFAULT true NOT NULL +); + +CREATE SEQUENCE clusters_applications_runners_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE clusters_applications_runners_id_seq OWNED BY clusters_applications_runners.id; + +CREATE SEQUENCE clusters_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE clusters_id_seq OWNED BY clusters.id; + +CREATE TABLE clusters_kubernetes_namespaces ( + id bigint NOT NULL, + cluster_id integer NOT NULL, + project_id integer, + cluster_project_id integer, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + encrypted_service_account_token_iv character varying, + namespace character varying NOT NULL, + service_account_name character varying, + encrypted_service_account_token text, + environment_id bigint +); + +CREATE SEQUENCE clusters_kubernetes_namespaces_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE clusters_kubernetes_namespaces_id_seq OWNED BY clusters_kubernetes_namespaces.id; + +CREATE TABLE commit_user_mentions ( + id bigint NOT NULL, + note_id integer NOT NULL, + mentioned_users_ids integer[], + mentioned_projects_ids integer[], + mentioned_groups_ids integer[], + commit_id character varying, + CONSTRAINT check_724d773807 CHECK ((commit_id IS NOT NULL)) +); + +CREATE SEQUENCE commit_user_mentions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE commit_user_mentions_id_seq OWNED BY commit_user_mentions.id; + +CREATE TABLE container_expiration_policies ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + next_run_at timestamp with time zone, + project_id bigint NOT NULL, + name_regex character varying(255), + cadence character varying(12) DEFAULT '7d'::character varying NOT NULL, + older_than character varying(12), + keep_n integer, + enabled boolean DEFAULT false NOT NULL +); + +CREATE TABLE container_repositories ( + id integer NOT NULL, + project_id integer NOT NULL, + name character varying NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE container_repositories_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE container_repositories_id_seq OWNED BY container_repositories.id; + +CREATE TABLE conversational_development_index_metrics ( + id integer NOT NULL, + leader_issues double precision NOT NULL, + instance_issues double precision NOT NULL, + leader_notes double precision NOT NULL, + instance_notes double precision NOT NULL, + leader_milestones double precision NOT NULL, + instance_milestones double precision NOT NULL, + leader_boards double precision NOT NULL, + instance_boards double precision NOT NULL, + leader_merge_requests double precision NOT NULL, + instance_merge_requests double precision NOT NULL, + leader_ci_pipelines double precision NOT NULL, + instance_ci_pipelines double precision NOT NULL, + leader_environments double precision NOT NULL, + instance_environments double precision NOT NULL, + leader_deployments double precision NOT NULL, + instance_deployments double precision NOT NULL, + leader_projects_prometheus_active double precision NOT NULL, + instance_projects_prometheus_active double precision NOT NULL, + leader_service_desk_issues double precision NOT NULL, + instance_service_desk_issues double precision NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + percentage_boards double precision DEFAULT 0.0 NOT NULL, + percentage_ci_pipelines double precision DEFAULT 0.0 NOT NULL, + percentage_deployments double precision DEFAULT 0.0 NOT NULL, + percentage_environments double precision DEFAULT 0.0 NOT NULL, + percentage_issues double precision DEFAULT 0.0 NOT NULL, + percentage_merge_requests double precision DEFAULT 0.0 NOT NULL, + percentage_milestones double precision DEFAULT 0.0 NOT NULL, + percentage_notes double precision DEFAULT 0.0 NOT NULL, + percentage_projects_prometheus_active double precision DEFAULT 0.0 NOT NULL, + percentage_service_desk_issues double precision DEFAULT 0.0 NOT NULL +); + +CREATE SEQUENCE conversational_development_index_metrics_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE conversational_development_index_metrics_id_seq OWNED BY conversational_development_index_metrics.id; + +CREATE TABLE dependency_proxy_blobs ( + id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + file text NOT NULL, + file_name character varying NOT NULL, + file_store integer, + group_id integer NOT NULL, + size bigint, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE dependency_proxy_blobs_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE dependency_proxy_blobs_id_seq OWNED BY dependency_proxy_blobs.id; + +CREATE TABLE dependency_proxy_group_settings ( + id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + enabled boolean DEFAULT false NOT NULL, + group_id integer NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE dependency_proxy_group_settings_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE dependency_proxy_group_settings_id_seq OWNED BY dependency_proxy_group_settings.id; + +CREATE TABLE deploy_keys_projects ( + id integer NOT NULL, + deploy_key_id integer NOT NULL, + project_id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + can_push boolean DEFAULT false NOT NULL +); + +CREATE SEQUENCE deploy_keys_projects_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE deploy_keys_projects_id_seq OWNED BY deploy_keys_projects.id; + +CREATE TABLE deploy_tokens ( + id integer NOT NULL, + revoked boolean DEFAULT false, + read_repository boolean DEFAULT false NOT NULL, + read_registry boolean DEFAULT false NOT NULL, + expires_at timestamp with time zone NOT NULL, + created_at timestamp with time zone NOT NULL, + name character varying NOT NULL, + token character varying, + username character varying, + token_encrypted character varying(255) +); + +CREATE SEQUENCE deploy_tokens_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE deploy_tokens_id_seq OWNED BY deploy_tokens.id; + +CREATE TABLE deployment_merge_requests ( + deployment_id integer NOT NULL, + merge_request_id integer NOT NULL +); + +CREATE TABLE deployments ( + id integer NOT NULL, + iid integer NOT NULL, + project_id integer NOT NULL, + environment_id integer NOT NULL, + ref character varying NOT NULL, + tag boolean NOT NULL, + sha character varying NOT NULL, + user_id integer, + deployable_id integer, + deployable_type character varying, + created_at timestamp without time zone, + updated_at timestamp without time zone, + on_stop character varying, + finished_at timestamp with time zone, + status smallint NOT NULL, + cluster_id integer +); + +CREATE SEQUENCE deployments_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE deployments_id_seq OWNED BY deployments.id; + +CREATE TABLE description_versions ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + issue_id integer, + merge_request_id integer, + epic_id integer, + description text, + deleted_at timestamp with time zone +); + +CREATE SEQUENCE description_versions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE description_versions_id_seq OWNED BY description_versions.id; + +CREATE TABLE design_management_designs ( + id bigint NOT NULL, + project_id integer NOT NULL, + issue_id integer, + filename character varying NOT NULL +); + +CREATE SEQUENCE design_management_designs_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE design_management_designs_id_seq OWNED BY design_management_designs.id; + +CREATE TABLE design_management_designs_versions ( + design_id bigint NOT NULL, + version_id bigint NOT NULL, + event smallint DEFAULT 0 NOT NULL, + image_v432x230 character varying(255) +); + +CREATE TABLE design_management_versions ( + id bigint NOT NULL, + sha bytea NOT NULL, + issue_id bigint, + created_at timestamp with time zone NOT NULL, + author_id integer +); + +CREATE SEQUENCE design_management_versions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE design_management_versions_id_seq OWNED BY design_management_versions.id; + +CREATE TABLE design_user_mentions ( + id bigint NOT NULL, + design_id integer NOT NULL, + note_id integer NOT NULL, + mentioned_users_ids integer[], + mentioned_projects_ids integer[], + mentioned_groups_ids integer[] +); + +CREATE SEQUENCE design_user_mentions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE design_user_mentions_id_seq OWNED BY design_user_mentions.id; + +CREATE TABLE draft_notes ( + id bigint NOT NULL, + merge_request_id integer NOT NULL, + author_id integer NOT NULL, + resolve_discussion boolean DEFAULT false NOT NULL, + discussion_id character varying, + note text NOT NULL, + "position" text, + original_position text, + change_position text, + commit_id bytea +); + +CREATE SEQUENCE draft_notes_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE draft_notes_id_seq OWNED BY draft_notes.id; + +CREATE TABLE elasticsearch_indexed_namespaces ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + namespace_id integer +); + +CREATE TABLE elasticsearch_indexed_projects ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id integer +); + +CREATE TABLE emails ( + id integer NOT NULL, + user_id integer NOT NULL, + email character varying NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + confirmation_token character varying, + confirmed_at timestamp with time zone, + confirmation_sent_at timestamp with time zone +); + +CREATE SEQUENCE emails_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE emails_id_seq OWNED BY emails.id; + +CREATE TABLE environments ( + id integer NOT NULL, + project_id integer NOT NULL, + name character varying NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + external_url character varying, + environment_type character varying, + state character varying DEFAULT 'available'::character varying NOT NULL, + slug character varying NOT NULL, + auto_stop_at timestamp with time zone +); + +CREATE SEQUENCE environments_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE environments_id_seq OWNED BY environments.id; + +CREATE TABLE epic_issues ( + id integer NOT NULL, + epic_id integer NOT NULL, + issue_id integer NOT NULL, + relative_position integer +); + +CREATE SEQUENCE epic_issues_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE epic_issues_id_seq OWNED BY epic_issues.id; + +CREATE TABLE epic_metrics ( + id integer NOT NULL, + epic_id integer NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE epic_metrics_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE epic_metrics_id_seq OWNED BY epic_metrics.id; + +CREATE TABLE epic_user_mentions ( + id bigint NOT NULL, + epic_id integer NOT NULL, + note_id integer, + mentioned_users_ids integer[], + mentioned_projects_ids integer[], + mentioned_groups_ids integer[] +); + +CREATE SEQUENCE epic_user_mentions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE epic_user_mentions_id_seq OWNED BY epic_user_mentions.id; + +CREATE TABLE epics ( + id integer NOT NULL, + group_id integer NOT NULL, + author_id integer NOT NULL, + assignee_id integer, + iid integer NOT NULL, + cached_markdown_version integer, + updated_by_id integer, + last_edited_by_id integer, + lock_version integer, + start_date date, + end_date date, + last_edited_at timestamp without time zone, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + title character varying NOT NULL, + title_html character varying NOT NULL, + description text, + description_html text, + start_date_sourcing_milestone_id integer, + due_date_sourcing_milestone_id integer, + start_date_fixed date, + due_date_fixed date, + start_date_is_fixed boolean, + due_date_is_fixed boolean, + closed_by_id integer, + closed_at timestamp without time zone, + parent_id integer, + relative_position integer, + start_date_sourcing_epic_id integer, + due_date_sourcing_epic_id integer, + state_id smallint DEFAULT 1, + CONSTRAINT check_57ee003890 CHECK ((state_id IS NOT NULL)) +); + +CREATE SEQUENCE epics_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE epics_id_seq OWNED BY epics.id; + +CREATE TABLE events ( + id integer NOT NULL, + project_id integer, + author_id integer NOT NULL, + target_id integer, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + action smallint NOT NULL, + target_type character varying, + group_id bigint +); + +CREATE SEQUENCE events_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE events_id_seq OWNED BY events.id; + +CREATE TABLE evidences ( + id bigint NOT NULL, + release_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + summary_sha bytea, + summary jsonb DEFAULT '{}'::jsonb NOT NULL +); + +CREATE SEQUENCE evidences_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE evidences_id_seq OWNED BY evidences.id; + +CREATE TABLE external_pull_requests ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id bigint NOT NULL, + pull_request_iid integer NOT NULL, + status smallint NOT NULL, + source_branch character varying(255) NOT NULL, + target_branch character varying(255) NOT NULL, + source_repository character varying(255) NOT NULL, + target_repository character varying(255) NOT NULL, + source_sha bytea NOT NULL, + target_sha bytea NOT NULL +); + +CREATE SEQUENCE external_pull_requests_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE external_pull_requests_id_seq OWNED BY external_pull_requests.id; + +CREATE TABLE feature_gates ( + id integer NOT NULL, + feature_key character varying NOT NULL, + key character varying NOT NULL, + value character varying, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE feature_gates_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE feature_gates_id_seq OWNED BY feature_gates.id; + +CREATE TABLE features ( + id integer NOT NULL, + key character varying NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE features_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE features_id_seq OWNED BY features.id; + +CREATE TABLE fork_network_members ( + id integer NOT NULL, + fork_network_id integer NOT NULL, + project_id integer NOT NULL, + forked_from_project_id integer +); + +CREATE SEQUENCE fork_network_members_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE fork_network_members_id_seq OWNED BY fork_network_members.id; + +CREATE TABLE fork_networks ( + id integer NOT NULL, + root_project_id integer, + deleted_root_project_name character varying +); + +CREATE SEQUENCE fork_networks_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE fork_networks_id_seq OWNED BY fork_networks.id; + +CREATE TABLE forked_project_links ( + id integer NOT NULL, + forked_to_project_id integer NOT NULL, + forked_from_project_id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone +); + +CREATE SEQUENCE forked_project_links_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE forked_project_links_id_seq OWNED BY forked_project_links.id; + +CREATE TABLE geo_cache_invalidation_events ( + id bigint NOT NULL, + key character varying NOT NULL +); + +CREATE SEQUENCE geo_cache_invalidation_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_cache_invalidation_events_id_seq OWNED BY geo_cache_invalidation_events.id; + +CREATE TABLE geo_container_repository_updated_events ( + id bigint NOT NULL, + container_repository_id integer NOT NULL +); + +CREATE SEQUENCE geo_container_repository_updated_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_container_repository_updated_events_id_seq OWNED BY geo_container_repository_updated_events.id; + +CREATE TABLE geo_event_log ( + id bigint NOT NULL, + created_at timestamp without time zone NOT NULL, + repository_updated_event_id bigint, + repository_deleted_event_id bigint, + repository_renamed_event_id bigint, + repositories_changed_event_id bigint, + repository_created_event_id bigint, + hashed_storage_migrated_event_id bigint, + lfs_object_deleted_event_id bigint, + hashed_storage_attachments_event_id bigint, + upload_deleted_event_id bigint, + job_artifact_deleted_event_id bigint, + reset_checksum_event_id bigint, + cache_invalidation_event_id bigint, + container_repository_updated_event_id bigint +); + +CREATE SEQUENCE geo_event_log_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_event_log_id_seq OWNED BY geo_event_log.id; + +CREATE TABLE geo_hashed_storage_attachments_events ( + id bigint NOT NULL, + project_id integer NOT NULL, + old_attachments_path text NOT NULL, + new_attachments_path text NOT NULL +); + +CREATE SEQUENCE geo_hashed_storage_attachments_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_hashed_storage_attachments_events_id_seq OWNED BY geo_hashed_storage_attachments_events.id; + +CREATE TABLE geo_hashed_storage_migrated_events ( + id bigint NOT NULL, + project_id integer NOT NULL, + repository_storage_name text NOT NULL, + old_disk_path text NOT NULL, + new_disk_path text NOT NULL, + old_wiki_disk_path text NOT NULL, + new_wiki_disk_path text NOT NULL, + old_storage_version smallint, + new_storage_version smallint NOT NULL, + old_design_disk_path text, + new_design_disk_path text +); + +CREATE SEQUENCE geo_hashed_storage_migrated_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_hashed_storage_migrated_events_id_seq OWNED BY geo_hashed_storage_migrated_events.id; + +CREATE TABLE geo_job_artifact_deleted_events ( + id bigint NOT NULL, + job_artifact_id integer NOT NULL, + file_path character varying NOT NULL +); + +CREATE SEQUENCE geo_job_artifact_deleted_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_job_artifact_deleted_events_id_seq OWNED BY geo_job_artifact_deleted_events.id; + +CREATE TABLE geo_lfs_object_deleted_events ( + id bigint NOT NULL, + lfs_object_id integer NOT NULL, + oid character varying NOT NULL, + file_path character varying NOT NULL +); + +CREATE SEQUENCE geo_lfs_object_deleted_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_lfs_object_deleted_events_id_seq OWNED BY geo_lfs_object_deleted_events.id; + +CREATE TABLE geo_node_namespace_links ( + id integer NOT NULL, + geo_node_id integer NOT NULL, + namespace_id integer NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE geo_node_namespace_links_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_node_namespace_links_id_seq OWNED BY geo_node_namespace_links.id; + +CREATE TABLE geo_node_statuses ( + id integer NOT NULL, + geo_node_id integer NOT NULL, + db_replication_lag_seconds integer, + repositories_synced_count integer, + repositories_failed_count integer, + lfs_objects_count integer, + lfs_objects_synced_count integer, + lfs_objects_failed_count integer, + attachments_count integer, + attachments_synced_count integer, + attachments_failed_count integer, + last_event_id integer, + last_event_date timestamp without time zone, + cursor_last_event_id integer, + cursor_last_event_date timestamp without time zone, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + last_successful_status_check_at timestamp without time zone, + status_message character varying, + replication_slots_count integer, + replication_slots_used_count integer, + replication_slots_max_retained_wal_bytes bigint, + wikis_synced_count integer, + wikis_failed_count integer, + job_artifacts_count integer, + job_artifacts_synced_count integer, + job_artifacts_failed_count integer, + version character varying, + revision character varying, + repositories_verified_count integer, + repositories_verification_failed_count integer, + wikis_verified_count integer, + wikis_verification_failed_count integer, + lfs_objects_synced_missing_on_primary_count integer, + job_artifacts_synced_missing_on_primary_count integer, + attachments_synced_missing_on_primary_count integer, + repositories_checksummed_count integer, + repositories_checksum_failed_count integer, + repositories_checksum_mismatch_count integer, + wikis_checksummed_count integer, + wikis_checksum_failed_count integer, + wikis_checksum_mismatch_count integer, + storage_configuration_digest bytea, + repositories_retrying_verification_count integer, + wikis_retrying_verification_count integer, + projects_count integer, + container_repositories_count integer, + container_repositories_synced_count integer, + container_repositories_failed_count integer, + container_repositories_registry_count integer, + design_repositories_count integer, + design_repositories_synced_count integer, + design_repositories_failed_count integer, + design_repositories_registry_count integer +); + +CREATE SEQUENCE geo_node_statuses_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_node_statuses_id_seq OWNED BY geo_node_statuses.id; + +CREATE TABLE geo_nodes ( + id integer NOT NULL, + "primary" boolean DEFAULT false NOT NULL, + oauth_application_id integer, + enabled boolean DEFAULT true NOT NULL, + access_key character varying, + encrypted_secret_access_key character varying, + encrypted_secret_access_key_iv character varying, + clone_url_prefix character varying, + files_max_capacity integer DEFAULT 10 NOT NULL, + repos_max_capacity integer DEFAULT 25 NOT NULL, + url character varying NOT NULL, + selective_sync_type character varying, + selective_sync_shards text, + verification_max_capacity integer DEFAULT 100 NOT NULL, + minimum_reverification_interval integer DEFAULT 7 NOT NULL, + internal_url character varying, + name character varying NOT NULL, + container_repositories_max_capacity integer DEFAULT 10 NOT NULL, + sync_object_storage boolean DEFAULT false NOT NULL, + created_at timestamp with time zone, + updated_at timestamp with time zone +); + +CREATE SEQUENCE geo_nodes_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_nodes_id_seq OWNED BY geo_nodes.id; + +CREATE TABLE geo_repositories_changed_events ( + id bigint NOT NULL, + geo_node_id integer NOT NULL +); + +CREATE SEQUENCE geo_repositories_changed_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_repositories_changed_events_id_seq OWNED BY geo_repositories_changed_events.id; + +CREATE TABLE geo_repository_created_events ( + id bigint NOT NULL, + project_id integer NOT NULL, + repository_storage_name text NOT NULL, + repo_path text NOT NULL, + wiki_path text, + project_name text NOT NULL +); + +CREATE SEQUENCE geo_repository_created_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_repository_created_events_id_seq OWNED BY geo_repository_created_events.id; + +CREATE TABLE geo_repository_deleted_events ( + id bigint NOT NULL, + project_id integer NOT NULL, + repository_storage_name text NOT NULL, + deleted_path text NOT NULL, + deleted_wiki_path text, + deleted_project_name text NOT NULL +); + +CREATE SEQUENCE geo_repository_deleted_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_repository_deleted_events_id_seq OWNED BY geo_repository_deleted_events.id; + +CREATE TABLE geo_repository_renamed_events ( + id bigint NOT NULL, + project_id integer NOT NULL, + repository_storage_name text NOT NULL, + old_path_with_namespace text NOT NULL, + new_path_with_namespace text NOT NULL, + old_wiki_path_with_namespace text NOT NULL, + new_wiki_path_with_namespace text NOT NULL, + old_path text NOT NULL, + new_path text NOT NULL +); + +CREATE SEQUENCE geo_repository_renamed_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_repository_renamed_events_id_seq OWNED BY geo_repository_renamed_events.id; + +CREATE TABLE geo_repository_updated_events ( + id bigint NOT NULL, + branches_affected integer NOT NULL, + tags_affected integer NOT NULL, + project_id integer NOT NULL, + source smallint NOT NULL, + new_branch boolean DEFAULT false NOT NULL, + remove_branch boolean DEFAULT false NOT NULL, + ref text +); + +CREATE SEQUENCE geo_repository_updated_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_repository_updated_events_id_seq OWNED BY geo_repository_updated_events.id; + +CREATE TABLE geo_reset_checksum_events ( + id bigint NOT NULL, + project_id integer NOT NULL +); + +CREATE SEQUENCE geo_reset_checksum_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_reset_checksum_events_id_seq OWNED BY geo_reset_checksum_events.id; + +CREATE TABLE geo_upload_deleted_events ( + id bigint NOT NULL, + upload_id integer NOT NULL, + file_path character varying NOT NULL, + model_id integer NOT NULL, + model_type character varying NOT NULL, + uploader character varying NOT NULL +); + +CREATE SEQUENCE geo_upload_deleted_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE geo_upload_deleted_events_id_seq OWNED BY geo_upload_deleted_events.id; + +CREATE TABLE gitlab_subscription_histories ( + id bigint NOT NULL, + gitlab_subscription_created_at timestamp with time zone, + gitlab_subscription_updated_at timestamp with time zone, + start_date date, + end_date date, + trial_ends_on date, + namespace_id integer, + hosted_plan_id integer, + max_seats_used integer, + seats integer, + trial boolean, + change_type smallint, + gitlab_subscription_id bigint NOT NULL, + created_at timestamp with time zone, + trial_starts_on date +); + +CREATE SEQUENCE gitlab_subscription_histories_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE gitlab_subscription_histories_id_seq OWNED BY gitlab_subscription_histories.id; + +CREATE TABLE gitlab_subscriptions ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + start_date date, + end_date date, + trial_ends_on date, + namespace_id integer, + hosted_plan_id integer, + max_seats_used integer DEFAULT 0, + seats integer DEFAULT 0, + trial boolean DEFAULT false, + trial_starts_on date +); + +CREATE SEQUENCE gitlab_subscriptions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE gitlab_subscriptions_id_seq OWNED BY gitlab_subscriptions.id; + +CREATE TABLE gpg_key_subkeys ( + id integer NOT NULL, + gpg_key_id integer NOT NULL, + keyid bytea, + fingerprint bytea +); + +CREATE SEQUENCE gpg_key_subkeys_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE gpg_key_subkeys_id_seq OWNED BY gpg_key_subkeys.id; + +CREATE TABLE gpg_keys ( + id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + user_id integer, + primary_keyid bytea, + fingerprint bytea, + key text +); + +CREATE SEQUENCE gpg_keys_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE gpg_keys_id_seq OWNED BY gpg_keys.id; + +CREATE TABLE gpg_signatures ( + id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id integer, + gpg_key_id integer, + commit_sha bytea, + gpg_key_primary_keyid bytea, + gpg_key_user_name text, + gpg_key_user_email text, + verification_status smallint DEFAULT 0 NOT NULL, + gpg_key_subkey_id integer +); + +CREATE SEQUENCE gpg_signatures_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE gpg_signatures_id_seq OWNED BY gpg_signatures.id; + +CREATE TABLE grafana_integrations ( + id bigint NOT NULL, + project_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + encrypted_token character varying(255) NOT NULL, + encrypted_token_iv character varying(255) NOT NULL, + grafana_url character varying(1024) NOT NULL, + enabled boolean DEFAULT false NOT NULL +); + +CREATE SEQUENCE grafana_integrations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE grafana_integrations_id_seq OWNED BY grafana_integrations.id; + +CREATE TABLE group_custom_attributes ( + id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + group_id integer NOT NULL, + key character varying NOT NULL, + value character varying NOT NULL +); + +CREATE SEQUENCE group_custom_attributes_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE group_custom_attributes_id_seq OWNED BY group_custom_attributes.id; + +CREATE TABLE group_deletion_schedules ( + group_id bigint NOT NULL, + user_id bigint NOT NULL, + marked_for_deletion_on date NOT NULL +); + +CREATE TABLE group_group_links ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + shared_group_id bigint NOT NULL, + shared_with_group_id bigint NOT NULL, + expires_at date, + group_access smallint DEFAULT 30 NOT NULL +); + +CREATE SEQUENCE group_group_links_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE group_group_links_id_seq OWNED BY group_group_links.id; + +CREATE TABLE historical_data ( + id integer NOT NULL, + date date NOT NULL, + active_user_count integer, + created_at timestamp without time zone, + updated_at timestamp without time zone +); + +CREATE SEQUENCE historical_data_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE historical_data_id_seq OWNED BY historical_data.id; + +CREATE TABLE identities ( + id integer NOT NULL, + extern_uid character varying, + provider character varying, + user_id integer, + created_at timestamp without time zone, + updated_at timestamp without time zone, + saml_provider_id integer, + secondary_extern_uid character varying +); + +CREATE SEQUENCE identities_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE identities_id_seq OWNED BY identities.id; + +CREATE TABLE import_export_uploads ( + id integer NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id integer, + import_file text, + export_file text, + group_id bigint +); + +CREATE SEQUENCE import_export_uploads_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE import_export_uploads_id_seq OWNED BY import_export_uploads.id; + +CREATE TABLE import_failures ( + id bigint NOT NULL, + relation_index integer, + project_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + relation_key character varying(64), + exception_class character varying(128), + correlation_id_value character varying(128), + exception_message character varying(255) +); + +CREATE SEQUENCE import_failures_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE import_failures_id_seq OWNED BY import_failures.id; + +CREATE TABLE index_statuses ( + id integer NOT NULL, + project_id integer NOT NULL, + indexed_at timestamp without time zone, + note text, + last_commit character varying, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + last_wiki_commit bytea, + wiki_indexed_at timestamp with time zone +); + +CREATE SEQUENCE index_statuses_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE index_statuses_id_seq OWNED BY index_statuses.id; + +CREATE TABLE insights ( + id integer NOT NULL, + namespace_id integer NOT NULL, + project_id integer NOT NULL +); + +CREATE SEQUENCE insights_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE insights_id_seq OWNED BY insights.id; + +CREATE TABLE internal_ids ( + id bigint NOT NULL, + project_id integer, + usage integer NOT NULL, + last_value integer NOT NULL, + namespace_id integer +); + +CREATE SEQUENCE internal_ids_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE internal_ids_id_seq OWNED BY internal_ids.id; + +CREATE TABLE ip_restrictions ( + id bigint NOT NULL, + group_id integer NOT NULL, + range character varying NOT NULL +); + +CREATE SEQUENCE ip_restrictions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ip_restrictions_id_seq OWNED BY ip_restrictions.id; + +CREATE TABLE issue_assignees ( + user_id integer NOT NULL, + issue_id integer NOT NULL +); + +CREATE TABLE issue_links ( + id integer NOT NULL, + source_id integer NOT NULL, + target_id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + link_type smallint DEFAULT 0 NOT NULL +); + +CREATE SEQUENCE issue_links_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE issue_links_id_seq OWNED BY issue_links.id; + +CREATE TABLE issue_metrics ( + id integer NOT NULL, + issue_id integer NOT NULL, + first_mentioned_in_commit_at timestamp without time zone, + first_associated_with_milestone_at timestamp without time zone, + first_added_to_board_at timestamp without time zone, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE issue_metrics_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE issue_metrics_id_seq OWNED BY issue_metrics.id; + +CREATE TABLE issue_milestones ( + issue_id bigint NOT NULL, + milestone_id bigint NOT NULL +); + +CREATE TABLE issue_tracker_data ( + id bigint NOT NULL, + service_id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + encrypted_project_url character varying, + encrypted_project_url_iv character varying, + encrypted_issues_url character varying, + encrypted_issues_url_iv character varying, + encrypted_new_issue_url character varying, + encrypted_new_issue_url_iv character varying +); + +CREATE SEQUENCE issue_tracker_data_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE issue_tracker_data_id_seq OWNED BY issue_tracker_data.id; + +CREATE TABLE issue_user_mentions ( + id bigint NOT NULL, + issue_id integer NOT NULL, + note_id integer, + mentioned_users_ids integer[], + mentioned_projects_ids integer[], + mentioned_groups_ids integer[] +); + +CREATE SEQUENCE issue_user_mentions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE issue_user_mentions_id_seq OWNED BY issue_user_mentions.id; + +CREATE TABLE issues ( + id integer NOT NULL, + title character varying, + author_id integer, + project_id integer, + created_at timestamp without time zone, + updated_at timestamp without time zone, + description text, + milestone_id integer, + state character varying, + iid integer, + updated_by_id integer, + confidential boolean DEFAULT false NOT NULL, + due_date date, + moved_to_id integer, + lock_version integer, + title_html text, + description_html text, + time_estimate integer, + relative_position integer, + cached_markdown_version integer, + last_edited_at timestamp without time zone, + last_edited_by_id integer, + discussion_locked boolean, + closed_at timestamp with time zone, + closed_by_id integer, + state_id smallint DEFAULT 1 NOT NULL, + service_desk_reply_to character varying, + weight integer, + duplicated_to_id integer, + promoted_to_epic_id integer +); + +CREATE SEQUENCE issues_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE issues_id_seq OWNED BY issues.id; + +CREATE TABLE issues_prometheus_alert_events ( + issue_id bigint NOT NULL, + prometheus_alert_event_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE TABLE issues_self_managed_prometheus_alert_events ( + issue_id bigint NOT NULL, + self_managed_prometheus_alert_event_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE TABLE jira_connect_installations ( + id bigint NOT NULL, + client_key character varying, + encrypted_shared_secret character varying, + encrypted_shared_secret_iv character varying, + base_url character varying +); + +CREATE SEQUENCE jira_connect_installations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE jira_connect_installations_id_seq OWNED BY jira_connect_installations.id; + +CREATE TABLE jira_connect_subscriptions ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + jira_connect_installation_id bigint NOT NULL, + namespace_id integer NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE jira_connect_subscriptions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE jira_connect_subscriptions_id_seq OWNED BY jira_connect_subscriptions.id; + +CREATE TABLE jira_tracker_data ( + id bigint NOT NULL, + service_id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + encrypted_url character varying, + encrypted_url_iv character varying, + encrypted_api_url character varying, + encrypted_api_url_iv character varying, + encrypted_username character varying, + encrypted_username_iv character varying, + encrypted_password character varying, + encrypted_password_iv character varying, + jira_issue_transition_id character varying +); + +CREATE SEQUENCE jira_tracker_data_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE jira_tracker_data_id_seq OWNED BY jira_tracker_data.id; + +CREATE TABLE keys ( + id integer NOT NULL, + user_id integer, + created_at timestamp without time zone, + updated_at timestamp without time zone, + key text, + title character varying, + type character varying, + fingerprint character varying, + public boolean DEFAULT false NOT NULL, + last_used_at timestamp without time zone, + fingerprint_sha256 bytea +); + +CREATE SEQUENCE keys_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE keys_id_seq OWNED BY keys.id; + +CREATE TABLE label_links ( + id integer NOT NULL, + label_id integer, + target_id integer, + target_type character varying, + created_at timestamp without time zone, + updated_at timestamp without time zone +); + +CREATE SEQUENCE label_links_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE label_links_id_seq OWNED BY label_links.id; + +CREATE TABLE label_priorities ( + id integer NOT NULL, + project_id integer NOT NULL, + label_id integer NOT NULL, + priority integer NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE label_priorities_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE label_priorities_id_seq OWNED BY label_priorities.id; + +CREATE TABLE labels ( + id integer NOT NULL, + title character varying, + color character varying, + project_id integer, + created_at timestamp without time zone, + updated_at timestamp without time zone, + template boolean DEFAULT false, + description character varying, + description_html text, + type character varying, + group_id integer, + cached_markdown_version integer +); + +CREATE SEQUENCE labels_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE labels_id_seq OWNED BY labels.id; + +CREATE TABLE ldap_group_links ( + id integer NOT NULL, + cn character varying, + group_access integer NOT NULL, + group_id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + provider character varying, + filter character varying +); + +CREATE SEQUENCE ldap_group_links_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ldap_group_links_id_seq OWNED BY ldap_group_links.id; + +CREATE TABLE lfs_file_locks ( + id integer NOT NULL, + project_id integer NOT NULL, + user_id integer NOT NULL, + created_at timestamp without time zone NOT NULL, + path character varying(511) +); + +CREATE SEQUENCE lfs_file_locks_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE lfs_file_locks_id_seq OWNED BY lfs_file_locks.id; + +CREATE TABLE lfs_objects ( + id integer NOT NULL, + oid character varying NOT NULL, + size bigint NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + file character varying, + file_store integer +); + +CREATE SEQUENCE lfs_objects_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE lfs_objects_id_seq OWNED BY lfs_objects.id; + +CREATE TABLE lfs_objects_projects ( + id integer NOT NULL, + lfs_object_id integer NOT NULL, + project_id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + repository_type smallint +); + +CREATE SEQUENCE lfs_objects_projects_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE lfs_objects_projects_id_seq OWNED BY lfs_objects_projects.id; + +CREATE TABLE licenses ( + id integer NOT NULL, + data text NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone +); + +CREATE SEQUENCE licenses_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE licenses_id_seq OWNED BY licenses.id; + +CREATE TABLE list_user_preferences ( + id bigint NOT NULL, + user_id bigint NOT NULL, + list_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + collapsed boolean +); + +CREATE SEQUENCE list_user_preferences_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE list_user_preferences_id_seq OWNED BY list_user_preferences.id; + +CREATE TABLE lists ( + id integer NOT NULL, + board_id integer NOT NULL, + label_id integer, + list_type integer DEFAULT 1 NOT NULL, + "position" integer, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + milestone_id integer, + user_id integer, + max_issue_count integer DEFAULT 0 NOT NULL, + max_issue_weight integer DEFAULT 0 NOT NULL +); + +CREATE SEQUENCE lists_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE lists_id_seq OWNED BY lists.id; + +CREATE TABLE members ( + id integer NOT NULL, + access_level integer NOT NULL, + source_id integer NOT NULL, + source_type character varying NOT NULL, + user_id integer, + notification_level integer NOT NULL, + type character varying, + created_at timestamp without time zone, + updated_at timestamp without time zone, + created_by_id integer, + invite_email character varying, + invite_token character varying, + invite_accepted_at timestamp without time zone, + requested_at timestamp without time zone, + expires_at date, + ldap boolean DEFAULT false NOT NULL, + override boolean DEFAULT false NOT NULL +); + +CREATE SEQUENCE members_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE members_id_seq OWNED BY members.id; + +CREATE TABLE merge_request_assignees ( + id integer NOT NULL, + user_id integer NOT NULL, + merge_request_id integer NOT NULL +); + +CREATE SEQUENCE merge_request_assignees_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_request_assignees_id_seq OWNED BY merge_request_assignees.id; + +CREATE TABLE merge_request_blocks ( + id bigint NOT NULL, + blocking_merge_request_id integer NOT NULL, + blocked_merge_request_id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE merge_request_blocks_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_request_blocks_id_seq OWNED BY merge_request_blocks.id; + +CREATE TABLE merge_request_context_commit_diff_files ( + merge_request_context_commit_id bigint, + sha bytea NOT NULL, + relative_order integer NOT NULL, + a_mode character varying(255) NOT NULL, + b_mode character varying(255) NOT NULL, + new_file boolean NOT NULL, + renamed_file boolean NOT NULL, + deleted_file boolean NOT NULL, + too_large boolean NOT NULL, + "binary" boolean, + new_path text NOT NULL, + old_path text NOT NULL, + diff text +); + +CREATE TABLE merge_request_context_commits ( + id bigint NOT NULL, + merge_request_id bigint, + authored_date timestamp with time zone, + committed_date timestamp with time zone, + sha bytea NOT NULL, + relative_order integer NOT NULL, + author_name text, + author_email text, + committer_name text, + committer_email text, + message text +); + +CREATE SEQUENCE merge_request_context_commits_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_request_context_commits_id_seq OWNED BY merge_request_context_commits.id; + +CREATE TABLE merge_request_diff_commits ( + authored_date timestamp with time zone, + committed_date timestamp with time zone, + merge_request_diff_id integer NOT NULL, + relative_order integer NOT NULL, + sha bytea NOT NULL, + author_name text, + author_email text, + committer_name text, + committer_email text, + message text +); + +CREATE TABLE merge_request_diff_files ( + merge_request_diff_id integer NOT NULL, + relative_order integer NOT NULL, + new_file boolean NOT NULL, + renamed_file boolean NOT NULL, + deleted_file boolean NOT NULL, + too_large boolean NOT NULL, + a_mode character varying NOT NULL, + b_mode character varying NOT NULL, + new_path text NOT NULL, + old_path text NOT NULL, + diff text, + "binary" boolean, + external_diff_offset integer, + external_diff_size integer +); + +CREATE TABLE merge_request_diffs ( + id integer NOT NULL, + state character varying, + merge_request_id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + base_commit_sha character varying, + real_size character varying, + head_commit_sha character varying, + start_commit_sha character varying, + commits_count integer, + external_diff character varying, + external_diff_store integer, + stored_externally boolean +); + +CREATE SEQUENCE merge_request_diffs_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_request_diffs_id_seq OWNED BY merge_request_diffs.id; + +CREATE TABLE merge_request_metrics ( + id integer NOT NULL, + merge_request_id integer NOT NULL, + latest_build_started_at timestamp without time zone, + latest_build_finished_at timestamp without time zone, + first_deployed_to_production_at timestamp without time zone, + merged_at timestamp without time zone, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + pipeline_id integer, + merged_by_id integer, + latest_closed_by_id integer, + latest_closed_at timestamp with time zone, + first_comment_at timestamp with time zone, + first_commit_at timestamp with time zone, + last_commit_at timestamp with time zone, + diff_size integer, + modified_paths_size integer, + commits_count integer +); + +CREATE SEQUENCE merge_request_metrics_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_request_metrics_id_seq OWNED BY merge_request_metrics.id; + +CREATE TABLE merge_request_milestones ( + merge_request_id bigint NOT NULL, + milestone_id bigint NOT NULL +); + +CREATE TABLE merge_request_user_mentions ( + id bigint NOT NULL, + merge_request_id integer NOT NULL, + note_id integer, + mentioned_users_ids integer[], + mentioned_projects_ids integer[], + mentioned_groups_ids integer[] +); + +CREATE SEQUENCE merge_request_user_mentions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_request_user_mentions_id_seq OWNED BY merge_request_user_mentions.id; + +CREATE TABLE merge_requests ( + id integer NOT NULL, + target_branch character varying NOT NULL, + source_branch character varying NOT NULL, + source_project_id integer, + author_id integer, + assignee_id integer, + title character varying, + created_at timestamp without time zone, + updated_at timestamp without time zone, + milestone_id integer, + state character varying DEFAULT 'opened'::character varying NOT NULL, + merge_status character varying DEFAULT 'unchecked'::character varying NOT NULL, + target_project_id integer NOT NULL, + iid integer, + description text, + updated_by_id integer, + merge_error text, + merge_params text, + merge_when_pipeline_succeeds boolean DEFAULT false NOT NULL, + merge_user_id integer, + merge_commit_sha character varying, + rebase_commit_sha character varying, + in_progress_merge_commit_sha character varying, + lock_version integer, + title_html text, + description_html text, + time_estimate integer, + cached_markdown_version integer, + last_edited_at timestamp without time zone, + last_edited_by_id integer, + head_pipeline_id integer, + merge_jid character varying, + discussion_locked boolean, + latest_merge_request_diff_id integer, + allow_maintainer_to_push boolean, + squash boolean DEFAULT false NOT NULL, + state_id smallint DEFAULT 1 NOT NULL, + approvals_before_merge integer, + rebase_jid character varying, + squash_commit_sha bytea +); + +CREATE TABLE merge_requests_closing_issues ( + id integer NOT NULL, + merge_request_id integer NOT NULL, + issue_id integer NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE merge_requests_closing_issues_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_requests_closing_issues_id_seq OWNED BY merge_requests_closing_issues.id; + +CREATE SEQUENCE merge_requests_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_requests_id_seq OWNED BY merge_requests.id; + +CREATE TABLE merge_trains ( + id bigint NOT NULL, + merge_request_id integer NOT NULL, + user_id integer NOT NULL, + pipeline_id integer, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + target_project_id integer NOT NULL, + target_branch text NOT NULL, + status smallint DEFAULT 0 NOT NULL +); + +CREATE SEQUENCE merge_trains_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_trains_id_seq OWNED BY merge_trains.id; + +CREATE TABLE milestone_releases ( + milestone_id bigint NOT NULL, + release_id bigint NOT NULL +); + +CREATE TABLE milestones ( + id integer NOT NULL, + title character varying NOT NULL, + project_id integer, + description text, + due_date date, + created_at timestamp without time zone, + updated_at timestamp without time zone, + state character varying, + iid integer, + title_html text, + description_html text, + start_date date, + cached_markdown_version integer, + group_id integer +); + +CREATE SEQUENCE milestones_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE milestones_id_seq OWNED BY milestones.id; + +CREATE TABLE namespace_aggregation_schedules ( + namespace_id integer NOT NULL +); + +CREATE SEQUENCE namespace_aggregation_schedules_namespace_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE namespace_aggregation_schedules_namespace_id_seq OWNED BY namespace_aggregation_schedules.namespace_id; + +CREATE TABLE namespace_root_storage_statistics ( + namespace_id integer NOT NULL, + updated_at timestamp with time zone NOT NULL, + repository_size bigint DEFAULT 0 NOT NULL, + lfs_objects_size bigint DEFAULT 0 NOT NULL, + wiki_size bigint DEFAULT 0 NOT NULL, + build_artifacts_size bigint DEFAULT 0 NOT NULL, + storage_size bigint DEFAULT 0 NOT NULL, + packages_size bigint DEFAULT 0 NOT NULL +); + +CREATE SEQUENCE namespace_root_storage_statistics_namespace_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE namespace_root_storage_statistics_namespace_id_seq OWNED BY namespace_root_storage_statistics.namespace_id; + +CREATE TABLE namespace_statistics ( + id integer NOT NULL, + namespace_id integer NOT NULL, + shared_runners_seconds integer DEFAULT 0 NOT NULL, + shared_runners_seconds_last_reset timestamp without time zone +); + +CREATE SEQUENCE namespace_statistics_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE namespace_statistics_id_seq OWNED BY namespace_statistics.id; + +CREATE TABLE namespaces ( + id integer NOT NULL, + name character varying NOT NULL, + path character varying NOT NULL, + owner_id integer, + created_at timestamp without time zone, + updated_at timestamp without time zone, + type character varying, + description character varying DEFAULT ''::character varying NOT NULL, + avatar character varying, + share_with_group_lock boolean DEFAULT false, + visibility_level integer DEFAULT 20 NOT NULL, + request_access_enabled boolean DEFAULT true NOT NULL, + description_html text, + lfs_enabled boolean, + parent_id integer, + require_two_factor_authentication boolean DEFAULT false NOT NULL, + two_factor_grace_period integer DEFAULT 48 NOT NULL, + cached_markdown_version integer, + runners_token character varying, + project_creation_level integer, + runners_token_encrypted character varying, + auto_devops_enabled boolean, + custom_project_templates_group_id integer, + file_template_project_id integer, + ldap_sync_error character varying, + ldap_sync_last_successful_update_at timestamp without time zone, + ldap_sync_last_sync_at timestamp without time zone, + ldap_sync_last_update_at timestamp without time zone, + plan_id integer, + repository_size_limit bigint, + saml_discovery_token character varying, + shared_runners_minutes_limit integer, + trial_ends_on timestamp with time zone, + extra_shared_runners_minutes_limit integer, + ldap_sync_status character varying DEFAULT 'ready'::character varying NOT NULL, + membership_lock boolean DEFAULT false, + last_ci_minutes_notification_at timestamp with time zone, + last_ci_minutes_usage_notification_level integer, + subgroup_creation_level integer DEFAULT 1, + emails_disabled boolean, + max_pages_size integer, + max_artifacts_size integer, + mentions_disabled boolean +); + +CREATE SEQUENCE namespaces_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE namespaces_id_seq OWNED BY namespaces.id; + +CREATE TABLE note_diff_files ( + id integer NOT NULL, + diff_note_id integer NOT NULL, + diff text NOT NULL, + new_file boolean NOT NULL, + renamed_file boolean NOT NULL, + deleted_file boolean NOT NULL, + a_mode character varying NOT NULL, + b_mode character varying NOT NULL, + new_path text NOT NULL, + old_path text NOT NULL +); + +CREATE SEQUENCE note_diff_files_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE note_diff_files_id_seq OWNED BY note_diff_files.id; + +CREATE TABLE notes ( + id integer NOT NULL, + note text, + noteable_type character varying, + author_id integer, + created_at timestamp without time zone, + updated_at timestamp without time zone, + project_id integer, + attachment character varying, + line_code character varying, + commit_id character varying, + noteable_id integer, + system boolean DEFAULT false NOT NULL, + st_diff text, + updated_by_id integer, + type character varying, + "position" text, + original_position text, + resolved_at timestamp without time zone, + resolved_by_id integer, + discussion_id character varying, + note_html text, + cached_markdown_version integer, + change_position text, + resolved_by_push boolean, + review_id bigint +); + +CREATE SEQUENCE notes_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE notes_id_seq OWNED BY notes.id; + +CREATE TABLE notification_settings ( + id integer NOT NULL, + user_id integer NOT NULL, + source_type character varying, + source_id integer, + level integer DEFAULT 0 NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + new_note boolean, + new_issue boolean, + reopen_issue boolean, + close_issue boolean, + reassign_issue boolean, + new_merge_request boolean, + reopen_merge_request boolean, + close_merge_request boolean, + reassign_merge_request boolean, + merge_merge_request boolean, + failed_pipeline boolean, + success_pipeline boolean, + push_to_merge_request boolean, + issue_due boolean, + notification_email character varying, + new_epic boolean, + new_release boolean, + fixed_pipeline boolean +); + +CREATE SEQUENCE notification_settings_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE notification_settings_id_seq OWNED BY notification_settings.id; + +CREATE TABLE oauth_access_grants ( + id integer NOT NULL, + resource_owner_id integer NOT NULL, + application_id integer NOT NULL, + token character varying NOT NULL, + expires_in integer NOT NULL, + redirect_uri text NOT NULL, + created_at timestamp without time zone NOT NULL, + revoked_at timestamp without time zone, + scopes character varying +); + +CREATE SEQUENCE oauth_access_grants_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE oauth_access_grants_id_seq OWNED BY oauth_access_grants.id; + +CREATE TABLE oauth_access_tokens ( + id integer NOT NULL, + resource_owner_id integer, + application_id integer, + token character varying NOT NULL, + refresh_token character varying, + expires_in integer, + revoked_at timestamp without time zone, + created_at timestamp without time zone NOT NULL, + scopes character varying +); + +CREATE SEQUENCE oauth_access_tokens_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE oauth_access_tokens_id_seq OWNED BY oauth_access_tokens.id; + +CREATE TABLE oauth_applications ( + id integer NOT NULL, + name character varying NOT NULL, + uid character varying NOT NULL, + secret character varying NOT NULL, + redirect_uri text NOT NULL, + scopes character varying DEFAULT ''::character varying NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + owner_id integer, + owner_type character varying, + trusted boolean DEFAULT false NOT NULL, + confidential boolean DEFAULT true NOT NULL +); + +CREATE SEQUENCE oauth_applications_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE oauth_applications_id_seq OWNED BY oauth_applications.id; + +CREATE TABLE oauth_openid_requests ( + id integer NOT NULL, + access_grant_id integer NOT NULL, + nonce character varying NOT NULL +); + +CREATE SEQUENCE oauth_openid_requests_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE oauth_openid_requests_id_seq OWNED BY oauth_openid_requests.id; + +CREATE TABLE operations_feature_flag_scopes ( + id bigint NOT NULL, + feature_flag_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + active boolean NOT NULL, + environment_scope character varying DEFAULT '*'::character varying NOT NULL, + strategies jsonb DEFAULT '[{"name": "default", "parameters": {}}]'::jsonb NOT NULL +); + +CREATE SEQUENCE operations_feature_flag_scopes_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE operations_feature_flag_scopes_id_seq OWNED BY operations_feature_flag_scopes.id; + +CREATE TABLE operations_feature_flags ( + id bigint NOT NULL, + project_id integer NOT NULL, + active boolean NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + name character varying NOT NULL, + description text +); + +CREATE TABLE operations_feature_flags_clients ( + id bigint NOT NULL, + project_id integer NOT NULL, + token_encrypted character varying +); + +CREATE SEQUENCE operations_feature_flags_clients_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE operations_feature_flags_clients_id_seq OWNED BY operations_feature_flags_clients.id; + +CREATE SEQUENCE operations_feature_flags_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE operations_feature_flags_id_seq OWNED BY operations_feature_flags.id; + +CREATE TABLE packages_build_infos ( + id bigint NOT NULL, + package_id integer NOT NULL, + pipeline_id integer +); + +CREATE SEQUENCE packages_build_infos_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_build_infos_id_seq OWNED BY packages_build_infos.id; + +CREATE TABLE packages_conan_file_metadata ( + id bigint NOT NULL, + package_file_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + recipe_revision character varying(255) DEFAULT '0'::character varying NOT NULL, + package_revision character varying(255), + conan_package_reference character varying(255), + conan_file_type smallint NOT NULL +); + +CREATE SEQUENCE packages_conan_file_metadata_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_conan_file_metadata_id_seq OWNED BY packages_conan_file_metadata.id; + +CREATE TABLE packages_conan_metadata ( + id bigint NOT NULL, + package_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + package_username character varying(255) NOT NULL, + package_channel character varying(255) NOT NULL +); + +CREATE SEQUENCE packages_conan_metadata_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_conan_metadata_id_seq OWNED BY packages_conan_metadata.id; + +CREATE TABLE packages_dependencies ( + id bigint NOT NULL, + name character varying(255) NOT NULL, + version_pattern character varying(255) NOT NULL +); + +CREATE SEQUENCE packages_dependencies_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_dependencies_id_seq OWNED BY packages_dependencies.id; + +CREATE TABLE packages_dependency_links ( + id bigint NOT NULL, + package_id bigint NOT NULL, + dependency_id bigint NOT NULL, + dependency_type smallint NOT NULL +); + +CREATE SEQUENCE packages_dependency_links_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_dependency_links_id_seq OWNED BY packages_dependency_links.id; + +CREATE TABLE packages_maven_metadata ( + id bigint NOT NULL, + package_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + app_group character varying NOT NULL, + app_name character varying NOT NULL, + app_version character varying, + path character varying(512) NOT NULL +); + +CREATE SEQUENCE packages_maven_metadata_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_maven_metadata_id_seq OWNED BY packages_maven_metadata.id; + +CREATE TABLE packages_package_files ( + id bigint NOT NULL, + package_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + size bigint, + file_type integer, + file_store integer, + file_md5 bytea, + file_sha1 bytea, + file_name character varying NOT NULL, + file text NOT NULL +); + +CREATE SEQUENCE packages_package_files_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_package_files_id_seq OWNED BY packages_package_files.id; + +CREATE TABLE packages_packages ( + id bigint NOT NULL, + project_id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + name character varying NOT NULL, + version character varying, + package_type smallint NOT NULL +); + +CREATE SEQUENCE packages_packages_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_packages_id_seq OWNED BY packages_packages.id; + +CREATE TABLE packages_tags ( + id bigint NOT NULL, + package_id integer NOT NULL, + name character varying(255) NOT NULL +); + +CREATE SEQUENCE packages_tags_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_tags_id_seq OWNED BY packages_tags.id; + +CREATE TABLE pages_domain_acme_orders ( + id bigint NOT NULL, + pages_domain_id integer NOT NULL, + expires_at timestamp with time zone NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + url character varying NOT NULL, + challenge_token character varying NOT NULL, + challenge_file_content text NOT NULL, + encrypted_private_key text NOT NULL, + encrypted_private_key_iv text NOT NULL +); + +CREATE SEQUENCE pages_domain_acme_orders_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE pages_domain_acme_orders_id_seq OWNED BY pages_domain_acme_orders.id; + +CREATE TABLE pages_domains ( + id integer NOT NULL, + project_id integer, + certificate text, + encrypted_key text, + encrypted_key_iv character varying, + encrypted_key_salt character varying, + domain character varying, + verified_at timestamp with time zone, + verification_code character varying NOT NULL, + enabled_until timestamp with time zone, + remove_at timestamp with time zone, + auto_ssl_enabled boolean DEFAULT false NOT NULL, + certificate_valid_not_before timestamp with time zone, + certificate_valid_not_after timestamp with time zone, + certificate_source smallint DEFAULT 0 NOT NULL, + wildcard boolean DEFAULT false NOT NULL, + domain_type smallint DEFAULT 2 NOT NULL +); + +CREATE SEQUENCE pages_domains_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE pages_domains_id_seq OWNED BY pages_domains.id; + +CREATE TABLE path_locks ( + id integer NOT NULL, + path character varying NOT NULL, + project_id integer, + user_id integer, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE path_locks_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE path_locks_id_seq OWNED BY path_locks.id; + +CREATE TABLE personal_access_tokens ( + id integer NOT NULL, + user_id integer NOT NULL, + name character varying NOT NULL, + revoked boolean DEFAULT false, + expires_at date, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + scopes character varying DEFAULT '--- [] +'::character varying NOT NULL, + impersonation boolean DEFAULT false NOT NULL, + token_digest character varying, + expire_notification_delivered boolean DEFAULT false NOT NULL +); + +CREATE SEQUENCE personal_access_tokens_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE personal_access_tokens_id_seq OWNED BY personal_access_tokens.id; + +CREATE TABLE plan_limits ( + plan_id bigint NOT NULL, + ci_active_pipelines integer DEFAULT 0 NOT NULL, + ci_pipeline_size integer DEFAULT 0 NOT NULL, + ci_active_jobs integer DEFAULT 0 NOT NULL, + id bigint NOT NULL, + project_hooks integer DEFAULT 0 NOT NULL +); + +CREATE SEQUENCE plan_limits_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE plan_limits_id_seq OWNED BY plan_limits.id; + +CREATE TABLE plans ( + id integer NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + name character varying, + title character varying +); + +CREATE SEQUENCE plans_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE plans_id_seq OWNED BY plans.id; + +CREATE TABLE pool_repositories ( + id bigint NOT NULL, + shard_id integer NOT NULL, + disk_path character varying, + state character varying, + source_project_id integer +); + +CREATE SEQUENCE pool_repositories_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE pool_repositories_id_seq OWNED BY pool_repositories.id; + +CREATE TABLE programming_languages ( + id integer NOT NULL, + name character varying NOT NULL, + color character varying NOT NULL, + created_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE programming_languages_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE programming_languages_id_seq OWNED BY programming_languages.id; + +CREATE TABLE project_alerting_settings ( + project_id integer NOT NULL, + encrypted_token character varying NOT NULL, + encrypted_token_iv character varying NOT NULL +); + +CREATE TABLE project_aliases ( + id bigint NOT NULL, + project_id integer NOT NULL, + name character varying NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE project_aliases_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_aliases_id_seq OWNED BY project_aliases.id; + +CREATE TABLE project_authorizations ( + user_id integer NOT NULL, + project_id integer NOT NULL, + access_level integer NOT NULL +); + +CREATE TABLE project_auto_devops ( + id integer NOT NULL, + project_id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + enabled boolean, + deploy_strategy integer DEFAULT 0 NOT NULL +); + +CREATE SEQUENCE project_auto_devops_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_auto_devops_id_seq OWNED BY project_auto_devops.id; + +CREATE TABLE project_ci_cd_settings ( + id integer NOT NULL, + project_id integer NOT NULL, + group_runners_enabled boolean DEFAULT true NOT NULL, + merge_pipelines_enabled boolean, + default_git_depth integer +); + +CREATE SEQUENCE project_ci_cd_settings_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_ci_cd_settings_id_seq OWNED BY project_ci_cd_settings.id; + +CREATE TABLE project_custom_attributes ( + id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id integer NOT NULL, + key character varying NOT NULL, + value character varying NOT NULL +); + +CREATE SEQUENCE project_custom_attributes_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_custom_attributes_id_seq OWNED BY project_custom_attributes.id; + +CREATE TABLE project_daily_statistics ( + id bigint NOT NULL, + project_id integer NOT NULL, + fetch_count integer NOT NULL, + date date +); + +CREATE SEQUENCE project_daily_statistics_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_daily_statistics_id_seq OWNED BY project_daily_statistics.id; + +CREATE TABLE project_deploy_tokens ( + id integer NOT NULL, + project_id integer NOT NULL, + deploy_token_id integer NOT NULL, + created_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE project_deploy_tokens_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_deploy_tokens_id_seq OWNED BY project_deploy_tokens.id; + +CREATE TABLE project_error_tracking_settings ( + project_id integer NOT NULL, + enabled boolean DEFAULT false NOT NULL, + api_url character varying, + encrypted_token character varying, + encrypted_token_iv character varying, + project_name character varying, + organization_name character varying +); + +CREATE TABLE project_feature_usages ( + project_id integer NOT NULL, + jira_dvcs_cloud_last_sync_at timestamp without time zone, + jira_dvcs_server_last_sync_at timestamp without time zone +); + +CREATE TABLE project_features ( + id integer NOT NULL, + project_id integer NOT NULL, + merge_requests_access_level integer, + issues_access_level integer, + wiki_access_level integer, + snippets_access_level integer DEFAULT 20 NOT NULL, + builds_access_level integer, + created_at timestamp without time zone, + updated_at timestamp without time zone, + repository_access_level integer DEFAULT 20 NOT NULL, + pages_access_level integer NOT NULL +); + +CREATE SEQUENCE project_features_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_features_id_seq OWNED BY project_features.id; + +CREATE TABLE project_group_links ( + id integer NOT NULL, + project_id integer NOT NULL, + group_id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + group_access integer DEFAULT 30 NOT NULL, + expires_at date +); + +CREATE SEQUENCE project_group_links_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_group_links_id_seq OWNED BY project_group_links.id; + +CREATE TABLE project_import_data ( + id integer NOT NULL, + project_id integer, + data text, + encrypted_credentials text, + encrypted_credentials_iv character varying, + encrypted_credentials_salt character varying +); + +CREATE SEQUENCE project_import_data_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_import_data_id_seq OWNED BY project_import_data.id; + +CREATE TABLE project_incident_management_settings ( + project_id integer NOT NULL, + create_issue boolean DEFAULT true NOT NULL, + send_email boolean DEFAULT false NOT NULL, + issue_template_key text +); + +CREATE TABLE project_metrics_settings ( + project_id integer NOT NULL, + external_dashboard_url character varying NOT NULL +); + +CREATE TABLE project_mirror_data ( + id integer NOT NULL, + project_id integer NOT NULL, + status character varying, + jid character varying, + last_error text, + last_successful_update_at timestamp with time zone, + last_update_at timestamp with time zone, + last_update_scheduled_at timestamp without time zone, + last_update_started_at timestamp without time zone, + next_execution_timestamp timestamp without time zone, + retry_count integer DEFAULT 0 NOT NULL +); + +CREATE SEQUENCE project_mirror_data_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_mirror_data_id_seq OWNED BY project_mirror_data.id; + +CREATE TABLE project_pages_metadata ( + project_id bigint NOT NULL, + deployed boolean DEFAULT false NOT NULL +); + +CREATE TABLE project_repositories ( + id bigint NOT NULL, + shard_id integer NOT NULL, + disk_path character varying NOT NULL, + project_id integer NOT NULL +); + +CREATE SEQUENCE project_repositories_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_repositories_id_seq OWNED BY project_repositories.id; + +CREATE TABLE project_repository_states ( + id integer NOT NULL, + project_id integer NOT NULL, + repository_verification_checksum bytea, + wiki_verification_checksum bytea, + last_repository_verification_failure character varying, + last_wiki_verification_failure character varying, + repository_retry_at timestamp with time zone, + wiki_retry_at timestamp with time zone, + repository_retry_count integer, + wiki_retry_count integer, + last_repository_verification_ran_at timestamp with time zone, + last_wiki_verification_ran_at timestamp with time zone +); + +CREATE SEQUENCE project_repository_states_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_repository_states_id_seq OWNED BY project_repository_states.id; + +CREATE TABLE project_settings ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id integer NOT NULL +); + +CREATE TABLE project_statistics ( + id integer NOT NULL, + project_id integer NOT NULL, + namespace_id integer NOT NULL, + commit_count bigint DEFAULT 0 NOT NULL, + storage_size bigint DEFAULT 0 NOT NULL, + repository_size bigint DEFAULT 0 NOT NULL, + lfs_objects_size bigint DEFAULT 0 NOT NULL, + build_artifacts_size bigint DEFAULT 0 NOT NULL, + shared_runners_seconds bigint DEFAULT 0 NOT NULL, + shared_runners_seconds_last_reset timestamp without time zone, + packages_size bigint DEFAULT 0 NOT NULL, + wiki_size bigint +); + +CREATE SEQUENCE project_statistics_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_statistics_id_seq OWNED BY project_statistics.id; + +CREATE TABLE project_tracing_settings ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id integer NOT NULL, + external_url character varying NOT NULL +); + +CREATE SEQUENCE project_tracing_settings_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE project_tracing_settings_id_seq OWNED BY project_tracing_settings.id; + +CREATE TABLE projects ( + id integer NOT NULL, + name character varying, + path character varying, + description text, + created_at timestamp without time zone, + updated_at timestamp without time zone, + creator_id integer, + namespace_id integer NOT NULL, + last_activity_at timestamp without time zone, + import_url character varying, + visibility_level integer DEFAULT 0 NOT NULL, + archived boolean DEFAULT false NOT NULL, + avatar character varying, + star_count integer DEFAULT 0 NOT NULL, + merge_requests_rebase_enabled boolean DEFAULT false, + import_type character varying, + import_source character varying, + merge_requests_ff_only_enabled boolean DEFAULT false NOT NULL, + shared_runners_enabled boolean DEFAULT true NOT NULL, + runners_token character varying, + build_coverage_regex character varying, + build_allow_git_fetch boolean DEFAULT true NOT NULL, + build_timeout integer DEFAULT 3600 NOT NULL, + pending_delete boolean DEFAULT false, + public_builds boolean DEFAULT true NOT NULL, + last_repository_check_failed boolean, + last_repository_check_at timestamp without time zone, + container_registry_enabled boolean, + only_allow_merge_if_pipeline_succeeds boolean DEFAULT false NOT NULL, + has_external_issue_tracker boolean, + repository_storage character varying DEFAULT 'default'::character varying NOT NULL, + repository_read_only boolean, + request_access_enabled boolean DEFAULT true NOT NULL, + has_external_wiki boolean, + ci_config_path character varying, + lfs_enabled boolean, + description_html text, + only_allow_merge_if_all_discussions_are_resolved boolean, + printing_merge_request_link_enabled boolean DEFAULT true NOT NULL, + auto_cancel_pending_pipelines integer DEFAULT 1 NOT NULL, + cached_markdown_version integer, + delete_error text, + last_repository_updated_at timestamp without time zone, + storage_version smallint, + resolve_outdated_diff_discussions boolean, + external_authorization_classification_label character varying, + jobs_cache_index integer, + pages_https_only boolean DEFAULT true, + remote_mirror_available_overridden boolean, + pool_repository_id bigint, + runners_token_encrypted character varying, + bfg_object_map character varying, + detected_repository_languages boolean, + disable_overriding_approvers_per_merge_request boolean, + external_webhook_token character varying, + issues_template text, + merge_requests_author_approval boolean, + merge_requests_disable_committers_approval boolean, + merge_requests_template text, + mirror_last_successful_update_at timestamp without time zone, + mirror_last_update_at timestamp without time zone, + mirror_overwrites_diverged_branches boolean, + mirror_user_id integer, + only_mirror_protected_branches boolean, + packages_enabled boolean, + pull_mirror_available_overridden boolean, + repository_size_limit bigint, + require_password_to_approve boolean, + mirror boolean DEFAULT false NOT NULL, + mirror_trigger_builds boolean DEFAULT false NOT NULL, + reset_approvals_on_push boolean DEFAULT true, + service_desk_enabled boolean DEFAULT true, + approvals_before_merge integer DEFAULT 0 NOT NULL, + emails_disabled boolean, + max_pages_size integer, + max_artifacts_size integer, + pull_mirror_branch_prefix character varying(50), + marked_for_deletion_at date, + marked_for_deletion_by_user_id integer, + remove_source_branch_after_merge boolean, + suggestion_commit_message character varying(255) +); + +CREATE SEQUENCE projects_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE projects_id_seq OWNED BY projects.id; + +CREATE TABLE prometheus_alert_events ( + id bigint NOT NULL, + project_id integer NOT NULL, + prometheus_alert_id integer NOT NULL, + started_at timestamp with time zone NOT NULL, + ended_at timestamp with time zone, + status smallint, + payload_key character varying +); + +CREATE SEQUENCE prometheus_alert_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE prometheus_alert_events_id_seq OWNED BY prometheus_alert_events.id; + +CREATE TABLE prometheus_alerts ( + id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + threshold double precision NOT NULL, + operator integer NOT NULL, + environment_id integer NOT NULL, + project_id integer NOT NULL, + prometheus_metric_id integer NOT NULL +); + +CREATE SEQUENCE prometheus_alerts_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE prometheus_alerts_id_seq OWNED BY prometheus_alerts.id; + +CREATE TABLE prometheus_metrics ( + id integer NOT NULL, + project_id integer, + title character varying NOT NULL, + query character varying NOT NULL, + y_label character varying NOT NULL, + unit character varying NOT NULL, + legend character varying, + "group" integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + common boolean DEFAULT false NOT NULL, + identifier character varying +); + +CREATE SEQUENCE prometheus_metrics_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE prometheus_metrics_id_seq OWNED BY prometheus_metrics.id; + +CREATE TABLE protected_branch_merge_access_levels ( + id integer NOT NULL, + protected_branch_id integer NOT NULL, + access_level integer DEFAULT 40, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + group_id integer, + user_id integer +); + +CREATE SEQUENCE protected_branch_merge_access_levels_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE protected_branch_merge_access_levels_id_seq OWNED BY protected_branch_merge_access_levels.id; + +CREATE TABLE protected_branch_push_access_levels ( + id integer NOT NULL, + protected_branch_id integer NOT NULL, + access_level integer DEFAULT 40, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + group_id integer, + user_id integer +); + +CREATE SEQUENCE protected_branch_push_access_levels_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE protected_branch_push_access_levels_id_seq OWNED BY protected_branch_push_access_levels.id; + +CREATE TABLE protected_branch_unprotect_access_levels ( + id integer NOT NULL, + protected_branch_id integer NOT NULL, + access_level integer DEFAULT 40, + user_id integer, + group_id integer +); + +CREATE SEQUENCE protected_branch_unprotect_access_levels_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE protected_branch_unprotect_access_levels_id_seq OWNED BY protected_branch_unprotect_access_levels.id; + +CREATE TABLE protected_branches ( + id integer NOT NULL, + project_id integer NOT NULL, + name character varying NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + code_owner_approval_required boolean DEFAULT false NOT NULL +); + +CREATE SEQUENCE protected_branches_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE protected_branches_id_seq OWNED BY protected_branches.id; + +CREATE TABLE protected_environment_deploy_access_levels ( + id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + access_level integer DEFAULT 40, + protected_environment_id integer NOT NULL, + user_id integer, + group_id integer +); + +CREATE SEQUENCE protected_environment_deploy_access_levels_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE protected_environment_deploy_access_levels_id_seq OWNED BY protected_environment_deploy_access_levels.id; + +CREATE TABLE protected_environments ( + id integer NOT NULL, + project_id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + name character varying NOT NULL +); + +CREATE SEQUENCE protected_environments_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE protected_environments_id_seq OWNED BY protected_environments.id; + +CREATE TABLE protected_tag_create_access_levels ( + id integer NOT NULL, + protected_tag_id integer NOT NULL, + access_level integer DEFAULT 40, + user_id integer, + group_id integer, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE protected_tag_create_access_levels_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE protected_tag_create_access_levels_id_seq OWNED BY protected_tag_create_access_levels.id; + +CREATE TABLE protected_tags ( + id integer NOT NULL, + project_id integer NOT NULL, + name character varying NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE protected_tags_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE protected_tags_id_seq OWNED BY protected_tags.id; + +CREATE TABLE push_event_payloads ( + commit_count bigint NOT NULL, + event_id integer NOT NULL, + action smallint NOT NULL, + ref_type smallint NOT NULL, + commit_from bytea, + commit_to bytea, + ref text, + commit_title character varying(70), + ref_count integer +); + +CREATE TABLE push_rules ( + id integer NOT NULL, + force_push_regex character varying, + delete_branch_regex character varying, + commit_message_regex character varying, + deny_delete_tag boolean, + project_id integer, + created_at timestamp without time zone, + updated_at timestamp without time zone, + author_email_regex character varying, + member_check boolean DEFAULT false NOT NULL, + file_name_regex character varying, + is_sample boolean DEFAULT false, + max_file_size integer DEFAULT 0 NOT NULL, + prevent_secrets boolean DEFAULT false NOT NULL, + branch_name_regex character varying, + reject_unsigned_commits boolean, + commit_committer_check boolean, + regexp_uses_re2 boolean DEFAULT true, + commit_message_negative_regex character varying +); + +CREATE SEQUENCE push_rules_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE push_rules_id_seq OWNED BY push_rules.id; + +CREATE TABLE redirect_routes ( + id integer NOT NULL, + source_id integer NOT NULL, + source_type character varying NOT NULL, + path character varying NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE redirect_routes_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE redirect_routes_id_seq OWNED BY redirect_routes.id; + +CREATE TABLE release_links ( + id bigint NOT NULL, + release_id integer NOT NULL, + url character varying NOT NULL, + name character varying NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE release_links_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE release_links_id_seq OWNED BY release_links.id; + +CREATE TABLE releases ( + id integer NOT NULL, + tag character varying, + description text, + project_id integer, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + description_html text, + cached_markdown_version integer, + author_id integer, + name character varying, + sha character varying, + released_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE releases_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE releases_id_seq OWNED BY releases.id; + +CREATE TABLE remote_mirrors ( + id integer NOT NULL, + project_id integer, + url character varying, + enabled boolean DEFAULT false, + update_status character varying, + last_update_at timestamp without time zone, + last_successful_update_at timestamp without time zone, + last_update_started_at timestamp without time zone, + last_error character varying, + only_protected_branches boolean DEFAULT false NOT NULL, + remote_name character varying, + encrypted_credentials text, + encrypted_credentials_iv character varying, + encrypted_credentials_salt character varying, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + error_notification_sent boolean +); + +CREATE SEQUENCE remote_mirrors_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE remote_mirrors_id_seq OWNED BY remote_mirrors.id; + +CREATE TABLE repository_languages ( + project_id integer NOT NULL, + programming_language_id integer NOT NULL, + share double precision NOT NULL +); + +CREATE TABLE resource_label_events ( + id bigint NOT NULL, + action integer NOT NULL, + issue_id integer, + merge_request_id integer, + label_id integer, + user_id integer, + created_at timestamp with time zone NOT NULL, + cached_markdown_version integer, + reference text, + reference_html text, + epic_id integer +); + +CREATE SEQUENCE resource_label_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE resource_label_events_id_seq OWNED BY resource_label_events.id; + +CREATE TABLE resource_weight_events ( + id bigint NOT NULL, + user_id bigint NOT NULL, + issue_id bigint NOT NULL, + weight integer, + created_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE resource_weight_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE resource_weight_events_id_seq OWNED BY resource_weight_events.id; + +CREATE TABLE reviews ( + id bigint NOT NULL, + author_id integer, + merge_request_id integer NOT NULL, + project_id integer NOT NULL, + created_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE reviews_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE reviews_id_seq OWNED BY reviews.id; + +CREATE TABLE routes ( + id integer NOT NULL, + source_id integer NOT NULL, + source_type character varying NOT NULL, + path character varying NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + name character varying +); + +CREATE SEQUENCE routes_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE routes_id_seq OWNED BY routes.id; + +CREATE TABLE saml_providers ( + id integer NOT NULL, + group_id integer NOT NULL, + enabled boolean NOT NULL, + certificate_fingerprint character varying NOT NULL, + sso_url character varying NOT NULL, + enforced_sso boolean DEFAULT false NOT NULL, + enforced_group_managed_accounts boolean DEFAULT false NOT NULL, + prohibited_outer_forks boolean DEFAULT false +); + +CREATE SEQUENCE saml_providers_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE saml_providers_id_seq OWNED BY saml_providers.id; + +CREATE TABLE scim_oauth_access_tokens ( + id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + group_id integer NOT NULL, + token_encrypted character varying NOT NULL +); + +CREATE SEQUENCE scim_oauth_access_tokens_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE scim_oauth_access_tokens_id_seq OWNED BY scim_oauth_access_tokens.id; + +CREATE TABLE self_managed_prometheus_alert_events ( + id bigint NOT NULL, + project_id bigint NOT NULL, + environment_id bigint, + started_at timestamp with time zone NOT NULL, + ended_at timestamp with time zone, + status smallint NOT NULL, + title character varying(255) NOT NULL, + query_expression character varying(255), + payload_key character varying(255) NOT NULL +); + +CREATE SEQUENCE self_managed_prometheus_alert_events_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE self_managed_prometheus_alert_events_id_seq OWNED BY self_managed_prometheus_alert_events.id; + +CREATE TABLE sent_notifications ( + id integer NOT NULL, + project_id integer, + noteable_type character varying, + noteable_id integer, + recipient_id integer, + commit_id character varying, + reply_key character varying NOT NULL, + line_code character varying, + note_type character varying, + "position" text, + in_reply_to_discussion_id character varying +); + +CREATE SEQUENCE sent_notifications_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE sent_notifications_id_seq OWNED BY sent_notifications.id; + +CREATE TABLE sentry_issues ( + id bigint NOT NULL, + issue_id bigint NOT NULL, + sentry_issue_identifier bigint NOT NULL +); + +CREATE SEQUENCE sentry_issues_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE sentry_issues_id_seq OWNED BY sentry_issues.id; + +CREATE TABLE serverless_domain_cluster ( + pages_domain_id bigint NOT NULL, + clusters_applications_knative_id bigint NOT NULL, + creator_id bigint, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + uuid character varying(14) NOT NULL +); + +CREATE TABLE service_desk_settings ( + project_id bigint NOT NULL, + issue_template_key character varying(255), + outgoing_name character varying(255) +); + +CREATE TABLE services ( + id integer NOT NULL, + type character varying, + title character varying, + project_id integer, + created_at timestamp without time zone, + updated_at timestamp without time zone, + active boolean DEFAULT false NOT NULL, + properties text, + template boolean DEFAULT false, + push_events boolean DEFAULT true, + issues_events boolean DEFAULT true, + merge_requests_events boolean DEFAULT true, + tag_push_events boolean DEFAULT true, + note_events boolean DEFAULT true NOT NULL, + category character varying DEFAULT 'common'::character varying NOT NULL, + "default" boolean DEFAULT false, + wiki_page_events boolean DEFAULT true, + pipeline_events boolean DEFAULT false NOT NULL, + confidential_issues_events boolean DEFAULT true NOT NULL, + commit_events boolean DEFAULT true NOT NULL, + job_events boolean DEFAULT false NOT NULL, + confidential_note_events boolean DEFAULT true, + deployment_events boolean DEFAULT false NOT NULL, + description character varying(500), + comment_on_event_enabled boolean DEFAULT true NOT NULL +); + +CREATE SEQUENCE services_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE services_id_seq OWNED BY services.id; + +CREATE TABLE shards ( + id integer NOT NULL, + name character varying NOT NULL +); + +CREATE SEQUENCE shards_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE shards_id_seq OWNED BY shards.id; + +CREATE TABLE slack_integrations ( + id integer NOT NULL, + service_id integer NOT NULL, + team_id character varying NOT NULL, + team_name character varying NOT NULL, + alias character varying NOT NULL, + user_id character varying NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE slack_integrations_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE slack_integrations_id_seq OWNED BY slack_integrations.id; + +CREATE TABLE smartcard_identities ( + id bigint NOT NULL, + user_id integer NOT NULL, + subject character varying NOT NULL, + issuer character varying NOT NULL +); + +CREATE SEQUENCE smartcard_identities_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE smartcard_identities_id_seq OWNED BY smartcard_identities.id; + +CREATE TABLE snippet_user_mentions ( + id bigint NOT NULL, + snippet_id integer NOT NULL, + note_id integer, + mentioned_users_ids integer[], + mentioned_projects_ids integer[], + mentioned_groups_ids integer[] +); + +CREATE SEQUENCE snippet_user_mentions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE snippet_user_mentions_id_seq OWNED BY snippet_user_mentions.id; + +CREATE TABLE snippets ( + id integer NOT NULL, + title character varying, + content text, + author_id integer NOT NULL, + project_id integer, + created_at timestamp without time zone, + updated_at timestamp without time zone, + file_name character varying, + type character varying, + visibility_level integer DEFAULT 0 NOT NULL, + title_html text, + content_html text, + cached_markdown_version integer, + description text, + description_html text, + encrypted_secret_token character varying(255), + encrypted_secret_token_iv character varying(255), + secret boolean DEFAULT false NOT NULL, + repository_storage character varying(255) DEFAULT 'default'::character varying NOT NULL, + storage_version integer DEFAULT 2 NOT NULL +); + +CREATE SEQUENCE snippets_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE snippets_id_seq OWNED BY snippets.id; + +CREATE TABLE software_license_policies ( + id integer NOT NULL, + project_id integer NOT NULL, + software_license_id integer NOT NULL, + classification integer DEFAULT 0, + CONSTRAINT check_8e8751b568 CHECK ((classification IS NOT NULL)) +); + +CREATE SEQUENCE software_license_policies_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE software_license_policies_id_seq OWNED BY software_license_policies.id; + +CREATE TABLE software_licenses ( + id integer NOT NULL, + name character varying NOT NULL, + spdx_identifier character varying(255) +); + +CREATE SEQUENCE software_licenses_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE software_licenses_id_seq OWNED BY software_licenses.id; + +CREATE TABLE spam_logs ( + id integer NOT NULL, + user_id integer, + source_ip character varying, + user_agent character varying, + via_api boolean, + noteable_type character varying, + title character varying, + description text, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + submitted_as_ham boolean DEFAULT false NOT NULL, + recaptcha_verified boolean DEFAULT false NOT NULL +); + +CREATE SEQUENCE spam_logs_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE spam_logs_id_seq OWNED BY spam_logs.id; + +CREATE TABLE subscriptions ( + id integer NOT NULL, + user_id integer, + subscribable_type character varying, + subscribable_id integer, + subscribed boolean, + created_at timestamp without time zone, + updated_at timestamp without time zone, + project_id integer +); + +CREATE SEQUENCE subscriptions_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE subscriptions_id_seq OWNED BY subscriptions.id; + +CREATE TABLE suggestions ( + id bigint NOT NULL, + note_id integer NOT NULL, + relative_order smallint NOT NULL, + applied boolean DEFAULT false NOT NULL, + commit_id character varying, + from_content text NOT NULL, + to_content text NOT NULL, + lines_above integer DEFAULT 0 NOT NULL, + lines_below integer DEFAULT 0 NOT NULL, + outdated boolean DEFAULT false NOT NULL +); + +CREATE SEQUENCE suggestions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE suggestions_id_seq OWNED BY suggestions.id; + +CREATE TABLE system_note_metadata ( + id integer NOT NULL, + note_id integer NOT NULL, + commit_count integer, + action character varying, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + description_version_id bigint +); + +CREATE SEQUENCE system_note_metadata_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE system_note_metadata_id_seq OWNED BY system_note_metadata.id; + +CREATE TABLE taggings ( + id integer NOT NULL, + tag_id integer, + taggable_id integer, + taggable_type character varying, + tagger_id integer, + tagger_type character varying, + context character varying, + created_at timestamp without time zone +); + +CREATE SEQUENCE taggings_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE taggings_id_seq OWNED BY taggings.id; + +CREATE TABLE tags ( + id integer NOT NULL, + name character varying, + taggings_count integer DEFAULT 0 +); + +CREATE SEQUENCE tags_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE tags_id_seq OWNED BY tags.id; + +CREATE TABLE term_agreements ( + id integer NOT NULL, + term_id integer NOT NULL, + user_id integer NOT NULL, + accepted boolean DEFAULT false NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE term_agreements_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE term_agreements_id_seq OWNED BY term_agreements.id; + +CREATE TABLE timelogs ( + id integer NOT NULL, + time_spent integer NOT NULL, + user_id integer, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + issue_id integer, + merge_request_id integer, + spent_at timestamp with time zone +); + +CREATE SEQUENCE timelogs_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE timelogs_id_seq OWNED BY timelogs.id; + +CREATE TABLE todos ( + id integer NOT NULL, + user_id integer NOT NULL, + project_id integer, + target_type character varying NOT NULL, + target_id integer, + author_id integer NOT NULL, + action integer NOT NULL, + state character varying NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone, + note_id integer, + commit_id character varying, + group_id integer +); + +CREATE SEQUENCE todos_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE todos_id_seq OWNED BY todos.id; + +CREATE TABLE trending_projects ( + id integer NOT NULL, + project_id integer NOT NULL +); + +CREATE SEQUENCE trending_projects_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE trending_projects_id_seq OWNED BY trending_projects.id; + +CREATE TABLE u2f_registrations ( + id integer NOT NULL, + certificate text, + key_handle character varying, + public_key character varying, + counter integer, + user_id integer, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL, + name character varying +); + +CREATE SEQUENCE u2f_registrations_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE u2f_registrations_id_seq OWNED BY u2f_registrations.id; + +CREATE TABLE uploads ( + id integer NOT NULL, + size bigint NOT NULL, + path character varying(511) NOT NULL, + checksum character varying(64), + model_type character varying, + model_id integer, + uploader character varying NOT NULL, + created_at timestamp without time zone NOT NULL, + store integer, + mount_point character varying, + secret character varying +); + +CREATE SEQUENCE uploads_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE uploads_id_seq OWNED BY uploads.id; + +CREATE TABLE user_agent_details ( + id integer NOT NULL, + user_agent character varying NOT NULL, + ip_address character varying NOT NULL, + subject_id integer NOT NULL, + subject_type character varying NOT NULL, + submitted boolean DEFAULT false NOT NULL, + created_at timestamp without time zone NOT NULL, + updated_at timestamp without time zone NOT NULL +); + +CREATE SEQUENCE user_agent_details_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE user_agent_details_id_seq OWNED BY user_agent_details.id; + +CREATE TABLE user_callouts ( + id integer NOT NULL, + feature_name integer NOT NULL, + user_id integer NOT NULL +); + +CREATE SEQUENCE user_callouts_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE user_callouts_id_seq OWNED BY user_callouts.id; + +CREATE TABLE user_custom_attributes ( + id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + user_id integer NOT NULL, + key character varying NOT NULL, + value character varying NOT NULL +); + +CREATE SEQUENCE user_custom_attributes_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE user_custom_attributes_id_seq OWNED BY user_custom_attributes.id; + +CREATE TABLE user_interacted_projects ( + user_id integer NOT NULL, + project_id integer NOT NULL +); + +CREATE TABLE user_preferences ( + id integer NOT NULL, + user_id integer NOT NULL, + issue_notes_filter smallint DEFAULT 0 NOT NULL, + merge_request_notes_filter smallint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + first_day_of_week integer, + issues_sort character varying, + merge_requests_sort character varying, + timezone character varying, + time_display_relative boolean, + time_format_in_24h boolean, + epic_notes_filter smallint DEFAULT 0 NOT NULL, + epics_sort character varying, + roadmap_epics_state integer, + roadmaps_sort character varying, + projects_sort character varying(64), + show_whitespace_in_diffs boolean DEFAULT true NOT NULL, + setup_for_company boolean, + sourcegraph_enabled boolean, + render_whitespace_in_code boolean, + tab_width smallint +); + +CREATE SEQUENCE user_preferences_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE user_preferences_id_seq OWNED BY user_preferences.id; + +CREATE TABLE user_statuses ( + user_id integer NOT NULL, + cached_markdown_version integer, + emoji character varying DEFAULT 'speech_balloon'::character varying NOT NULL, + message character varying(100), + message_html character varying +); + +CREATE SEQUENCE user_statuses_user_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE user_statuses_user_id_seq OWNED BY user_statuses.user_id; + +CREATE TABLE user_synced_attributes_metadata ( + id integer NOT NULL, + name_synced boolean DEFAULT false, + email_synced boolean DEFAULT false, + location_synced boolean DEFAULT false, + user_id integer NOT NULL, + provider character varying +); + +CREATE SEQUENCE user_synced_attributes_metadata_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE user_synced_attributes_metadata_id_seq OWNED BY user_synced_attributes_metadata.id; + +CREATE TABLE users ( + id integer NOT NULL, + email character varying DEFAULT ''::character varying NOT NULL, + encrypted_password character varying DEFAULT ''::character varying NOT NULL, + reset_password_token character varying, + reset_password_sent_at timestamp without time zone, + remember_created_at timestamp without time zone, + sign_in_count integer DEFAULT 0, + current_sign_in_at timestamp without time zone, + last_sign_in_at timestamp without time zone, + current_sign_in_ip character varying, + last_sign_in_ip character varying, + created_at timestamp without time zone, + updated_at timestamp without time zone, + name character varying, + admin boolean DEFAULT false NOT NULL, + projects_limit integer NOT NULL, + skype character varying DEFAULT ''::character varying NOT NULL, + linkedin character varying DEFAULT ''::character varying NOT NULL, + twitter character varying DEFAULT ''::character varying NOT NULL, + bio character varying, + failed_attempts integer DEFAULT 0, + locked_at timestamp without time zone, + username character varying, + can_create_group boolean DEFAULT true NOT NULL, + can_create_team boolean DEFAULT true NOT NULL, + state character varying, + color_scheme_id integer DEFAULT 1 NOT NULL, + password_expires_at timestamp without time zone, + created_by_id integer, + last_credential_check_at timestamp without time zone, + avatar character varying, + confirmation_token character varying, + confirmed_at timestamp without time zone, + confirmation_sent_at timestamp without time zone, + unconfirmed_email character varying, + hide_no_ssh_key boolean DEFAULT false, + website_url character varying DEFAULT ''::character varying NOT NULL, + notification_email character varying, + hide_no_password boolean DEFAULT false, + password_automatically_set boolean DEFAULT false, + location character varying, + encrypted_otp_secret character varying, + encrypted_otp_secret_iv character varying, + encrypted_otp_secret_salt character varying, + otp_required_for_login boolean DEFAULT false NOT NULL, + otp_backup_codes text, + public_email character varying DEFAULT ''::character varying NOT NULL, + dashboard integer DEFAULT 0, + project_view integer DEFAULT 0, + consumed_timestep integer, + layout integer DEFAULT 0, + hide_project_limit boolean DEFAULT false, + unlock_token character varying, + otp_grace_period_started_at timestamp without time zone, + external boolean DEFAULT false, + incoming_email_token character varying, + organization character varying, + require_two_factor_authentication_from_group boolean DEFAULT false NOT NULL, + two_factor_grace_period integer DEFAULT 48 NOT NULL, + ghost boolean, + last_activity_on date, + notified_of_own_activity boolean, + preferred_language character varying, + theme_id smallint, + include_private_contributions boolean, + feed_token character varying, + accepted_term_id integer, + private_profile boolean DEFAULT false NOT NULL, + commit_email character varying, + auditor boolean DEFAULT false NOT NULL, + admin_email_unsubscribed_at timestamp without time zone, + email_opted_in boolean, + email_opted_in_at timestamp without time zone, + email_opted_in_ip character varying, + email_opted_in_source_id integer, + group_view integer, + managing_group_id integer, + note text, + roadmap_layout smallint, + bot_type smallint, + static_object_token character varying(255), + first_name character varying(255), + last_name character varying(255), + role smallint +); + +CREATE SEQUENCE users_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE users_id_seq OWNED BY users.id; + +CREATE TABLE users_ops_dashboard_projects ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + user_id integer NOT NULL, + project_id integer NOT NULL +); + +CREATE SEQUENCE users_ops_dashboard_projects_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE users_ops_dashboard_projects_id_seq OWNED BY users_ops_dashboard_projects.id; + +CREATE TABLE users_security_dashboard_projects ( + user_id bigint NOT NULL, + project_id bigint NOT NULL +); + +CREATE TABLE users_star_projects ( + id integer NOT NULL, + project_id integer NOT NULL, + user_id integer NOT NULL, + created_at timestamp without time zone, + updated_at timestamp without time zone +); + +CREATE SEQUENCE users_star_projects_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE users_star_projects_id_seq OWNED BY users_star_projects.id; + +CREATE TABLE vulnerabilities ( + id bigint NOT NULL, + milestone_id bigint, + epic_id bigint, + project_id bigint NOT NULL, + author_id bigint NOT NULL, + updated_by_id bigint, + last_edited_by_id bigint, + start_date_sourcing_milestone_id bigint, + due_date_sourcing_milestone_id bigint, + closed_by_id bigint, + last_edited_at timestamp with time zone, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + closed_at timestamp with time zone, + start_date date, + due_date date, + state smallint DEFAULT 1 NOT NULL, + severity smallint NOT NULL, + confidence smallint NOT NULL, + severity_overridden boolean DEFAULT false, + confidence_overridden boolean DEFAULT false, + title character varying(255) NOT NULL, + title_html text, + description text, + description_html text, + report_type smallint NOT NULL, + cached_markdown_version integer, + resolved_by_id bigint, + resolved_at timestamp with time zone +); + +CREATE SEQUENCE vulnerabilities_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerabilities_id_seq OWNED BY vulnerabilities.id; + +CREATE TABLE vulnerability_feedback ( + id integer NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + feedback_type smallint NOT NULL, + category smallint NOT NULL, + project_id integer NOT NULL, + author_id integer NOT NULL, + pipeline_id integer, + issue_id integer, + project_fingerprint character varying(40) NOT NULL, + merge_request_id integer, + comment_author_id integer, + comment text, + comment_timestamp timestamp with time zone +); + +CREATE SEQUENCE vulnerability_feedback_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_feedback_id_seq OWNED BY vulnerability_feedback.id; + +CREATE TABLE vulnerability_identifiers ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id integer NOT NULL, + fingerprint bytea NOT NULL, + external_type character varying NOT NULL, + external_id character varying NOT NULL, + name character varying NOT NULL, + url text +); + +CREATE SEQUENCE vulnerability_identifiers_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_identifiers_id_seq OWNED BY vulnerability_identifiers.id; + +CREATE TABLE vulnerability_issue_links ( + id bigint NOT NULL, + vulnerability_id bigint NOT NULL, + issue_id bigint NOT NULL, + link_type smallint DEFAULT 1 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE vulnerability_issue_links_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_issue_links_id_seq OWNED BY vulnerability_issue_links.id; + +CREATE TABLE vulnerability_occurrence_identifiers ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + occurrence_id bigint NOT NULL, + identifier_id bigint NOT NULL +); + +CREATE SEQUENCE vulnerability_occurrence_identifiers_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_occurrence_identifiers_id_seq OWNED BY vulnerability_occurrence_identifiers.id; + +CREATE TABLE vulnerability_occurrence_pipelines ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + occurrence_id bigint NOT NULL, + pipeline_id integer NOT NULL +); + +CREATE SEQUENCE vulnerability_occurrence_pipelines_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_occurrence_pipelines_id_seq OWNED BY vulnerability_occurrence_pipelines.id; + +CREATE TABLE vulnerability_occurrences ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + severity smallint NOT NULL, + confidence smallint NOT NULL, + report_type smallint NOT NULL, + project_id integer NOT NULL, + scanner_id bigint NOT NULL, + primary_identifier_id bigint NOT NULL, + project_fingerprint bytea NOT NULL, + location_fingerprint bytea NOT NULL, + uuid character varying(36) NOT NULL, + name character varying NOT NULL, + metadata_version character varying NOT NULL, + raw_metadata text NOT NULL, + vulnerability_id bigint +); + +CREATE SEQUENCE vulnerability_occurrences_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_occurrences_id_seq OWNED BY vulnerability_occurrences.id; + +CREATE TABLE vulnerability_scanners ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id integer NOT NULL, + external_id character varying NOT NULL, + name character varying NOT NULL +); + +CREATE SEQUENCE vulnerability_scanners_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_scanners_id_seq OWNED BY vulnerability_scanners.id; + +CREATE TABLE web_hook_logs ( + id integer 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, + created_at timestamp without time zone NOT NULL, + 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, + created_at timestamp without time zone, + updated_at timestamp without time zone, + type character varying DEFAULT 'ProjectHook'::character varying, + service_id integer, + push_events boolean DEFAULT true NOT NULL, + issues_events boolean DEFAULT false NOT NULL, + merge_requests_events boolean DEFAULT false NOT NULL, + tag_push_events boolean DEFAULT false, + note_events boolean DEFAULT false NOT NULL, + enable_ssl_verification boolean DEFAULT true, + wiki_page_events boolean DEFAULT false NOT NULL, + pipeline_events boolean DEFAULT false NOT NULL, + confidential_issues_events boolean DEFAULT false NOT NULL, + repository_update_events boolean DEFAULT false NOT NULL, + job_events boolean DEFAULT false NOT NULL, + confidential_note_events boolean, + push_events_branch_filter text, + encrypted_token character varying, + encrypted_token_iv character varying, + encrypted_url character varying, + encrypted_url_iv character varying, + group_id integer +); + +CREATE SEQUENCE web_hooks_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE web_hooks_id_seq OWNED BY web_hooks.id; + +CREATE TABLE webauthn_registrations ( + id bigint NOT NULL, + user_id bigint NOT NULL, + counter bigint DEFAULT 0 NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + credential_xid text NOT NULL, + name text NOT NULL, + public_key text NOT NULL +); + +CREATE SEQUENCE webauthn_registrations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE webauthn_registrations_id_seq OWNED BY webauthn_registrations.id; + +CREATE TABLE x509_certificates ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + subject_key_identifier character varying(255) NOT NULL, + subject character varying(255) NOT NULL, + email character varying(255) NOT NULL, + serial_number bytea NOT NULL, + certificate_status smallint DEFAULT 0 NOT NULL, + x509_issuer_id bigint NOT NULL +); + +CREATE SEQUENCE x509_certificates_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE x509_certificates_id_seq OWNED BY x509_certificates.id; + +CREATE TABLE x509_commit_signatures ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id bigint NOT NULL, + x509_certificate_id bigint NOT NULL, + commit_sha bytea NOT NULL, + verification_status smallint DEFAULT 0 NOT NULL +); + +CREATE SEQUENCE x509_commit_signatures_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE x509_commit_signatures_id_seq OWNED BY x509_commit_signatures.id; + +CREATE TABLE x509_issuers ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + subject_key_identifier character varying(255) NOT NULL, + subject character varying(255) NOT NULL, + crl_url character varying(255) NOT NULL +); + +CREATE SEQUENCE x509_issuers_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE x509_issuers_id_seq OWNED BY x509_issuers.id; + +CREATE TABLE zoom_meetings ( + id bigint NOT NULL, + project_id bigint NOT NULL, + issue_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + issue_status smallint DEFAULT 1 NOT NULL, + url character varying(255) +); + +CREATE SEQUENCE zoom_meetings_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE zoom_meetings_id_seq OWNED BY zoom_meetings.id; + +ALTER TABLE ONLY abuse_reports ALTER COLUMN id SET DEFAULT nextval('abuse_reports_id_seq'::regclass); + +ALTER TABLE ONLY alerts_service_data ALTER COLUMN id SET DEFAULT nextval('alerts_service_data_id_seq'::regclass); + +ALTER TABLE ONLY allowed_email_domains ALTER COLUMN id SET DEFAULT nextval('allowed_email_domains_id_seq'::regclass); + +ALTER TABLE ONLY analytics_cycle_analytics_group_stages ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_group_stages_id_seq'::regclass); + +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_repository_file_commits ALTER COLUMN id SET DEFAULT nextval('analytics_repository_file_commits_id_seq'::regclass); + +ALTER TABLE ONLY analytics_repository_file_edits ALTER COLUMN id SET DEFAULT nextval('analytics_repository_file_edits_id_seq'::regclass); + +ALTER TABLE ONLY analytics_repository_files ALTER COLUMN id SET DEFAULT nextval('analytics_repository_files_id_seq'::regclass); + +ALTER TABLE ONLY appearances ALTER COLUMN id SET DEFAULT nextval('appearances_id_seq'::regclass); + +ALTER TABLE ONLY application_setting_terms ALTER COLUMN id SET DEFAULT nextval('application_setting_terms_id_seq'::regclass); + +ALTER TABLE ONLY application_settings ALTER COLUMN id SET DEFAULT nextval('application_settings_id_seq'::regclass); + +ALTER TABLE ONLY approval_merge_request_rule_sources ALTER COLUMN id SET DEFAULT nextval('approval_merge_request_rule_sources_id_seq'::regclass); + +ALTER TABLE ONLY approval_merge_request_rules ALTER COLUMN id SET DEFAULT nextval('approval_merge_request_rules_id_seq'::regclass); + +ALTER TABLE ONLY approval_merge_request_rules_approved_approvers ALTER COLUMN id SET DEFAULT nextval('approval_merge_request_rules_approved_approvers_id_seq'::regclass); + +ALTER TABLE ONLY approval_merge_request_rules_groups ALTER COLUMN id SET DEFAULT nextval('approval_merge_request_rules_groups_id_seq'::regclass); + +ALTER TABLE ONLY approval_merge_request_rules_users ALTER COLUMN id SET DEFAULT nextval('approval_merge_request_rules_users_id_seq'::regclass); + +ALTER TABLE ONLY approval_project_rules ALTER COLUMN id SET DEFAULT nextval('approval_project_rules_id_seq'::regclass); + +ALTER TABLE ONLY approval_project_rules_groups ALTER COLUMN id SET DEFAULT nextval('approval_project_rules_groups_id_seq'::regclass); + +ALTER TABLE ONLY approval_project_rules_users ALTER COLUMN id SET DEFAULT nextval('approval_project_rules_users_id_seq'::regclass); + +ALTER TABLE ONLY approvals ALTER COLUMN id SET DEFAULT nextval('approvals_id_seq'::regclass); + +ALTER TABLE ONLY approver_groups ALTER COLUMN id SET DEFAULT nextval('approver_groups_id_seq'::regclass); + +ALTER TABLE ONLY approvers ALTER COLUMN id SET DEFAULT nextval('approvers_id_seq'::regclass); + +ALTER TABLE ONLY audit_events ALTER COLUMN id SET DEFAULT nextval('audit_events_id_seq'::regclass); + +ALTER TABLE ONLY award_emoji ALTER COLUMN id SET DEFAULT nextval('award_emoji_id_seq'::regclass); + +ALTER TABLE ONLY badges ALTER COLUMN id SET DEFAULT nextval('badges_id_seq'::regclass); + +ALTER TABLE ONLY board_assignees ALTER COLUMN id SET DEFAULT nextval('board_assignees_id_seq'::regclass); + +ALTER TABLE ONLY board_group_recent_visits ALTER COLUMN id SET DEFAULT nextval('board_group_recent_visits_id_seq'::regclass); + +ALTER TABLE ONLY board_labels ALTER COLUMN id SET DEFAULT nextval('board_labels_id_seq'::regclass); + +ALTER TABLE ONLY board_project_recent_visits ALTER COLUMN id SET DEFAULT nextval('board_project_recent_visits_id_seq'::regclass); + +ALTER TABLE ONLY boards ALTER COLUMN id SET DEFAULT nextval('boards_id_seq'::regclass); + +ALTER TABLE ONLY broadcast_messages ALTER COLUMN id SET DEFAULT nextval('broadcast_messages_id_seq'::regclass); + +ALTER TABLE ONLY chat_names ALTER COLUMN id SET DEFAULT nextval('chat_names_id_seq'::regclass); + +ALTER TABLE ONLY chat_teams ALTER COLUMN id SET DEFAULT nextval('chat_teams_id_seq'::regclass); + +ALTER TABLE ONLY ci_build_needs ALTER COLUMN id SET DEFAULT nextval('ci_build_needs_id_seq'::regclass); + +ALTER TABLE ONLY ci_build_trace_chunks ALTER COLUMN id SET DEFAULT nextval('ci_build_trace_chunks_id_seq'::regclass); + +ALTER TABLE ONLY ci_build_trace_section_names ALTER COLUMN id SET DEFAULT nextval('ci_build_trace_section_names_id_seq'::regclass); + +ALTER TABLE ONLY ci_builds ALTER COLUMN id SET DEFAULT nextval('ci_builds_id_seq'::regclass); + +ALTER TABLE ONLY ci_builds_metadata ALTER COLUMN id SET DEFAULT nextval('ci_builds_metadata_id_seq'::regclass); + +ALTER TABLE ONLY ci_builds_runner_session ALTER COLUMN id SET DEFAULT nextval('ci_builds_runner_session_id_seq'::regclass); + +ALTER TABLE ONLY ci_group_variables ALTER COLUMN id SET DEFAULT nextval('ci_group_variables_id_seq'::regclass); + +ALTER TABLE ONLY ci_job_artifacts ALTER COLUMN id SET DEFAULT nextval('ci_job_artifacts_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_pipeline_chat_data ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_chat_data_id_seq'::regclass); + +ALTER TABLE ONLY ci_pipeline_schedule_variables ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_schedule_variables_id_seq'::regclass); + +ALTER TABLE ONLY ci_pipeline_schedules ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_schedules_id_seq'::regclass); + +ALTER TABLE ONLY ci_pipeline_variables ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_variables_id_seq'::regclass); + +ALTER TABLE ONLY ci_pipelines ALTER COLUMN id SET DEFAULT nextval('ci_pipelines_id_seq'::regclass); + +ALTER TABLE ONLY ci_pipelines_config ALTER COLUMN pipeline_id SET DEFAULT nextval('ci_pipelines_config_pipeline_id_seq'::regclass); + +ALTER TABLE ONLY ci_refs ALTER COLUMN id SET DEFAULT nextval('ci_refs_id_seq'::regclass); + +ALTER TABLE ONLY ci_resource_groups ALTER COLUMN id SET DEFAULT nextval('ci_resource_groups_id_seq'::regclass); + +ALTER TABLE ONLY ci_resources ALTER COLUMN id SET DEFAULT nextval('ci_resources_id_seq'::regclass); + +ALTER TABLE ONLY ci_runner_namespaces ALTER COLUMN id SET DEFAULT nextval('ci_runner_namespaces_id_seq'::regclass); + +ALTER TABLE ONLY ci_runner_projects ALTER COLUMN id SET DEFAULT nextval('ci_runner_projects_id_seq'::regclass); + +ALTER TABLE ONLY ci_runners ALTER COLUMN id SET DEFAULT nextval('ci_runners_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_stages ALTER COLUMN id SET DEFAULT nextval('ci_stages_id_seq'::regclass); + +ALTER TABLE ONLY ci_subscriptions_projects ALTER COLUMN id SET DEFAULT nextval('ci_subscriptions_projects_id_seq'::regclass); + +ALTER TABLE ONLY ci_trigger_requests ALTER COLUMN id SET DEFAULT nextval('ci_trigger_requests_id_seq'::regclass); + +ALTER TABLE ONLY ci_triggers ALTER COLUMN id SET DEFAULT nextval('ci_triggers_id_seq'::regclass); + +ALTER TABLE ONLY ci_variables ALTER COLUMN id SET DEFAULT nextval('ci_variables_id_seq'::regclass); + +ALTER TABLE ONLY cluster_groups ALTER COLUMN id SET DEFAULT nextval('cluster_groups_id_seq'::regclass); + +ALTER TABLE ONLY cluster_platforms_kubernetes ALTER COLUMN id SET DEFAULT nextval('cluster_platforms_kubernetes_id_seq'::regclass); + +ALTER TABLE ONLY cluster_projects ALTER COLUMN id SET DEFAULT nextval('cluster_projects_id_seq'::regclass); + +ALTER TABLE ONLY cluster_providers_aws ALTER COLUMN id SET DEFAULT nextval('cluster_providers_aws_id_seq'::regclass); + +ALTER TABLE ONLY cluster_providers_gcp ALTER COLUMN id SET DEFAULT nextval('cluster_providers_gcp_id_seq'::regclass); + +ALTER TABLE ONLY clusters ALTER COLUMN id SET DEFAULT nextval('clusters_id_seq'::regclass); + +ALTER TABLE ONLY clusters_applications_cert_managers ALTER COLUMN id SET DEFAULT nextval('clusters_applications_cert_managers_id_seq'::regclass); + +ALTER TABLE ONLY clusters_applications_crossplane ALTER COLUMN id SET DEFAULT nextval('clusters_applications_crossplane_id_seq'::regclass); + +ALTER TABLE ONLY clusters_applications_elastic_stacks ALTER COLUMN id SET DEFAULT nextval('clusters_applications_elastic_stacks_id_seq'::regclass); + +ALTER TABLE ONLY clusters_applications_helm ALTER COLUMN id SET DEFAULT nextval('clusters_applications_helm_id_seq'::regclass); + +ALTER TABLE ONLY clusters_applications_ingress ALTER COLUMN id SET DEFAULT nextval('clusters_applications_ingress_id_seq'::regclass); + +ALTER TABLE ONLY clusters_applications_jupyter ALTER COLUMN id SET DEFAULT nextval('clusters_applications_jupyter_id_seq'::regclass); + +ALTER TABLE ONLY clusters_applications_knative ALTER COLUMN id SET DEFAULT nextval('clusters_applications_knative_id_seq'::regclass); + +ALTER TABLE ONLY clusters_applications_prometheus ALTER COLUMN id SET DEFAULT nextval('clusters_applications_prometheus_id_seq'::regclass); + +ALTER TABLE ONLY clusters_applications_runners ALTER COLUMN id SET DEFAULT nextval('clusters_applications_runners_id_seq'::regclass); + +ALTER TABLE ONLY clusters_kubernetes_namespaces ALTER COLUMN id SET DEFAULT nextval('clusters_kubernetes_namespaces_id_seq'::regclass); + +ALTER TABLE ONLY commit_user_mentions ALTER COLUMN id SET DEFAULT nextval('commit_user_mentions_id_seq'::regclass); + +ALTER TABLE ONLY container_repositories ALTER COLUMN id SET DEFAULT nextval('container_repositories_id_seq'::regclass); + +ALTER TABLE ONLY conversational_development_index_metrics ALTER COLUMN id SET DEFAULT nextval('conversational_development_index_metrics_id_seq'::regclass); + +ALTER TABLE ONLY dependency_proxy_blobs ALTER COLUMN id SET DEFAULT nextval('dependency_proxy_blobs_id_seq'::regclass); + +ALTER TABLE ONLY dependency_proxy_group_settings ALTER COLUMN id SET DEFAULT nextval('dependency_proxy_group_settings_id_seq'::regclass); + +ALTER TABLE ONLY deploy_keys_projects ALTER COLUMN id SET DEFAULT nextval('deploy_keys_projects_id_seq'::regclass); + +ALTER TABLE ONLY deploy_tokens ALTER COLUMN id SET DEFAULT nextval('deploy_tokens_id_seq'::regclass); + +ALTER TABLE ONLY deployments ALTER COLUMN id SET DEFAULT nextval('deployments_id_seq'::regclass); + +ALTER TABLE ONLY description_versions ALTER COLUMN id SET DEFAULT nextval('description_versions_id_seq'::regclass); + +ALTER TABLE ONLY design_management_designs ALTER COLUMN id SET DEFAULT nextval('design_management_designs_id_seq'::regclass); + +ALTER TABLE ONLY design_management_versions ALTER COLUMN id SET DEFAULT nextval('design_management_versions_id_seq'::regclass); + +ALTER TABLE ONLY design_user_mentions ALTER COLUMN id SET DEFAULT nextval('design_user_mentions_id_seq'::regclass); + +ALTER TABLE ONLY draft_notes ALTER COLUMN id SET DEFAULT nextval('draft_notes_id_seq'::regclass); + +ALTER TABLE ONLY emails ALTER COLUMN id SET DEFAULT nextval('emails_id_seq'::regclass); + +ALTER TABLE ONLY environments ALTER COLUMN id SET DEFAULT nextval('environments_id_seq'::regclass); + +ALTER TABLE ONLY epic_issues ALTER COLUMN id SET DEFAULT nextval('epic_issues_id_seq'::regclass); + +ALTER TABLE ONLY epic_metrics ALTER COLUMN id SET DEFAULT nextval('epic_metrics_id_seq'::regclass); + +ALTER TABLE ONLY epic_user_mentions ALTER COLUMN id SET DEFAULT nextval('epic_user_mentions_id_seq'::regclass); + +ALTER TABLE ONLY epics ALTER COLUMN id SET DEFAULT nextval('epics_id_seq'::regclass); + +ALTER TABLE ONLY events ALTER COLUMN id SET DEFAULT nextval('events_id_seq'::regclass); + +ALTER TABLE ONLY evidences ALTER COLUMN id SET DEFAULT nextval('evidences_id_seq'::regclass); + +ALTER TABLE ONLY external_pull_requests ALTER COLUMN id SET DEFAULT nextval('external_pull_requests_id_seq'::regclass); + +ALTER TABLE ONLY feature_gates ALTER COLUMN id SET DEFAULT nextval('feature_gates_id_seq'::regclass); + +ALTER TABLE ONLY features ALTER COLUMN id SET DEFAULT nextval('features_id_seq'::regclass); + +ALTER TABLE ONLY fork_network_members ALTER COLUMN id SET DEFAULT nextval('fork_network_members_id_seq'::regclass); + +ALTER TABLE ONLY fork_networks ALTER COLUMN id SET DEFAULT nextval('fork_networks_id_seq'::regclass); + +ALTER TABLE ONLY forked_project_links ALTER COLUMN id SET DEFAULT nextval('forked_project_links_id_seq'::regclass); + +ALTER TABLE ONLY geo_cache_invalidation_events ALTER COLUMN id SET DEFAULT nextval('geo_cache_invalidation_events_id_seq'::regclass); + +ALTER TABLE ONLY geo_container_repository_updated_events ALTER COLUMN id SET DEFAULT nextval('geo_container_repository_updated_events_id_seq'::regclass); + +ALTER TABLE ONLY geo_event_log ALTER COLUMN id SET DEFAULT nextval('geo_event_log_id_seq'::regclass); + +ALTER TABLE ONLY geo_hashed_storage_attachments_events ALTER COLUMN id SET DEFAULT nextval('geo_hashed_storage_attachments_events_id_seq'::regclass); + +ALTER TABLE ONLY geo_hashed_storage_migrated_events ALTER COLUMN id SET DEFAULT nextval('geo_hashed_storage_migrated_events_id_seq'::regclass); + +ALTER TABLE ONLY geo_job_artifact_deleted_events ALTER COLUMN id SET DEFAULT nextval('geo_job_artifact_deleted_events_id_seq'::regclass); + +ALTER TABLE ONLY geo_lfs_object_deleted_events ALTER COLUMN id SET DEFAULT nextval('geo_lfs_object_deleted_events_id_seq'::regclass); + +ALTER TABLE ONLY geo_node_namespace_links ALTER COLUMN id SET DEFAULT nextval('geo_node_namespace_links_id_seq'::regclass); + +ALTER TABLE ONLY geo_node_statuses ALTER COLUMN id SET DEFAULT nextval('geo_node_statuses_id_seq'::regclass); + +ALTER TABLE ONLY geo_nodes ALTER COLUMN id SET DEFAULT nextval('geo_nodes_id_seq'::regclass); + +ALTER TABLE ONLY geo_repositories_changed_events ALTER COLUMN id SET DEFAULT nextval('geo_repositories_changed_events_id_seq'::regclass); + +ALTER TABLE ONLY geo_repository_created_events ALTER COLUMN id SET DEFAULT nextval('geo_repository_created_events_id_seq'::regclass); + +ALTER TABLE ONLY geo_repository_deleted_events ALTER COLUMN id SET DEFAULT nextval('geo_repository_deleted_events_id_seq'::regclass); + +ALTER TABLE ONLY geo_repository_renamed_events ALTER COLUMN id SET DEFAULT nextval('geo_repository_renamed_events_id_seq'::regclass); + +ALTER TABLE ONLY geo_repository_updated_events ALTER COLUMN id SET DEFAULT nextval('geo_repository_updated_events_id_seq'::regclass); + +ALTER TABLE ONLY geo_reset_checksum_events ALTER COLUMN id SET DEFAULT nextval('geo_reset_checksum_events_id_seq'::regclass); + +ALTER TABLE ONLY geo_upload_deleted_events ALTER COLUMN id SET DEFAULT nextval('geo_upload_deleted_events_id_seq'::regclass); + +ALTER TABLE ONLY gitlab_subscription_histories ALTER COLUMN id SET DEFAULT nextval('gitlab_subscription_histories_id_seq'::regclass); + +ALTER TABLE ONLY gitlab_subscriptions ALTER COLUMN id SET DEFAULT nextval('gitlab_subscriptions_id_seq'::regclass); + +ALTER TABLE ONLY gpg_key_subkeys ALTER COLUMN id SET DEFAULT nextval('gpg_key_subkeys_id_seq'::regclass); + +ALTER TABLE ONLY gpg_keys ALTER COLUMN id SET DEFAULT nextval('gpg_keys_id_seq'::regclass); + +ALTER TABLE ONLY gpg_signatures ALTER COLUMN id SET DEFAULT nextval('gpg_signatures_id_seq'::regclass); + +ALTER TABLE ONLY grafana_integrations ALTER COLUMN id SET DEFAULT nextval('grafana_integrations_id_seq'::regclass); + +ALTER TABLE ONLY group_custom_attributes ALTER COLUMN id SET DEFAULT nextval('group_custom_attributes_id_seq'::regclass); + +ALTER TABLE ONLY group_group_links ALTER COLUMN id SET DEFAULT nextval('group_group_links_id_seq'::regclass); + +ALTER TABLE ONLY historical_data ALTER COLUMN id SET DEFAULT nextval('historical_data_id_seq'::regclass); + +ALTER TABLE ONLY identities ALTER COLUMN id SET DEFAULT nextval('identities_id_seq'::regclass); + +ALTER TABLE ONLY import_export_uploads ALTER COLUMN id SET DEFAULT nextval('import_export_uploads_id_seq'::regclass); + +ALTER TABLE ONLY import_failures ALTER COLUMN id SET DEFAULT nextval('import_failures_id_seq'::regclass); + +ALTER TABLE ONLY index_statuses ALTER COLUMN id SET DEFAULT nextval('index_statuses_id_seq'::regclass); + +ALTER TABLE ONLY insights ALTER COLUMN id SET DEFAULT nextval('insights_id_seq'::regclass); + +ALTER TABLE ONLY internal_ids ALTER COLUMN id SET DEFAULT nextval('internal_ids_id_seq'::regclass); + +ALTER TABLE ONLY ip_restrictions ALTER COLUMN id SET DEFAULT nextval('ip_restrictions_id_seq'::regclass); + +ALTER TABLE ONLY issue_links ALTER COLUMN id SET DEFAULT nextval('issue_links_id_seq'::regclass); + +ALTER TABLE ONLY issue_metrics ALTER COLUMN id SET DEFAULT nextval('issue_metrics_id_seq'::regclass); + +ALTER TABLE ONLY issue_tracker_data ALTER COLUMN id SET DEFAULT nextval('issue_tracker_data_id_seq'::regclass); + +ALTER TABLE ONLY issue_user_mentions ALTER COLUMN id SET DEFAULT nextval('issue_user_mentions_id_seq'::regclass); + +ALTER TABLE ONLY issues ALTER COLUMN id SET DEFAULT nextval('issues_id_seq'::regclass); + +ALTER TABLE ONLY jira_connect_installations ALTER COLUMN id SET DEFAULT nextval('jira_connect_installations_id_seq'::regclass); + +ALTER TABLE ONLY jira_connect_subscriptions ALTER COLUMN id SET DEFAULT nextval('jira_connect_subscriptions_id_seq'::regclass); + +ALTER TABLE ONLY jira_tracker_data ALTER COLUMN id SET DEFAULT nextval('jira_tracker_data_id_seq'::regclass); + +ALTER TABLE ONLY keys ALTER COLUMN id SET DEFAULT nextval('keys_id_seq'::regclass); + +ALTER TABLE ONLY label_links ALTER COLUMN id SET DEFAULT nextval('label_links_id_seq'::regclass); + +ALTER TABLE ONLY label_priorities ALTER COLUMN id SET DEFAULT nextval('label_priorities_id_seq'::regclass); + +ALTER TABLE ONLY labels ALTER COLUMN id SET DEFAULT nextval('labels_id_seq'::regclass); + +ALTER TABLE ONLY ldap_group_links ALTER COLUMN id SET DEFAULT nextval('ldap_group_links_id_seq'::regclass); + +ALTER TABLE ONLY lfs_file_locks ALTER COLUMN id SET DEFAULT nextval('lfs_file_locks_id_seq'::regclass); + +ALTER TABLE ONLY lfs_objects ALTER COLUMN id SET DEFAULT nextval('lfs_objects_id_seq'::regclass); + +ALTER TABLE ONLY lfs_objects_projects ALTER COLUMN id SET DEFAULT nextval('lfs_objects_projects_id_seq'::regclass); + +ALTER TABLE ONLY licenses ALTER COLUMN id SET DEFAULT nextval('licenses_id_seq'::regclass); + +ALTER TABLE ONLY list_user_preferences ALTER COLUMN id SET DEFAULT nextval('list_user_preferences_id_seq'::regclass); + +ALTER TABLE ONLY lists ALTER COLUMN id SET DEFAULT nextval('lists_id_seq'::regclass); + +ALTER TABLE ONLY members ALTER COLUMN id SET DEFAULT nextval('members_id_seq'::regclass); + +ALTER TABLE ONLY merge_request_assignees ALTER COLUMN id SET DEFAULT nextval('merge_request_assignees_id_seq'::regclass); + +ALTER TABLE ONLY merge_request_blocks ALTER COLUMN id SET DEFAULT nextval('merge_request_blocks_id_seq'::regclass); + +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_diffs ALTER COLUMN id SET DEFAULT nextval('merge_request_diffs_id_seq'::regclass); + +ALTER TABLE ONLY merge_request_metrics ALTER COLUMN id SET DEFAULT nextval('merge_request_metrics_id_seq'::regclass); + +ALTER TABLE ONLY merge_request_user_mentions ALTER COLUMN id SET DEFAULT nextval('merge_request_user_mentions_id_seq'::regclass); + +ALTER TABLE ONLY merge_requests ALTER COLUMN id SET DEFAULT nextval('merge_requests_id_seq'::regclass); + +ALTER TABLE ONLY merge_requests_closing_issues ALTER COLUMN id SET DEFAULT nextval('merge_requests_closing_issues_id_seq'::regclass); + +ALTER TABLE ONLY merge_trains ALTER COLUMN id SET DEFAULT nextval('merge_trains_id_seq'::regclass); + +ALTER TABLE ONLY milestones ALTER COLUMN id SET DEFAULT nextval('milestones_id_seq'::regclass); + +ALTER TABLE ONLY namespace_aggregation_schedules ALTER COLUMN namespace_id SET DEFAULT nextval('namespace_aggregation_schedules_namespace_id_seq'::regclass); + +ALTER TABLE ONLY namespace_root_storage_statistics ALTER COLUMN namespace_id SET DEFAULT nextval('namespace_root_storage_statistics_namespace_id_seq'::regclass); + +ALTER TABLE ONLY namespace_statistics ALTER COLUMN id SET DEFAULT nextval('namespace_statistics_id_seq'::regclass); + +ALTER TABLE ONLY namespaces ALTER COLUMN id SET DEFAULT nextval('namespaces_id_seq'::regclass); + +ALTER TABLE ONLY note_diff_files ALTER COLUMN id SET DEFAULT nextval('note_diff_files_id_seq'::regclass); + +ALTER TABLE ONLY notes ALTER COLUMN id SET DEFAULT nextval('notes_id_seq'::regclass); + +ALTER TABLE ONLY notification_settings ALTER COLUMN id SET DEFAULT nextval('notification_settings_id_seq'::regclass); + +ALTER TABLE ONLY oauth_access_grants ALTER COLUMN id SET DEFAULT nextval('oauth_access_grants_id_seq'::regclass); + +ALTER TABLE ONLY oauth_access_tokens ALTER COLUMN id SET DEFAULT nextval('oauth_access_tokens_id_seq'::regclass); + +ALTER TABLE ONLY oauth_applications ALTER COLUMN id SET DEFAULT nextval('oauth_applications_id_seq'::regclass); + +ALTER TABLE ONLY oauth_openid_requests ALTER COLUMN id SET DEFAULT nextval('oauth_openid_requests_id_seq'::regclass); + +ALTER TABLE ONLY operations_feature_flag_scopes ALTER COLUMN id SET DEFAULT nextval('operations_feature_flag_scopes_id_seq'::regclass); + +ALTER TABLE ONLY operations_feature_flags ALTER COLUMN id SET DEFAULT nextval('operations_feature_flags_id_seq'::regclass); + +ALTER TABLE ONLY operations_feature_flags_clients ALTER COLUMN id SET DEFAULT nextval('operations_feature_flags_clients_id_seq'::regclass); + +ALTER TABLE ONLY packages_build_infos ALTER COLUMN id SET DEFAULT nextval('packages_build_infos_id_seq'::regclass); + +ALTER TABLE ONLY packages_conan_file_metadata ALTER COLUMN id SET DEFAULT nextval('packages_conan_file_metadata_id_seq'::regclass); + +ALTER TABLE ONLY packages_conan_metadata ALTER COLUMN id SET DEFAULT nextval('packages_conan_metadata_id_seq'::regclass); + +ALTER TABLE ONLY packages_dependencies ALTER COLUMN id SET DEFAULT nextval('packages_dependencies_id_seq'::regclass); + +ALTER TABLE ONLY packages_dependency_links ALTER COLUMN id SET DEFAULT nextval('packages_dependency_links_id_seq'::regclass); + +ALTER TABLE ONLY packages_maven_metadata ALTER COLUMN id SET DEFAULT nextval('packages_maven_metadata_id_seq'::regclass); + +ALTER TABLE ONLY packages_package_files ALTER COLUMN id SET DEFAULT nextval('packages_package_files_id_seq'::regclass); + +ALTER TABLE ONLY packages_packages ALTER COLUMN id SET DEFAULT nextval('packages_packages_id_seq'::regclass); + +ALTER TABLE ONLY packages_tags ALTER COLUMN id SET DEFAULT nextval('packages_tags_id_seq'::regclass); + +ALTER TABLE ONLY pages_domain_acme_orders ALTER COLUMN id SET DEFAULT nextval('pages_domain_acme_orders_id_seq'::regclass); + +ALTER TABLE ONLY pages_domains ALTER COLUMN id SET DEFAULT nextval('pages_domains_id_seq'::regclass); + +ALTER TABLE ONLY path_locks ALTER COLUMN id SET DEFAULT nextval('path_locks_id_seq'::regclass); + +ALTER TABLE ONLY personal_access_tokens ALTER COLUMN id SET DEFAULT nextval('personal_access_tokens_id_seq'::regclass); + +ALTER TABLE ONLY plan_limits ALTER COLUMN id SET DEFAULT nextval('plan_limits_id_seq'::regclass); + +ALTER TABLE ONLY plans ALTER COLUMN id SET DEFAULT nextval('plans_id_seq'::regclass); + +ALTER TABLE ONLY pool_repositories ALTER COLUMN id SET DEFAULT nextval('pool_repositories_id_seq'::regclass); + +ALTER TABLE ONLY programming_languages ALTER COLUMN id SET DEFAULT nextval('programming_languages_id_seq'::regclass); + +ALTER TABLE ONLY project_aliases ALTER COLUMN id SET DEFAULT nextval('project_aliases_id_seq'::regclass); + +ALTER TABLE ONLY project_auto_devops ALTER COLUMN id SET DEFAULT nextval('project_auto_devops_id_seq'::regclass); + +ALTER TABLE ONLY project_ci_cd_settings ALTER COLUMN id SET DEFAULT nextval('project_ci_cd_settings_id_seq'::regclass); + +ALTER TABLE ONLY project_custom_attributes ALTER COLUMN id SET DEFAULT nextval('project_custom_attributes_id_seq'::regclass); + +ALTER TABLE ONLY project_daily_statistics ALTER COLUMN id SET DEFAULT nextval('project_daily_statistics_id_seq'::regclass); + +ALTER TABLE ONLY project_deploy_tokens ALTER COLUMN id SET DEFAULT nextval('project_deploy_tokens_id_seq'::regclass); + +ALTER TABLE ONLY project_features ALTER COLUMN id SET DEFAULT nextval('project_features_id_seq'::regclass); + +ALTER TABLE ONLY project_group_links ALTER COLUMN id SET DEFAULT nextval('project_group_links_id_seq'::regclass); + +ALTER TABLE ONLY project_import_data ALTER COLUMN id SET DEFAULT nextval('project_import_data_id_seq'::regclass); + +ALTER TABLE ONLY project_mirror_data ALTER COLUMN id SET DEFAULT nextval('project_mirror_data_id_seq'::regclass); + +ALTER TABLE ONLY project_repositories ALTER COLUMN id SET DEFAULT nextval('project_repositories_id_seq'::regclass); + +ALTER TABLE ONLY project_repository_states ALTER COLUMN id SET DEFAULT nextval('project_repository_states_id_seq'::regclass); + +ALTER TABLE ONLY project_statistics ALTER COLUMN id SET DEFAULT nextval('project_statistics_id_seq'::regclass); + +ALTER TABLE ONLY project_tracing_settings ALTER COLUMN id SET DEFAULT nextval('project_tracing_settings_id_seq'::regclass); + +ALTER TABLE ONLY projects ALTER COLUMN id SET DEFAULT nextval('projects_id_seq'::regclass); + +ALTER TABLE ONLY prometheus_alert_events ALTER COLUMN id SET DEFAULT nextval('prometheus_alert_events_id_seq'::regclass); + +ALTER TABLE ONLY prometheus_alerts ALTER COLUMN id SET DEFAULT nextval('prometheus_alerts_id_seq'::regclass); + +ALTER TABLE ONLY prometheus_metrics ALTER COLUMN id SET DEFAULT nextval('prometheus_metrics_id_seq'::regclass); + +ALTER TABLE ONLY protected_branch_merge_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_branch_merge_access_levels_id_seq'::regclass); + +ALTER TABLE ONLY protected_branch_push_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_branch_push_access_levels_id_seq'::regclass); + +ALTER TABLE ONLY protected_branch_unprotect_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_branch_unprotect_access_levels_id_seq'::regclass); + +ALTER TABLE ONLY protected_branches ALTER COLUMN id SET DEFAULT nextval('protected_branches_id_seq'::regclass); + +ALTER TABLE ONLY protected_environment_deploy_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_environment_deploy_access_levels_id_seq'::regclass); + +ALTER TABLE ONLY protected_environments ALTER COLUMN id SET DEFAULT nextval('protected_environments_id_seq'::regclass); + +ALTER TABLE ONLY protected_tag_create_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_tag_create_access_levels_id_seq'::regclass); + +ALTER TABLE ONLY protected_tags ALTER COLUMN id SET DEFAULT nextval('protected_tags_id_seq'::regclass); + +ALTER TABLE ONLY push_rules ALTER COLUMN id SET DEFAULT nextval('push_rules_id_seq'::regclass); + +ALTER TABLE ONLY redirect_routes ALTER COLUMN id SET DEFAULT nextval('redirect_routes_id_seq'::regclass); + +ALTER TABLE ONLY release_links ALTER COLUMN id SET DEFAULT nextval('release_links_id_seq'::regclass); + +ALTER TABLE ONLY releases ALTER COLUMN id SET DEFAULT nextval('releases_id_seq'::regclass); + +ALTER TABLE ONLY remote_mirrors ALTER COLUMN id SET DEFAULT nextval('remote_mirrors_id_seq'::regclass); + +ALTER TABLE ONLY resource_label_events ALTER COLUMN id SET DEFAULT nextval('resource_label_events_id_seq'::regclass); + +ALTER TABLE ONLY resource_weight_events ALTER COLUMN id SET DEFAULT nextval('resource_weight_events_id_seq'::regclass); + +ALTER TABLE ONLY reviews ALTER COLUMN id SET DEFAULT nextval('reviews_id_seq'::regclass); + +ALTER TABLE ONLY routes ALTER COLUMN id SET DEFAULT nextval('routes_id_seq'::regclass); + +ALTER TABLE ONLY saml_providers ALTER COLUMN id SET DEFAULT nextval('saml_providers_id_seq'::regclass); + +ALTER TABLE ONLY scim_oauth_access_tokens ALTER COLUMN id SET DEFAULT nextval('scim_oauth_access_tokens_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); + +ALTER TABLE ONLY sent_notifications ALTER COLUMN id SET DEFAULT nextval('sent_notifications_id_seq'::regclass); + +ALTER TABLE ONLY sentry_issues ALTER COLUMN id SET DEFAULT nextval('sentry_issues_id_seq'::regclass); + +ALTER TABLE ONLY services ALTER COLUMN id SET DEFAULT nextval('services_id_seq'::regclass); + +ALTER TABLE ONLY shards ALTER COLUMN id SET DEFAULT nextval('shards_id_seq'::regclass); + +ALTER TABLE ONLY slack_integrations ALTER COLUMN id SET DEFAULT nextval('slack_integrations_id_seq'::regclass); + +ALTER TABLE ONLY smartcard_identities ALTER COLUMN id SET DEFAULT nextval('smartcard_identities_id_seq'::regclass); + +ALTER TABLE ONLY snippet_user_mentions ALTER COLUMN id SET DEFAULT nextval('snippet_user_mentions_id_seq'::regclass); + +ALTER TABLE ONLY snippets ALTER COLUMN id SET DEFAULT nextval('snippets_id_seq'::regclass); + +ALTER TABLE ONLY software_license_policies ALTER COLUMN id SET DEFAULT nextval('software_license_policies_id_seq'::regclass); + +ALTER TABLE ONLY software_licenses ALTER COLUMN id SET DEFAULT nextval('software_licenses_id_seq'::regclass); + +ALTER TABLE ONLY spam_logs ALTER COLUMN id SET DEFAULT nextval('spam_logs_id_seq'::regclass); + +ALTER TABLE ONLY subscriptions ALTER COLUMN id SET DEFAULT nextval('subscriptions_id_seq'::regclass); + +ALTER TABLE ONLY suggestions ALTER COLUMN id SET DEFAULT nextval('suggestions_id_seq'::regclass); + +ALTER TABLE ONLY system_note_metadata ALTER COLUMN id SET DEFAULT nextval('system_note_metadata_id_seq'::regclass); + +ALTER TABLE ONLY taggings ALTER COLUMN id SET DEFAULT nextval('taggings_id_seq'::regclass); + +ALTER TABLE ONLY tags ALTER COLUMN id SET DEFAULT nextval('tags_id_seq'::regclass); + +ALTER TABLE ONLY term_agreements ALTER COLUMN id SET DEFAULT nextval('term_agreements_id_seq'::regclass); + +ALTER TABLE ONLY timelogs ALTER COLUMN id SET DEFAULT nextval('timelogs_id_seq'::regclass); + +ALTER TABLE ONLY todos ALTER COLUMN id SET DEFAULT nextval('todos_id_seq'::regclass); + +ALTER TABLE ONLY trending_projects ALTER COLUMN id SET DEFAULT nextval('trending_projects_id_seq'::regclass); + +ALTER TABLE ONLY u2f_registrations ALTER COLUMN id SET DEFAULT nextval('u2f_registrations_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); + +ALTER TABLE ONLY user_callouts ALTER COLUMN id SET DEFAULT nextval('user_callouts_id_seq'::regclass); + +ALTER TABLE ONLY user_custom_attributes ALTER COLUMN id SET DEFAULT nextval('user_custom_attributes_id_seq'::regclass); + +ALTER TABLE ONLY user_preferences ALTER COLUMN id SET DEFAULT nextval('user_preferences_id_seq'::regclass); + +ALTER TABLE ONLY user_statuses ALTER COLUMN user_id SET DEFAULT nextval('user_statuses_user_id_seq'::regclass); + +ALTER TABLE ONLY user_synced_attributes_metadata ALTER COLUMN id SET DEFAULT nextval('user_synced_attributes_metadata_id_seq'::regclass); + +ALTER TABLE ONLY users ALTER COLUMN id SET DEFAULT nextval('users_id_seq'::regclass); + +ALTER TABLE ONLY users_ops_dashboard_projects ALTER COLUMN id SET DEFAULT nextval('users_ops_dashboard_projects_id_seq'::regclass); + +ALTER TABLE ONLY users_star_projects ALTER COLUMN id SET DEFAULT nextval('users_star_projects_id_seq'::regclass); + +ALTER TABLE ONLY vulnerabilities ALTER COLUMN id SET DEFAULT nextval('vulnerabilities_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_feedback ALTER COLUMN id SET DEFAULT nextval('vulnerability_feedback_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_identifiers ALTER COLUMN id SET DEFAULT nextval('vulnerability_identifiers_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_issue_links ALTER COLUMN id SET DEFAULT nextval('vulnerability_issue_links_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_occurrence_identifiers ALTER COLUMN id SET DEFAULT nextval('vulnerability_occurrence_identifiers_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_occurrence_pipelines ALTER COLUMN id SET DEFAULT nextval('vulnerability_occurrence_pipelines_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_occurrences ALTER COLUMN id SET DEFAULT nextval('vulnerability_occurrences_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_scanners ALTER COLUMN id SET DEFAULT nextval('vulnerability_scanners_id_seq'::regclass); + +ALTER TABLE ONLY web_hook_logs ALTER COLUMN id SET DEFAULT nextval('web_hook_logs_id_seq'::regclass); + +ALTER TABLE ONLY web_hooks ALTER COLUMN id SET DEFAULT nextval('web_hooks_id_seq'::regclass); + +ALTER TABLE ONLY webauthn_registrations ALTER COLUMN id SET DEFAULT nextval('webauthn_registrations_id_seq'::regclass); + +ALTER TABLE ONLY x509_certificates ALTER COLUMN id SET DEFAULT nextval('x509_certificates_id_seq'::regclass); + +ALTER TABLE ONLY x509_commit_signatures ALTER COLUMN id SET DEFAULT nextval('x509_commit_signatures_id_seq'::regclass); + +ALTER TABLE ONLY x509_issuers ALTER COLUMN id SET DEFAULT nextval('x509_issuers_id_seq'::regclass); + +ALTER TABLE ONLY zoom_meetings ALTER COLUMN id SET DEFAULT nextval('zoom_meetings_id_seq'::regclass); + +ALTER TABLE ONLY abuse_reports + ADD CONSTRAINT abuse_reports_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY alerts_service_data + ADD CONSTRAINT alerts_service_data_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY allowed_email_domains + ADD CONSTRAINT allowed_email_domains_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY analytics_cycle_analytics_group_stages + ADD CONSTRAINT analytics_cycle_analytics_group_stages_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY analytics_cycle_analytics_project_stages + ADD CONSTRAINT analytics_cycle_analytics_project_stages_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY analytics_repository_file_commits + ADD CONSTRAINT analytics_repository_file_commits_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY analytics_repository_file_edits + ADD CONSTRAINT analytics_repository_file_edits_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY analytics_repository_files + ADD CONSTRAINT analytics_repository_files_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY appearances + ADD CONSTRAINT appearances_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY application_setting_terms + ADD CONSTRAINT application_setting_terms_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY application_settings + ADD CONSTRAINT application_settings_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY approval_merge_request_rule_sources + ADD CONSTRAINT approval_merge_request_rule_sources_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY approval_merge_request_rules_approved_approvers + ADD CONSTRAINT approval_merge_request_rules_approved_approvers_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY approval_merge_request_rules_groups + ADD CONSTRAINT approval_merge_request_rules_groups_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY approval_merge_request_rules + ADD CONSTRAINT approval_merge_request_rules_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY approval_merge_request_rules_users + ADD CONSTRAINT approval_merge_request_rules_users_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY approval_project_rules_groups + ADD CONSTRAINT approval_project_rules_groups_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY approval_project_rules + ADD CONSTRAINT approval_project_rules_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY approval_project_rules_users + ADD CONSTRAINT approval_project_rules_users_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY approvals + ADD CONSTRAINT approvals_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY approver_groups + ADD CONSTRAINT approver_groups_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY approvers + ADD CONSTRAINT approvers_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY audit_events + ADD CONSTRAINT audit_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY award_emoji + ADD CONSTRAINT award_emoji_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY aws_roles + ADD CONSTRAINT aws_roles_pkey PRIMARY KEY (user_id); + +ALTER TABLE ONLY badges + ADD CONSTRAINT badges_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY board_assignees + ADD CONSTRAINT board_assignees_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY board_group_recent_visits + ADD CONSTRAINT board_group_recent_visits_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY board_labels + ADD CONSTRAINT board_labels_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY board_project_recent_visits + ADD CONSTRAINT board_project_recent_visits_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY boards + ADD CONSTRAINT boards_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY broadcast_messages + ADD CONSTRAINT broadcast_messages_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY chat_names + ADD CONSTRAINT chat_names_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY chat_teams + ADD CONSTRAINT chat_teams_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_build_needs + ADD CONSTRAINT ci_build_needs_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_build_trace_chunks + ADD CONSTRAINT ci_build_trace_chunks_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_build_trace_section_names + ADD CONSTRAINT ci_build_trace_section_names_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_builds_metadata + ADD CONSTRAINT ci_builds_metadata_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_builds + ADD CONSTRAINT ci_builds_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_builds_runner_session + ADD CONSTRAINT ci_builds_runner_session_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_group_variables + ADD CONSTRAINT ci_group_variables_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_job_artifacts + ADD CONSTRAINT ci_job_artifacts_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_job_variables + ADD CONSTRAINT ci_job_variables_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_pipeline_chat_data + ADD CONSTRAINT ci_pipeline_chat_data_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_pipeline_schedule_variables + ADD CONSTRAINT ci_pipeline_schedule_variables_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_pipeline_schedules + ADD CONSTRAINT ci_pipeline_schedules_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_pipeline_variables + ADD CONSTRAINT ci_pipeline_variables_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_pipelines_config + ADD CONSTRAINT ci_pipelines_config_pkey PRIMARY KEY (pipeline_id); + +ALTER TABLE ONLY ci_pipelines + ADD CONSTRAINT ci_pipelines_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_refs + ADD CONSTRAINT ci_refs_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_resource_groups + ADD CONSTRAINT ci_resource_groups_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_resources + ADD CONSTRAINT ci_resources_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_runner_namespaces + ADD CONSTRAINT ci_runner_namespaces_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_runner_projects + ADD CONSTRAINT ci_runner_projects_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_runners + ADD CONSTRAINT ci_runners_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_sources_pipelines + ADD CONSTRAINT ci_sources_pipelines_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_stages + ADD CONSTRAINT ci_stages_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_subscriptions_projects + ADD CONSTRAINT ci_subscriptions_projects_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_trigger_requests + ADD CONSTRAINT ci_trigger_requests_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_triggers + ADD CONSTRAINT ci_triggers_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_variables + ADD CONSTRAINT ci_variables_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY cluster_groups + ADD CONSTRAINT cluster_groups_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY cluster_platforms_kubernetes + ADD CONSTRAINT cluster_platforms_kubernetes_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY cluster_projects + ADD CONSTRAINT cluster_projects_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY cluster_providers_aws + ADD CONSTRAINT cluster_providers_aws_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY cluster_providers_gcp + ADD CONSTRAINT cluster_providers_gcp_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY clusters_applications_cert_managers + ADD CONSTRAINT clusters_applications_cert_managers_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY clusters_applications_crossplane + ADD CONSTRAINT clusters_applications_crossplane_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY clusters_applications_elastic_stacks + ADD CONSTRAINT clusters_applications_elastic_stacks_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY clusters_applications_helm + ADD CONSTRAINT clusters_applications_helm_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY clusters_applications_ingress + ADD CONSTRAINT clusters_applications_ingress_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY clusters_applications_jupyter + ADD CONSTRAINT clusters_applications_jupyter_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY clusters_applications_knative + ADD CONSTRAINT clusters_applications_knative_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY clusters_applications_prometheus + ADD CONSTRAINT clusters_applications_prometheus_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY clusters_applications_runners + ADD CONSTRAINT clusters_applications_runners_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY clusters_kubernetes_namespaces + ADD CONSTRAINT clusters_kubernetes_namespaces_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY clusters + ADD CONSTRAINT clusters_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY commit_user_mentions + ADD CONSTRAINT commit_user_mentions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY container_expiration_policies + ADD CONSTRAINT container_expiration_policies_pkey PRIMARY KEY (project_id); + +ALTER TABLE ONLY container_repositories + ADD CONSTRAINT container_repositories_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY conversational_development_index_metrics + ADD CONSTRAINT conversational_development_index_metrics_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY dependency_proxy_blobs + ADD CONSTRAINT dependency_proxy_blobs_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY dependency_proxy_group_settings + ADD CONSTRAINT dependency_proxy_group_settings_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY deploy_keys_projects + ADD CONSTRAINT deploy_keys_projects_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY deploy_tokens + ADD CONSTRAINT deploy_tokens_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY deployments + ADD CONSTRAINT deployments_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY description_versions + ADD CONSTRAINT description_versions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY design_management_designs + ADD CONSTRAINT design_management_designs_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY design_management_versions + ADD CONSTRAINT design_management_versions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY design_user_mentions + ADD CONSTRAINT design_user_mentions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY draft_notes + ADD CONSTRAINT draft_notes_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY emails + ADD CONSTRAINT emails_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY environments + ADD CONSTRAINT environments_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY epic_issues + ADD CONSTRAINT epic_issues_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY epic_metrics + ADD CONSTRAINT epic_metrics_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY epic_user_mentions + ADD CONSTRAINT epic_user_mentions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY epics + ADD CONSTRAINT epics_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY events + ADD CONSTRAINT events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY evidences + ADD CONSTRAINT evidences_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY external_pull_requests + ADD CONSTRAINT external_pull_requests_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY feature_gates + ADD CONSTRAINT feature_gates_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY features + ADD CONSTRAINT features_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY fork_network_members + ADD CONSTRAINT fork_network_members_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY fork_networks + ADD CONSTRAINT fork_networks_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY forked_project_links + ADD CONSTRAINT forked_project_links_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_cache_invalidation_events + ADD CONSTRAINT geo_cache_invalidation_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_container_repository_updated_events + ADD CONSTRAINT geo_container_repository_updated_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_event_log + ADD CONSTRAINT geo_event_log_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_hashed_storage_attachments_events + ADD CONSTRAINT geo_hashed_storage_attachments_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_hashed_storage_migrated_events + ADD CONSTRAINT geo_hashed_storage_migrated_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_job_artifact_deleted_events + ADD CONSTRAINT geo_job_artifact_deleted_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_lfs_object_deleted_events + ADD CONSTRAINT geo_lfs_object_deleted_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_node_namespace_links + ADD CONSTRAINT geo_node_namespace_links_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_node_statuses + ADD CONSTRAINT geo_node_statuses_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_nodes + ADD CONSTRAINT geo_nodes_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_repositories_changed_events + ADD CONSTRAINT geo_repositories_changed_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_repository_created_events + ADD CONSTRAINT geo_repository_created_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_repository_deleted_events + ADD CONSTRAINT geo_repository_deleted_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_repository_renamed_events + ADD CONSTRAINT geo_repository_renamed_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_repository_updated_events + ADD CONSTRAINT geo_repository_updated_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_reset_checksum_events + ADD CONSTRAINT geo_reset_checksum_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY geo_upload_deleted_events + ADD CONSTRAINT geo_upload_deleted_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY gitlab_subscription_histories + ADD CONSTRAINT gitlab_subscription_histories_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY gitlab_subscriptions + ADD CONSTRAINT gitlab_subscriptions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY gpg_key_subkeys + ADD CONSTRAINT gpg_key_subkeys_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY gpg_keys + ADD CONSTRAINT gpg_keys_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY gpg_signatures + ADD CONSTRAINT gpg_signatures_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY grafana_integrations + ADD CONSTRAINT grafana_integrations_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY group_custom_attributes + ADD CONSTRAINT group_custom_attributes_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY group_deletion_schedules + ADD CONSTRAINT group_deletion_schedules_pkey PRIMARY KEY (group_id); + +ALTER TABLE ONLY group_group_links + ADD CONSTRAINT group_group_links_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY historical_data + ADD CONSTRAINT historical_data_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY identities + ADD CONSTRAINT identities_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY import_export_uploads + ADD CONSTRAINT import_export_uploads_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY import_failures + ADD CONSTRAINT import_failures_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY index_statuses + ADD CONSTRAINT index_statuses_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY insights + ADD CONSTRAINT insights_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY internal_ids + ADD CONSTRAINT internal_ids_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ip_restrictions + ADD CONSTRAINT ip_restrictions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY issue_links + ADD CONSTRAINT issue_links_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY issue_metrics + ADD CONSTRAINT issue_metrics_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY issue_tracker_data + ADD CONSTRAINT issue_tracker_data_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY issue_user_mentions + ADD CONSTRAINT issue_user_mentions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY issues + ADD CONSTRAINT issues_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY jira_connect_installations + ADD CONSTRAINT jira_connect_installations_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY jira_connect_subscriptions + ADD CONSTRAINT jira_connect_subscriptions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY jira_tracker_data + ADD CONSTRAINT jira_tracker_data_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY keys + ADD CONSTRAINT keys_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY label_links + ADD CONSTRAINT label_links_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY label_priorities + ADD CONSTRAINT label_priorities_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY labels + ADD CONSTRAINT labels_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ldap_group_links + ADD CONSTRAINT ldap_group_links_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY lfs_file_locks + ADD CONSTRAINT lfs_file_locks_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY lfs_objects + ADD CONSTRAINT lfs_objects_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY lfs_objects_projects + ADD CONSTRAINT lfs_objects_projects_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY licenses + ADD CONSTRAINT licenses_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY list_user_preferences + ADD CONSTRAINT list_user_preferences_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY lists + ADD CONSTRAINT lists_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY members + ADD CONSTRAINT members_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY merge_request_assignees + ADD CONSTRAINT merge_request_assignees_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY merge_request_blocks + ADD CONSTRAINT merge_request_blocks_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY merge_request_context_commits + ADD CONSTRAINT merge_request_context_commits_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY merge_request_diffs + ADD CONSTRAINT merge_request_diffs_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY merge_request_metrics + ADD CONSTRAINT merge_request_metrics_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY merge_request_user_mentions + ADD CONSTRAINT merge_request_user_mentions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY merge_requests_closing_issues + ADD CONSTRAINT merge_requests_closing_issues_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY merge_requests + ADD CONSTRAINT merge_requests_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY merge_trains + ADD CONSTRAINT merge_trains_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY milestones + ADD CONSTRAINT milestones_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY namespace_aggregation_schedules + ADD CONSTRAINT namespace_aggregation_schedules_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY namespace_root_storage_statistics + ADD CONSTRAINT namespace_root_storage_statistics_pkey PRIMARY KEY (namespace_id); + +ALTER TABLE ONLY namespace_statistics + ADD CONSTRAINT namespace_statistics_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY namespaces + ADD CONSTRAINT namespaces_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY note_diff_files + ADD CONSTRAINT note_diff_files_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY notes + ADD CONSTRAINT notes_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY notification_settings + ADD CONSTRAINT notification_settings_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY oauth_access_grants + ADD CONSTRAINT oauth_access_grants_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY oauth_access_tokens + ADD CONSTRAINT oauth_access_tokens_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY oauth_applications + ADD CONSTRAINT oauth_applications_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY oauth_openid_requests + ADD CONSTRAINT oauth_openid_requests_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY operations_feature_flag_scopes + ADD CONSTRAINT operations_feature_flag_scopes_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY operations_feature_flags_clients + ADD CONSTRAINT operations_feature_flags_clients_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY operations_feature_flags + ADD CONSTRAINT operations_feature_flags_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY packages_build_infos + ADD CONSTRAINT packages_build_infos_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY packages_conan_file_metadata + ADD CONSTRAINT packages_conan_file_metadata_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY packages_conan_metadata + ADD CONSTRAINT packages_conan_metadata_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY packages_dependencies + ADD CONSTRAINT packages_dependencies_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY packages_dependency_links + ADD CONSTRAINT packages_dependency_links_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY packages_maven_metadata + ADD CONSTRAINT packages_maven_metadata_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY packages_package_files + ADD CONSTRAINT packages_package_files_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY packages_packages + ADD CONSTRAINT packages_packages_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY packages_tags + ADD CONSTRAINT packages_tags_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY pages_domain_acme_orders + ADD CONSTRAINT pages_domain_acme_orders_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY pages_domains + ADD CONSTRAINT pages_domains_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY path_locks + ADD CONSTRAINT path_locks_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY personal_access_tokens + ADD CONSTRAINT personal_access_tokens_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY plan_limits + ADD CONSTRAINT plan_limits_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY plans + ADD CONSTRAINT plans_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY pool_repositories + ADD CONSTRAINT pool_repositories_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY programming_languages + ADD CONSTRAINT programming_languages_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_alerting_settings + ADD CONSTRAINT project_alerting_settings_pkey PRIMARY KEY (project_id); + +ALTER TABLE ONLY project_aliases + ADD CONSTRAINT project_aliases_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_auto_devops + ADD CONSTRAINT project_auto_devops_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_ci_cd_settings + ADD CONSTRAINT project_ci_cd_settings_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_custom_attributes + ADD CONSTRAINT project_custom_attributes_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_daily_statistics + ADD CONSTRAINT project_daily_statistics_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_deploy_tokens + ADD CONSTRAINT project_deploy_tokens_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_error_tracking_settings + ADD CONSTRAINT project_error_tracking_settings_pkey PRIMARY KEY (project_id); + +ALTER TABLE ONLY project_feature_usages + ADD CONSTRAINT project_feature_usages_pkey PRIMARY KEY (project_id); + +ALTER TABLE ONLY project_features + ADD CONSTRAINT project_features_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_group_links + ADD CONSTRAINT project_group_links_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_import_data + ADD CONSTRAINT project_import_data_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_incident_management_settings + ADD CONSTRAINT project_incident_management_settings_pkey PRIMARY KEY (project_id); + +ALTER TABLE ONLY project_metrics_settings + ADD CONSTRAINT project_metrics_settings_pkey PRIMARY KEY (project_id); + +ALTER TABLE ONLY project_mirror_data + ADD CONSTRAINT project_mirror_data_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_repositories + ADD CONSTRAINT project_repositories_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_repository_states + ADD CONSTRAINT project_repository_states_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_settings + ADD CONSTRAINT project_settings_pkey PRIMARY KEY (project_id); + +ALTER TABLE ONLY project_statistics + ADD CONSTRAINT project_statistics_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY project_tracing_settings + ADD CONSTRAINT project_tracing_settings_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY projects + ADD CONSTRAINT projects_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY prometheus_alert_events + ADD CONSTRAINT prometheus_alert_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY prometheus_alerts + ADD CONSTRAINT prometheus_alerts_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY prometheus_metrics + ADD CONSTRAINT prometheus_metrics_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY protected_branch_merge_access_levels + ADD CONSTRAINT protected_branch_merge_access_levels_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY protected_branch_push_access_levels + ADD CONSTRAINT protected_branch_push_access_levels_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY protected_branch_unprotect_access_levels + ADD CONSTRAINT protected_branch_unprotect_access_levels_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY protected_branches + ADD CONSTRAINT protected_branches_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY protected_environment_deploy_access_levels + ADD CONSTRAINT protected_environment_deploy_access_levels_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY protected_environments + ADD CONSTRAINT protected_environments_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY protected_tag_create_access_levels + ADD CONSTRAINT protected_tag_create_access_levels_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY protected_tags + ADD CONSTRAINT protected_tags_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY push_rules + ADD CONSTRAINT push_rules_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY redirect_routes + ADD CONSTRAINT redirect_routes_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY release_links + ADD CONSTRAINT release_links_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY releases + ADD CONSTRAINT releases_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY remote_mirrors + ADD CONSTRAINT remote_mirrors_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY resource_label_events + ADD CONSTRAINT resource_label_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY resource_weight_events + ADD CONSTRAINT resource_weight_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY reviews + ADD CONSTRAINT reviews_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY routes + ADD CONSTRAINT routes_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY saml_providers + ADD CONSTRAINT saml_providers_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY scim_oauth_access_tokens + ADD CONSTRAINT scim_oauth_access_tokens_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY self_managed_prometheus_alert_events + ADD CONSTRAINT self_managed_prometheus_alert_events_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY sent_notifications + ADD CONSTRAINT sent_notifications_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY sentry_issues + ADD CONSTRAINT sentry_issues_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY serverless_domain_cluster + ADD CONSTRAINT serverless_domain_cluster_pkey PRIMARY KEY (uuid); + +ALTER TABLE ONLY service_desk_settings + ADD CONSTRAINT service_desk_settings_pkey PRIMARY KEY (project_id); + +ALTER TABLE ONLY services + ADD CONSTRAINT services_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY shards + ADD CONSTRAINT shards_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY slack_integrations + ADD CONSTRAINT slack_integrations_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY smartcard_identities + ADD CONSTRAINT smartcard_identities_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY snippet_user_mentions + ADD CONSTRAINT snippet_user_mentions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY snippets + ADD CONSTRAINT snippets_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY software_license_policies + ADD CONSTRAINT software_license_policies_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY software_licenses + ADD CONSTRAINT software_licenses_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY spam_logs + ADD CONSTRAINT spam_logs_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY subscriptions + ADD CONSTRAINT subscriptions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY suggestions + ADD CONSTRAINT suggestions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY system_note_metadata + ADD CONSTRAINT system_note_metadata_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY taggings + ADD CONSTRAINT taggings_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY tags + ADD CONSTRAINT tags_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY term_agreements + ADD CONSTRAINT term_agreements_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY timelogs + ADD CONSTRAINT timelogs_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY todos + ADD CONSTRAINT todos_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY trending_projects + ADD CONSTRAINT trending_projects_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY u2f_registrations + ADD CONSTRAINT u2f_registrations_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY uploads + ADD CONSTRAINT uploads_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY user_agent_details + ADD CONSTRAINT user_agent_details_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY user_callouts + ADD CONSTRAINT user_callouts_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY user_custom_attributes + ADD CONSTRAINT user_custom_attributes_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY user_preferences + ADD CONSTRAINT user_preferences_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY user_statuses + ADD CONSTRAINT user_statuses_pkey PRIMARY KEY (user_id); + +ALTER TABLE ONLY user_synced_attributes_metadata + ADD CONSTRAINT user_synced_attributes_metadata_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY users_ops_dashboard_projects + ADD CONSTRAINT users_ops_dashboard_projects_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY users + ADD CONSTRAINT users_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY users_star_projects + ADD CONSTRAINT users_star_projects_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerabilities + ADD CONSTRAINT vulnerabilities_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_feedback + ADD CONSTRAINT vulnerability_feedback_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_identifiers + ADD CONSTRAINT vulnerability_identifiers_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_issue_links + ADD CONSTRAINT vulnerability_issue_links_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_occurrence_identifiers + ADD CONSTRAINT vulnerability_occurrence_identifiers_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_occurrence_pipelines + ADD CONSTRAINT vulnerability_occurrence_pipelines_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_occurrences + ADD CONSTRAINT vulnerability_occurrences_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_scanners + ADD CONSTRAINT vulnerability_scanners_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY web_hook_logs + ADD CONSTRAINT web_hook_logs_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY web_hooks + ADD CONSTRAINT web_hooks_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY webauthn_registrations + ADD CONSTRAINT webauthn_registrations_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY x509_certificates + ADD CONSTRAINT x509_certificates_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY x509_commit_signatures + ADD CONSTRAINT x509_commit_signatures_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY x509_issuers + ADD CONSTRAINT x509_issuers_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY zoom_meetings + ADD CONSTRAINT zoom_meetings_pkey PRIMARY KEY (id); + +CREATE INDEX analytics_index_audit_events_on_created_at_and_author_id ON 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); + +CREATE UNIQUE INDEX analytics_repository_languages_unique_index ON analytics_language_trend_repository_languages USING btree (programming_language_id, project_id, snapshot_date); + +CREATE UNIQUE INDEX any_approver_merge_request_rule_type_unique_index ON approval_merge_request_rules USING btree (merge_request_id, rule_type) WHERE (rule_type = 4); + +CREATE UNIQUE INDEX any_approver_project_rule_type_unique_index ON approval_project_rules USING btree (project_id) WHERE (rule_type = 3); + +CREATE UNIQUE INDEX approval_rule_name_index_for_code_owners ON approval_merge_request_rules USING btree (merge_request_id, code_owner, name) WHERE (code_owner = true); + +CREATE INDEX ci_builds_gitlab_monitor_metrics ON ci_builds USING btree (status, created_at, project_id) WHERE ((type)::text = 'Ci::Build'::text); + +CREATE INDEX code_owner_approval_required ON protected_branches USING btree (project_id, code_owner_approval_required) WHERE (code_owner_approval_required = true); + +CREATE INDEX commit_id_and_note_id_index ON commit_user_mentions USING btree (commit_id, note_id); + +CREATE UNIQUE INDEX design_management_designs_versions_uniqueness ON design_management_designs_versions USING btree (design_id, version_id); + +CREATE INDEX design_user_mentions_on_design_id_and_note_id_index ON design_user_mentions USING btree (design_id, note_id); + +CREATE INDEX epic_mentions_temp_index ON notes USING btree (id) WHERE ((note ~~ '%@%'::text) AND ((noteable_type)::text = 'Epic'::text)); + +CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_and_note_id_index ON epic_user_mentions USING btree (epic_id, note_id); + +CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_index ON epic_user_mentions USING btree (epic_id) WHERE (note_id IS NULL); + +CREATE UNIQUE INDEX idx_deployment_merge_requests_unique_index ON deployment_merge_requests USING btree (deployment_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); + +CREATE INDEX idx_issues_on_project_id_and_created_at_and_id_and_state_id ON issues USING btree (project_id, created_at, id, state_id); + +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_due_date_and_id_and_state_partial ON issues USING btree (project_id, due_date, id, state) WHERE (due_date IS NOT NULL); + +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); + +CREATE INDEX idx_issues_on_state_id ON issues USING btree (state_id); + +CREATE INDEX idx_jira_connect_subscriptions_on_installation_id ON jira_connect_subscriptions USING btree (jira_connect_installation_id); + +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_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)); + +CREATE INDEX idx_merge_requests_on_source_project_and_branch_state_opened ON merge_requests USING btree (source_project_id, source_branch) WHERE (state_id = 1); + +CREATE INDEX idx_merge_requests_on_state_id_and_merge_status ON merge_requests USING btree (state_id, merge_status) WHERE ((state_id = 1) AND ((merge_status)::text = 'can_be_merged'::text)); + +CREATE INDEX idx_merge_requests_on_target_project_id_and_iid_opened ON merge_requests USING btree (target_project_id, iid) WHERE (state_id = 1); + +CREATE INDEX idx_mr_cc_diff_files_on_mr_cc_id ON merge_request_context_commit_diff_files USING btree (merge_request_context_commit_id); + +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_packages_packages_on_project_id_name_version_package_type ON packages_packages USING btree (project_id, name, version, package_type); + +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); + +CREATE INDEX idx_proj_feat_usg_on_jira_dvcs_cloud_last_sync_at_and_proj_id ON project_feature_usages USING btree (jira_dvcs_cloud_last_sync_at, project_id) WHERE (jira_dvcs_cloud_last_sync_at IS NOT NULL); + +CREATE INDEX idx_proj_feat_usg_on_jira_dvcs_server_last_sync_at_and_proj_id ON project_feature_usages USING btree (jira_dvcs_server_last_sync_at, project_id) WHERE (jira_dvcs_server_last_sync_at IS NOT NULL); + +CREATE UNIQUE INDEX idx_project_id_payload_key_self_managed_prometheus_alert_events ON self_managed_prometheus_alert_events USING btree (project_id, payload_key); + +CREATE INDEX idx_project_repository_check_partial ON projects USING btree (repository_storage, created_at) WHERE (last_repository_check_at IS NULL); + +CREATE INDEX idx_projects_on_repository_storage_last_repository_updated_at ON projects USING btree (id, repository_storage, last_repository_updated_at); + +CREATE INDEX idx_repository_states_on_last_repository_verification_ran_at ON project_repository_states USING btree (project_id, last_repository_verification_ran_at) WHERE ((repository_verification_checksum IS NOT NULL) AND (last_repository_verification_failure IS NULL)); + +CREATE INDEX idx_repository_states_on_last_wiki_verification_ran_at ON project_repository_states USING btree (project_id, last_wiki_verification_ran_at) WHERE ((wiki_verification_checksum IS NOT NULL) AND (last_wiki_verification_failure IS NULL)); + +CREATE INDEX idx_repository_states_on_repository_failure_partial ON project_repository_states USING btree (last_repository_verification_failure) WHERE (last_repository_verification_failure IS NOT NULL); + +CREATE INDEX idx_repository_states_on_wiki_failure_partial ON project_repository_states USING btree (last_wiki_verification_failure) WHERE (last_wiki_verification_failure IS NOT NULL); + +CREATE INDEX idx_repository_states_outdated_checksums ON project_repository_states USING btree (project_id) WHERE (((repository_verification_checksum IS NULL) AND (last_repository_verification_failure IS NULL)) OR ((wiki_verification_checksum IS NULL) AND (last_wiki_verification_failure IS NULL))); + +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_vulnerability_issue_links_on_vulnerability_id_and_issue_id ON vulnerability_issue_links USING btree (vulnerability_id, issue_id); + +CREATE UNIQUE INDEX idx_vulnerability_issue_links_on_vulnerability_id_and_link_type ON vulnerability_issue_links USING btree (vulnerability_id, link_type) WHERE (link_type = 2); + +CREATE INDEX index_abuse_reports_on_user_id ON abuse_reports USING btree (user_id); + +CREATE INDEX index_alerts_service_data_on_service_id ON alerts_service_data USING btree (service_id); + +CREATE INDEX index_allowed_email_domains_on_group_id ON allowed_email_domains USING btree (group_id); + +CREATE INDEX index_analytics_ca_group_stages_on_end_event_label_id ON analytics_cycle_analytics_group_stages USING btree (end_event_label_id); + +CREATE INDEX index_analytics_ca_group_stages_on_group_id ON analytics_cycle_analytics_group_stages USING btree (group_id); + +CREATE UNIQUE INDEX index_analytics_ca_group_stages_on_group_id_and_name ON analytics_cycle_analytics_group_stages USING btree (group_id, name); + +CREATE INDEX index_analytics_ca_group_stages_on_relative_position ON analytics_cycle_analytics_group_stages USING btree (relative_position); + +CREATE INDEX index_analytics_ca_group_stages_on_start_event_label_id ON analytics_cycle_analytics_group_stages USING btree (start_event_label_id); + +CREATE INDEX index_analytics_ca_project_stages_on_end_event_label_id ON analytics_cycle_analytics_project_stages USING btree (end_event_label_id); + +CREATE INDEX index_analytics_ca_project_stages_on_project_id ON analytics_cycle_analytics_project_stages USING btree (project_id); + +CREATE UNIQUE INDEX index_analytics_ca_project_stages_on_project_id_and_name ON analytics_cycle_analytics_project_stages USING btree (project_id, name); + +CREATE INDEX index_analytics_ca_project_stages_on_relative_position ON analytics_cycle_analytics_project_stages USING btree (relative_position); + +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_repository_file_commits_file_id ON analytics_repository_file_commits USING btree (analytics_repository_file_id); + +CREATE INDEX index_analytics_repository_file_edits_on_project_id ON analytics_repository_file_edits USING btree (project_id); + +CREATE UNIQUE INDEX index_analytics_repository_files_on_project_id_and_file_path ON analytics_repository_files USING btree (project_id, file_path); + +CREATE INDEX index_application_settings_on_custom_project_templates_group_id ON application_settings USING btree (custom_project_templates_group_id); + +CREATE INDEX index_application_settings_on_file_template_project_id ON application_settings USING btree (file_template_project_id); + +CREATE INDEX index_application_settings_on_usage_stats_set_by_user_id ON application_settings USING btree (usage_stats_set_by_user_id); + +CREATE INDEX index_applicationsettings_on_instance_administration_project_id ON application_settings USING btree (instance_administration_project_id); + +CREATE UNIQUE INDEX index_approval_merge_request_rule_sources_1 ON approval_merge_request_rule_sources USING btree (approval_merge_request_rule_id); + +CREATE INDEX index_approval_merge_request_rule_sources_2 ON approval_merge_request_rule_sources USING btree (approval_project_rule_id); + +CREATE INDEX index_approval_merge_request_rules_1 ON approval_merge_request_rules USING btree (merge_request_id, code_owner); + +CREATE UNIQUE INDEX index_approval_merge_request_rules_approved_approvers_1 ON approval_merge_request_rules_approved_approvers USING btree (approval_merge_request_rule_id, user_id); + +CREATE INDEX index_approval_merge_request_rules_approved_approvers_2 ON approval_merge_request_rules_approved_approvers USING btree (user_id); + +CREATE UNIQUE INDEX index_approval_merge_request_rules_groups_1 ON approval_merge_request_rules_groups USING btree (approval_merge_request_rule_id, group_id); + +CREATE INDEX index_approval_merge_request_rules_groups_2 ON approval_merge_request_rules_groups USING btree (group_id); + +CREATE UNIQUE INDEX index_approval_merge_request_rules_users_1 ON approval_merge_request_rules_users USING btree (approval_merge_request_rule_id, user_id); + +CREATE INDEX index_approval_merge_request_rules_users_2 ON approval_merge_request_rules_users USING btree (user_id); + +CREATE UNIQUE INDEX index_approval_project_rules_groups_1 ON approval_project_rules_groups USING btree (approval_project_rule_id, group_id); + +CREATE INDEX index_approval_project_rules_groups_2 ON approval_project_rules_groups USING btree (group_id); + +CREATE INDEX index_approval_project_rules_on_project_id ON approval_project_rules USING btree (project_id); + +CREATE INDEX index_approval_project_rules_on_rule_type ON approval_project_rules USING btree (rule_type); + +CREATE UNIQUE INDEX index_approval_project_rules_users_1 ON approval_project_rules_users USING btree (approval_project_rule_id, user_id); + +CREATE INDEX index_approval_project_rules_users_2 ON approval_project_rules_users USING btree (user_id); + +CREATE UNIQUE INDEX index_approval_rule_name_for_code_owners_rule_type ON approval_merge_request_rules USING btree (merge_request_id, rule_type, name) WHERE (rule_type = 2); + +CREATE INDEX index_approval_rules_code_owners_rule_type ON approval_merge_request_rules USING btree (merge_request_id, rule_type) WHERE (rule_type = 2); + +CREATE INDEX index_approvals_on_merge_request_id ON approvals USING btree (merge_request_id); + +CREATE UNIQUE INDEX index_approvals_on_user_id_and_merge_request_id ON approvals USING btree (user_id, merge_request_id); + +CREATE INDEX index_approver_groups_on_group_id ON approver_groups USING btree (group_id); + +CREATE INDEX index_approver_groups_on_target_id_and_target_type ON approver_groups USING btree (target_id, target_type); + +CREATE INDEX index_approvers_on_target_id_and_target_type ON approvers USING btree (target_id, target_type); + +CREATE INDEX index_approvers_on_user_id ON approvers USING btree (user_id); + +CREATE INDEX index_audit_events_on_entity_id_and_entity_type ON audit_events USING btree (entity_id, entity_type); + +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); + +CREATE INDEX index_badges_on_group_id ON badges USING btree (group_id); + +CREATE INDEX index_badges_on_project_id ON badges USING btree (project_id); + +CREATE INDEX index_board_assignees_on_assignee_id ON board_assignees USING btree (assignee_id); + +CREATE UNIQUE INDEX index_board_assignees_on_board_id_and_assignee_id ON board_assignees USING btree (board_id, assignee_id); + +CREATE INDEX index_board_group_recent_visits_on_board_id ON board_group_recent_visits USING btree (board_id); + +CREATE INDEX index_board_group_recent_visits_on_group_id ON board_group_recent_visits USING btree (group_id); + +CREATE UNIQUE INDEX index_board_group_recent_visits_on_user_group_and_board ON board_group_recent_visits USING btree (user_id, group_id, board_id); + +CREATE INDEX index_board_group_recent_visits_on_user_id ON board_group_recent_visits USING btree (user_id); + +CREATE UNIQUE INDEX index_board_labels_on_board_id_and_label_id ON board_labels USING btree (board_id, label_id); + +CREATE INDEX index_board_labels_on_label_id ON board_labels USING btree (label_id); + +CREATE INDEX index_board_project_recent_visits_on_board_id ON board_project_recent_visits USING btree (board_id); + +CREATE INDEX index_board_project_recent_visits_on_project_id ON board_project_recent_visits USING btree (project_id); + +CREATE INDEX index_board_project_recent_visits_on_user_id ON board_project_recent_visits USING btree (user_id); + +CREATE UNIQUE INDEX index_board_project_recent_visits_on_user_project_and_board ON board_project_recent_visits USING btree (user_id, project_id, board_id); + +CREATE INDEX index_boards_on_group_id ON boards USING btree (group_id); + +CREATE INDEX index_boards_on_milestone_id ON boards USING btree (milestone_id); + +CREATE INDEX index_boards_on_project_id ON boards USING btree (project_id); + +CREATE INDEX index_broadcast_messages_on_starts_at_and_ends_at_and_id ON broadcast_messages USING btree (starts_at, ends_at, id); + +CREATE UNIQUE INDEX index_chat_names_on_service_id_and_team_id_and_chat_id ON chat_names USING btree (service_id, team_id, chat_id); + +CREATE UNIQUE INDEX index_chat_names_on_user_id_and_service_id ON chat_names USING btree (user_id, service_id); + +CREATE UNIQUE INDEX index_chat_teams_on_namespace_id ON chat_teams USING btree (namespace_id); + +CREATE UNIQUE INDEX index_ci_build_needs_on_build_id_and_name ON ci_build_needs USING btree (build_id, name); + +CREATE UNIQUE INDEX index_ci_build_trace_chunks_on_build_id_and_chunk_index ON ci_build_trace_chunks USING btree (build_id, chunk_index); + +CREATE UNIQUE INDEX index_ci_build_trace_section_names_on_project_id_and_name ON ci_build_trace_section_names USING btree (project_id, name); + +CREATE UNIQUE INDEX index_ci_build_trace_sections_on_build_id_and_section_name_id ON ci_build_trace_sections USING btree (build_id, section_name_id); + +CREATE INDEX index_ci_build_trace_sections_on_project_id ON ci_build_trace_sections USING btree (project_id); + +CREATE INDEX index_ci_build_trace_sections_on_section_name_id ON ci_build_trace_sections USING btree (section_name_id); + +CREATE UNIQUE INDEX index_ci_builds_metadata_on_build_id ON ci_builds_metadata USING btree (build_id); + +CREATE INDEX index_ci_builds_metadata_on_build_id_and_has_exposed_artifacts ON ci_builds_metadata USING btree (build_id) WHERE (has_exposed_artifacts IS TRUE); + +CREATE INDEX index_ci_builds_metadata_on_build_id_and_interruptible ON ci_builds_metadata USING btree (build_id) WHERE (interruptible = true); + +CREATE INDEX index_ci_builds_metadata_on_project_id ON ci_builds_metadata USING btree (project_id); + +CREATE INDEX index_ci_builds_on_artifacts_expire_at ON ci_builds USING btree (artifacts_expire_at) WHERE (artifacts_file <> ''::text); + +CREATE INDEX index_ci_builds_on_auto_canceled_by_id ON ci_builds USING btree (auto_canceled_by_id); + +CREATE INDEX index_ci_builds_on_commit_id_and_artifacts_expireatandidpartial ON ci_builds USING btree (commit_id, artifacts_expire_at, id) WHERE (((type)::text = 'Ci::Build'::text) AND ((retried = false) OR (retried IS NULL)) AND ((name)::text = ANY (ARRAY[('sast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('sast:container'::character varying)::text, ('container_scanning'::character varying)::text, ('dast'::character varying)::text]))); + +CREATE INDEX index_ci_builds_on_commit_id_and_stage_idx_and_created_at ON ci_builds USING btree (commit_id, stage_idx, created_at); + +CREATE INDEX index_ci_builds_on_commit_id_and_status_and_type ON ci_builds USING btree (commit_id, status, type); + +CREATE INDEX index_ci_builds_on_commit_id_and_type_and_name_and_ref ON ci_builds USING btree (commit_id, type, name, ref); + +CREATE INDEX index_ci_builds_on_commit_id_and_type_and_ref ON ci_builds USING btree (commit_id, type, ref); + +CREATE INDEX index_ci_builds_on_name_for_security_products_values ON ci_builds USING btree (name) WHERE ((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('sast'::character varying)::text])); + +CREATE INDEX index_ci_builds_on_project_id_and_id ON ci_builds USING btree (project_id, id); + +CREATE INDEX index_ci_builds_on_project_id_and_name_and_ref ON ci_builds USING btree (project_id, name, ref) WHERE (((type)::text = 'Ci::Build'::text) AND ((status)::text = 'success'::text) AND ((retried = false) OR (retried IS NULL))); + +CREATE INDEX index_ci_builds_on_project_id_for_successfull_pages_deploy ON ci_builds USING btree (project_id) WHERE (((type)::text = 'GenericCommitStatus'::text) AND ((stage)::text = 'deploy'::text) AND ((name)::text = 'pages:deploy'::text) AND ((status)::text = 'success'::text)); + +CREATE INDEX index_ci_builds_on_protected ON ci_builds USING btree (protected); + +CREATE INDEX index_ci_builds_on_queued_at ON ci_builds USING btree (queued_at); + +CREATE INDEX index_ci_builds_on_runner_id ON ci_builds USING btree (runner_id); + +CREATE INDEX index_ci_builds_on_stage_id ON ci_builds USING btree (stage_id); + +CREATE INDEX index_ci_builds_on_status_and_type_and_runner_id ON ci_builds USING btree (status, type, runner_id); + +CREATE UNIQUE INDEX index_ci_builds_on_token ON ci_builds USING btree (token); + +CREATE UNIQUE INDEX index_ci_builds_on_token_encrypted ON ci_builds USING btree (token_encrypted) WHERE (token_encrypted IS NOT NULL); + +CREATE INDEX index_ci_builds_on_updated_at ON ci_builds USING btree (updated_at); + +CREATE INDEX index_ci_builds_on_upstream_pipeline_id ON ci_builds USING btree (upstream_pipeline_id) WHERE (upstream_pipeline_id IS NOT NULL); + +CREATE INDEX index_ci_builds_on_user_id ON ci_builds USING btree (user_id); + +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 UNIQUE INDEX index_ci_builds_runner_session_on_build_id ON ci_builds_runner_session USING btree (build_id); + +CREATE UNIQUE INDEX index_ci_group_variables_on_group_id_and_key ON ci_group_variables USING btree (group_id, key); + +CREATE INDEX index_ci_job_artifacts_on_expire_at_and_job_id ON ci_job_artifacts USING btree (expire_at, job_id); + +CREATE INDEX index_ci_job_artifacts_on_file_store ON ci_job_artifacts USING btree (file_store); + +CREATE UNIQUE INDEX index_ci_job_artifacts_on_job_id_and_file_type ON ci_job_artifacts USING btree (job_id, file_type); + +CREATE INDEX index_ci_job_artifacts_on_project_id ON ci_job_artifacts USING btree (project_id); + +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_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_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); + +CREATE UNIQUE INDEX index_ci_pipeline_schedule_variables_on_schedule_id_and_key ON ci_pipeline_schedule_variables USING btree (pipeline_schedule_id, key); + +CREATE INDEX index_ci_pipeline_schedules_on_next_run_at_and_active ON ci_pipeline_schedules USING btree (next_run_at, active); + +CREATE INDEX index_ci_pipeline_schedules_on_owner_id ON ci_pipeline_schedules USING btree (owner_id); + +CREATE INDEX index_ci_pipeline_schedules_on_project_id ON ci_pipeline_schedules USING btree (project_id); + +CREATE INDEX index_ci_pipeline_variables_on_pipeline_id ON ci_pipeline_variables USING btree (pipeline_id) WHERE ((key)::text = 'AUTO_DEVOPS_MODSECURITY_SEC_RULE_ENGINE'::text); + +CREATE UNIQUE INDEX index_ci_pipeline_variables_on_pipeline_id_and_key ON ci_pipeline_variables USING btree (pipeline_id, key); + +CREATE INDEX index_ci_pipelines_config_on_pipeline_id ON ci_pipelines_config USING btree (pipeline_id); + +CREATE INDEX index_ci_pipelines_on_auto_canceled_by_id ON ci_pipelines USING btree (auto_canceled_by_id); + +CREATE INDEX index_ci_pipelines_on_external_pull_request_id ON ci_pipelines USING btree (external_pull_request_id) WHERE (external_pull_request_id IS NOT NULL); + +CREATE INDEX index_ci_pipelines_on_merge_request_id ON ci_pipelines USING btree (merge_request_id) WHERE (merge_request_id IS NOT NULL); + +CREATE INDEX index_ci_pipelines_on_pipeline_schedule_id ON ci_pipelines USING btree (pipeline_schedule_id); + +CREATE INDEX index_ci_pipelines_on_project_id_and_id_desc ON ci_pipelines USING btree (project_id, id DESC); + +CREATE UNIQUE INDEX index_ci_pipelines_on_project_id_and_iid ON ci_pipelines USING btree (project_id, iid) WHERE (iid IS NOT NULL); + +CREATE INDEX index_ci_pipelines_on_project_id_and_ref_and_status_and_id ON ci_pipelines USING btree (project_id, ref, status, id); + +CREATE INDEX index_ci_pipelines_on_project_id_and_sha ON ci_pipelines USING btree (project_id, sha); + +CREATE INDEX index_ci_pipelines_on_project_id_and_source ON ci_pipelines USING btree (project_id, source); + +CREATE INDEX index_ci_pipelines_on_project_id_and_status_and_config_source ON ci_pipelines USING btree (project_id, status, config_source); + +CREATE INDEX index_ci_pipelines_on_project_id_and_status_and_updated_at ON ci_pipelines USING btree (project_id, status, updated_at); + +CREATE INDEX index_ci_pipelines_on_project_idandrefandiddesc ON ci_pipelines USING btree (project_id, ref, id DESC); + +CREATE INDEX index_ci_pipelines_on_status ON ci_pipelines USING btree (status); + +CREATE INDEX index_ci_pipelines_on_user_id ON ci_pipelines USING btree (user_id); + +CREATE INDEX index_ci_refs_on_last_updated_by_pipeline_id ON ci_refs USING btree (last_updated_by_pipeline_id); + +CREATE UNIQUE INDEX index_ci_refs_on_project_id_and_ref_and_tag ON ci_refs USING btree (project_id, ref, tag); + +CREATE UNIQUE INDEX index_ci_resource_groups_on_project_id_and_key ON ci_resource_groups USING btree (project_id, key); + +CREATE INDEX index_ci_resources_on_build_id ON ci_resources USING btree (build_id); + +CREATE UNIQUE INDEX index_ci_resources_on_resource_group_id_and_build_id ON ci_resources USING btree (resource_group_id, build_id); + +CREATE INDEX index_ci_runner_namespaces_on_namespace_id ON ci_runner_namespaces USING btree (namespace_id); + +CREATE UNIQUE INDEX index_ci_runner_namespaces_on_runner_id_and_namespace_id ON ci_runner_namespaces USING btree (runner_id, namespace_id); + +CREATE INDEX index_ci_runner_projects_on_project_id ON ci_runner_projects USING btree (project_id); + +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_is_shared ON ci_runners USING btree (is_shared); + +CREATE INDEX index_ci_runners_on_locked ON ci_runners USING btree (locked); + +CREATE INDEX index_ci_runners_on_runner_type ON ci_runners USING btree (runner_type); + +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 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); + +CREATE INDEX index_ci_sources_pipelines_on_source_job_id ON ci_sources_pipelines USING btree (source_job_id); + +CREATE INDEX index_ci_sources_pipelines_on_source_pipeline_id ON ci_sources_pipelines USING btree (source_pipeline_id); + +CREATE INDEX index_ci_sources_pipelines_on_source_project_id ON ci_sources_pipelines USING btree (source_project_id); + +CREATE INDEX index_ci_stages_on_pipeline_id ON ci_stages USING btree (pipeline_id); + +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"); + +CREATE INDEX index_ci_stages_on_project_id ON ci_stages USING btree (project_id); + +CREATE INDEX index_ci_subscriptions_projects_on_upstream_project_id ON ci_subscriptions_projects USING btree (upstream_project_id); + +CREATE UNIQUE INDEX index_ci_subscriptions_projects_unique_subscription ON ci_subscriptions_projects USING btree (downstream_project_id, upstream_project_id); + +CREATE INDEX index_ci_trigger_requests_on_commit_id ON ci_trigger_requests USING btree (commit_id); + +CREATE INDEX index_ci_trigger_requests_on_trigger_id_and_id ON ci_trigger_requests USING btree (trigger_id, id DESC); + +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_variables_on_project_id ON ci_variables USING btree (project_id) WHERE ((key)::text = 'AUTO_DEVOPS_MODSECURITY_SEC_RULE_ENGINE'::text); + +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 UNIQUE INDEX index_cluster_groups_on_cluster_id_and_group_id ON cluster_groups USING btree (cluster_id, group_id); + +CREATE INDEX index_cluster_groups_on_group_id ON cluster_groups USING btree (group_id); + +CREATE UNIQUE INDEX index_cluster_platforms_kubernetes_on_cluster_id ON cluster_platforms_kubernetes USING btree (cluster_id); + +CREATE INDEX index_cluster_projects_on_cluster_id ON cluster_projects USING btree (cluster_id); + +CREATE INDEX index_cluster_projects_on_project_id ON cluster_projects USING btree (project_id); + +CREATE UNIQUE INDEX index_cluster_providers_aws_on_cluster_id ON cluster_providers_aws USING btree (cluster_id); + +CREATE INDEX index_cluster_providers_aws_on_cluster_id_and_status ON cluster_providers_aws USING btree (cluster_id, status); + +CREATE INDEX index_cluster_providers_aws_on_created_by_user_id ON cluster_providers_aws USING btree (created_by_user_id); + +CREATE INDEX index_cluster_providers_gcp_on_cloud_run ON cluster_providers_gcp USING btree (cloud_run); + +CREATE UNIQUE INDEX index_cluster_providers_gcp_on_cluster_id ON cluster_providers_gcp USING btree (cluster_id); + +CREATE UNIQUE INDEX index_clusters_applications_cert_managers_on_cluster_id ON clusters_applications_cert_managers USING btree (cluster_id); + +CREATE UNIQUE INDEX index_clusters_applications_crossplane_on_cluster_id ON clusters_applications_crossplane USING btree (cluster_id); + +CREATE UNIQUE INDEX index_clusters_applications_elastic_stacks_on_cluster_id ON clusters_applications_elastic_stacks USING btree (cluster_id); + +CREATE UNIQUE INDEX index_clusters_applications_helm_on_cluster_id ON clusters_applications_helm USING btree (cluster_id); + +CREATE UNIQUE INDEX index_clusters_applications_ingress_on_cluster_id ON clusters_applications_ingress USING btree (cluster_id); + +CREATE UNIQUE INDEX index_clusters_applications_jupyter_on_cluster_id ON clusters_applications_jupyter USING btree (cluster_id); + +CREATE INDEX index_clusters_applications_jupyter_on_oauth_application_id ON clusters_applications_jupyter USING btree (oauth_application_id); + +CREATE UNIQUE INDEX index_clusters_applications_knative_on_cluster_id ON clusters_applications_knative USING btree (cluster_id); + +CREATE UNIQUE INDEX index_clusters_applications_prometheus_on_cluster_id ON clusters_applications_prometheus USING btree (cluster_id); + +CREATE UNIQUE INDEX index_clusters_applications_runners_on_cluster_id ON clusters_applications_runners USING btree (cluster_id); + +CREATE INDEX index_clusters_applications_runners_on_runner_id ON clusters_applications_runners USING btree (runner_id); + +CREATE INDEX index_clusters_kubernetes_namespaces_on_cluster_id ON clusters_kubernetes_namespaces USING btree (cluster_id); + +CREATE INDEX index_clusters_kubernetes_namespaces_on_cluster_project_id ON clusters_kubernetes_namespaces USING btree (cluster_project_id); + +CREATE INDEX index_clusters_kubernetes_namespaces_on_environment_id ON clusters_kubernetes_namespaces USING btree (environment_id); + +CREATE INDEX index_clusters_kubernetes_namespaces_on_project_id ON clusters_kubernetes_namespaces USING btree (project_id); + +CREATE INDEX index_clusters_on_enabled ON clusters USING btree (enabled); + +CREATE INDEX index_clusters_on_management_project_id ON clusters USING btree (management_project_id) WHERE (management_project_id IS NOT NULL); + +CREATE INDEX index_clusters_on_user_id ON clusters USING btree (user_id); + +CREATE UNIQUE INDEX index_commit_user_mentions_on_note_id ON commit_user_mentions USING btree (note_id); + +CREATE INDEX index_container_expiration_policies_on_next_run_at_and_enabled ON container_expiration_policies USING btree (next_run_at, enabled); + +CREATE INDEX index_container_repositories_on_project_id ON container_repositories USING btree (project_id); + +CREATE UNIQUE INDEX index_container_repositories_on_project_id_and_name ON container_repositories USING btree (project_id, name); + +CREATE INDEX index_dependency_proxy_blobs_on_group_id_and_file_name ON dependency_proxy_blobs USING btree (group_id, file_name); + +CREATE INDEX index_dependency_proxy_group_settings_on_group_id ON dependency_proxy_group_settings USING btree (group_id); + +CREATE INDEX index_deploy_keys_projects_on_deploy_key_id ON deploy_keys_projects USING btree (deploy_key_id); + +CREATE INDEX index_deploy_keys_projects_on_project_id ON deploy_keys_projects USING btree (project_id); + +CREATE UNIQUE INDEX index_deploy_tokens_on_token ON deploy_tokens USING btree (token); + +CREATE INDEX index_deploy_tokens_on_token_and_expires_at_and_id ON deploy_tokens USING btree (token, expires_at, id) WHERE (revoked IS FALSE); + +CREATE UNIQUE INDEX index_deploy_tokens_on_token_encrypted ON deploy_tokens USING btree (token_encrypted); + +CREATE INDEX index_deployment_merge_requests_on_merge_request_id ON deployment_merge_requests USING btree (merge_request_id); + +CREATE INDEX index_deployments_on_cluster_id_and_status ON deployments USING btree (cluster_id, status); + +CREATE INDEX index_deployments_on_created_at ON deployments USING btree (created_at); + +CREATE INDEX index_deployments_on_deployable_type_and_deployable_id ON deployments USING btree (deployable_type, deployable_id); + +CREATE INDEX index_deployments_on_environment_id_and_id ON deployments USING btree (environment_id, id); + +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_and_status ON deployments USING btree (environment_id, status); + +CREATE INDEX index_deployments_on_project_id_and_id ON deployments USING btree (project_id, id DESC); + +CREATE UNIQUE INDEX index_deployments_on_project_id_and_iid ON deployments USING btree (project_id, iid); + +CREATE INDEX index_deployments_on_project_id_and_ref ON deployments USING btree (project_id, ref); + +CREATE INDEX index_deployments_on_project_id_and_status ON deployments USING btree (project_id, status); + +CREATE INDEX index_deployments_on_project_id_and_status_and_created_at ON deployments USING btree (project_id, status, created_at); + +CREATE INDEX index_deployments_on_project_id_and_updated_at_and_id ON deployments USING btree (project_id, updated_at DESC, id DESC); + +CREATE INDEX index_description_versions_on_epic_id ON description_versions USING btree (epic_id) WHERE (epic_id IS NOT NULL); + +CREATE INDEX index_description_versions_on_issue_id ON description_versions USING btree (issue_id) WHERE (issue_id IS NOT NULL); + +CREATE INDEX index_description_versions_on_merge_request_id ON description_versions USING btree (merge_request_id) WHERE (merge_request_id IS NOT NULL); + +CREATE UNIQUE INDEX index_design_management_designs_on_issue_id_and_filename ON design_management_designs USING btree (issue_id, filename); + +CREATE INDEX index_design_management_designs_on_project_id ON design_management_designs USING btree (project_id); + +CREATE INDEX index_design_management_designs_versions_on_design_id ON design_management_designs_versions USING btree (design_id); + +CREATE INDEX index_design_management_designs_versions_on_event ON design_management_designs_versions USING btree (event); + +CREATE INDEX index_design_management_designs_versions_on_version_id ON design_management_designs_versions USING btree (version_id); + +CREATE INDEX index_design_management_versions_on_author_id ON design_management_versions USING btree (author_id) WHERE (author_id IS NOT NULL); + +CREATE INDEX index_design_management_versions_on_issue_id ON design_management_versions USING btree (issue_id); + +CREATE UNIQUE INDEX index_design_management_versions_on_sha_and_issue_id ON design_management_versions USING btree (sha, issue_id); + +CREATE UNIQUE INDEX index_design_user_mentions_on_note_id ON design_user_mentions USING btree (note_id); + +CREATE INDEX index_draft_notes_on_author_id ON draft_notes USING btree (author_id); + +CREATE INDEX index_draft_notes_on_discussion_id ON draft_notes USING btree (discussion_id); + +CREATE INDEX index_draft_notes_on_merge_request_id ON draft_notes USING btree (merge_request_id); + +CREATE INDEX index_elasticsearch_indexed_namespaces_on_created_at ON elasticsearch_indexed_namespaces USING btree (created_at); + +CREATE UNIQUE INDEX index_elasticsearch_indexed_namespaces_on_namespace_id ON elasticsearch_indexed_namespaces USING btree (namespace_id); + +CREATE UNIQUE INDEX index_elasticsearch_indexed_projects_on_project_id ON elasticsearch_indexed_projects USING btree (project_id); + +CREATE UNIQUE INDEX index_emails_on_confirmation_token ON emails USING btree (confirmation_token); + +CREATE UNIQUE INDEX index_emails_on_email ON emails USING btree (email); + +CREATE INDEX index_emails_on_user_id ON emails USING btree (user_id); + +CREATE INDEX index_environments_on_name_varchar_pattern_ops ON environments USING btree (name varchar_pattern_ops); + +CREATE UNIQUE INDEX index_environments_on_project_id_and_name ON environments USING btree (project_id, name); + +CREATE UNIQUE INDEX index_environments_on_project_id_and_slug ON environments USING btree (project_id, slug); + +CREATE INDEX index_environments_on_project_id_state_environment_type ON environments USING btree (project_id, state, environment_type); + +CREATE INDEX index_epic_issues_on_epic_id ON epic_issues USING btree (epic_id); + +CREATE UNIQUE INDEX index_epic_issues_on_issue_id ON epic_issues USING btree (issue_id); + +CREATE INDEX index_epic_metrics ON epic_metrics USING btree (epic_id); + +CREATE UNIQUE INDEX index_epic_user_mentions_on_note_id ON epic_user_mentions USING btree (note_id) WHERE (note_id IS NOT NULL); + +CREATE INDEX index_epics_on_assignee_id ON epics USING btree (assignee_id); + +CREATE INDEX index_epics_on_author_id ON epics USING btree (author_id); + +CREATE INDEX index_epics_on_closed_by_id ON epics USING btree (closed_by_id); + +CREATE INDEX index_epics_on_due_date_sourcing_epic_id ON epics USING btree (due_date_sourcing_epic_id) WHERE (due_date_sourcing_epic_id IS NOT NULL); + +CREATE INDEX index_epics_on_due_date_sourcing_milestone_id ON epics USING btree (due_date_sourcing_milestone_id); + +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 INDEX index_epics_on_iid ON epics USING btree (iid); + +CREATE INDEX index_epics_on_parent_id ON epics USING btree (parent_id); + +CREATE INDEX index_epics_on_start_date ON epics USING btree (start_date); + +CREATE INDEX index_epics_on_start_date_sourcing_epic_id ON epics USING btree (start_date_sourcing_epic_id) WHERE (start_date_sourcing_epic_id IS NOT NULL); + +CREATE INDEX index_epics_on_start_date_sourcing_milestone_id ON epics USING btree (start_date_sourcing_milestone_id); + +CREATE INDEX index_events_on_action ON events USING btree (action); + +CREATE INDEX index_events_on_author_id_and_project_id ON events USING btree (author_id, project_id); + +CREATE INDEX index_events_on_group_id_partial ON events USING btree (group_id) WHERE (group_id IS NOT NULL); + +CREATE INDEX index_events_on_project_id_and_created_at ON events USING btree (project_id, created_at); + +CREATE INDEX index_events_on_project_id_and_id ON events USING btree (project_id, id); + +CREATE INDEX index_events_on_target_type_and_target_id ON events USING btree (target_type, target_id); + +CREATE INDEX index_evidences_on_release_id ON evidences USING btree (release_id); + +CREATE UNIQUE INDEX index_external_pull_requests_on_project_and_branches ON external_pull_requests USING btree (project_id, source_branch, target_branch); + +CREATE UNIQUE INDEX index_feature_flag_scopes_on_flag_id_and_environment_scope ON operations_feature_flag_scopes USING btree (feature_flag_id, environment_scope); + +CREATE UNIQUE INDEX index_feature_flags_clients_on_project_id_and_token_encrypted ON operations_feature_flags_clients USING btree (project_id, token_encrypted); + +CREATE UNIQUE INDEX index_feature_gates_on_feature_key_and_key_and_value ON feature_gates USING btree (feature_key, key, value); + +CREATE UNIQUE INDEX index_features_on_key ON features USING btree (key); + +CREATE UNIQUE INDEX index_file_commits_on_committed_date_file_id_and_project_id ON analytics_repository_file_commits USING btree (project_id, committed_date, analytics_repository_file_id); + +CREATE UNIQUE INDEX index_file_edits_on_committed_date_file_id_and_project_id ON analytics_repository_file_edits USING btree (analytics_repository_file_id, committed_date, project_id); + +CREATE INDEX index_for_resource_group ON ci_builds USING btree (resource_group_id, id) WHERE (resource_group_id IS NOT NULL); + +CREATE INDEX index_for_status_per_branch_per_project ON merge_trains USING btree (target_project_id, target_branch, status); + +CREATE INDEX index_fork_network_members_on_fork_network_id ON fork_network_members USING btree (fork_network_id); + +CREATE INDEX index_fork_network_members_on_forked_from_project_id ON fork_network_members USING btree (forked_from_project_id); + +CREATE UNIQUE INDEX index_fork_network_members_on_project_id ON fork_network_members USING btree (project_id); + +CREATE UNIQUE INDEX index_fork_networks_on_root_project_id ON fork_networks USING btree (root_project_id); + +CREATE UNIQUE INDEX index_forked_project_links_on_forked_to_project_id ON forked_project_links USING btree (forked_to_project_id); + +CREATE INDEX index_geo_event_log_on_cache_invalidation_event_id ON geo_event_log USING btree (cache_invalidation_event_id) WHERE (cache_invalidation_event_id IS NOT NULL); + +CREATE INDEX index_geo_event_log_on_container_repository_updated_event_id ON geo_event_log USING btree (container_repository_updated_event_id); + +CREATE INDEX index_geo_event_log_on_hashed_storage_attachments_event_id ON geo_event_log USING btree (hashed_storage_attachments_event_id) WHERE (hashed_storage_attachments_event_id IS NOT NULL); + +CREATE INDEX index_geo_event_log_on_hashed_storage_migrated_event_id ON geo_event_log USING btree (hashed_storage_migrated_event_id) WHERE (hashed_storage_migrated_event_id IS NOT NULL); + +CREATE INDEX index_geo_event_log_on_job_artifact_deleted_event_id ON geo_event_log USING btree (job_artifact_deleted_event_id) WHERE (job_artifact_deleted_event_id IS NOT NULL); + +CREATE INDEX index_geo_event_log_on_lfs_object_deleted_event_id ON geo_event_log USING btree (lfs_object_deleted_event_id) WHERE (lfs_object_deleted_event_id IS NOT NULL); + +CREATE INDEX index_geo_event_log_on_repositories_changed_event_id ON geo_event_log USING btree (repositories_changed_event_id) WHERE (repositories_changed_event_id IS NOT NULL); + +CREATE INDEX index_geo_event_log_on_repository_created_event_id ON geo_event_log USING btree (repository_created_event_id) WHERE (repository_created_event_id IS NOT NULL); + +CREATE INDEX index_geo_event_log_on_repository_deleted_event_id ON geo_event_log USING btree (repository_deleted_event_id) WHERE (repository_deleted_event_id IS NOT NULL); + +CREATE INDEX index_geo_event_log_on_repository_renamed_event_id ON geo_event_log USING btree (repository_renamed_event_id) WHERE (repository_renamed_event_id IS NOT NULL); + +CREATE INDEX index_geo_event_log_on_repository_updated_event_id ON geo_event_log USING btree (repository_updated_event_id) WHERE (repository_updated_event_id IS NOT NULL); + +CREATE INDEX index_geo_event_log_on_reset_checksum_event_id ON geo_event_log USING btree (reset_checksum_event_id) WHERE (reset_checksum_event_id IS NOT NULL); + +CREATE INDEX index_geo_event_log_on_upload_deleted_event_id ON geo_event_log USING btree (upload_deleted_event_id) WHERE (upload_deleted_event_id IS NOT NULL); + +CREATE INDEX index_geo_hashed_storage_attachments_events_on_project_id ON geo_hashed_storage_attachments_events USING btree (project_id); + +CREATE INDEX index_geo_hashed_storage_migrated_events_on_project_id ON geo_hashed_storage_migrated_events USING btree (project_id); + +CREATE INDEX index_geo_job_artifact_deleted_events_on_job_artifact_id ON geo_job_artifact_deleted_events USING btree (job_artifact_id); + +CREATE INDEX index_geo_lfs_object_deleted_events_on_lfs_object_id ON geo_lfs_object_deleted_events USING btree (lfs_object_id); + +CREATE INDEX index_geo_node_namespace_links_on_geo_node_id ON geo_node_namespace_links USING btree (geo_node_id); + +CREATE UNIQUE INDEX index_geo_node_namespace_links_on_geo_node_id_and_namespace_id ON geo_node_namespace_links USING btree (geo_node_id, namespace_id); + +CREATE INDEX index_geo_node_namespace_links_on_namespace_id ON geo_node_namespace_links USING btree (namespace_id); + +CREATE UNIQUE INDEX index_geo_node_statuses_on_geo_node_id ON geo_node_statuses USING btree (geo_node_id); + +CREATE INDEX index_geo_nodes_on_access_key ON geo_nodes USING btree (access_key); + +CREATE UNIQUE INDEX index_geo_nodes_on_name ON geo_nodes USING btree (name); + +CREATE INDEX index_geo_nodes_on_primary ON geo_nodes USING btree ("primary"); + +CREATE INDEX index_geo_repositories_changed_events_on_geo_node_id ON geo_repositories_changed_events USING btree (geo_node_id); + +CREATE INDEX index_geo_repository_created_events_on_project_id ON geo_repository_created_events USING btree (project_id); + +CREATE INDEX index_geo_repository_deleted_events_on_project_id ON geo_repository_deleted_events USING btree (project_id); + +CREATE INDEX index_geo_repository_renamed_events_on_project_id ON geo_repository_renamed_events USING btree (project_id); + +CREATE INDEX index_geo_repository_updated_events_on_project_id ON geo_repository_updated_events USING btree (project_id); + +CREATE INDEX index_geo_repository_updated_events_on_source ON geo_repository_updated_events USING btree (source); + +CREATE INDEX index_geo_reset_checksum_events_on_project_id ON geo_reset_checksum_events USING btree (project_id); + +CREATE INDEX index_geo_upload_deleted_events_on_upload_id ON geo_upload_deleted_events USING btree (upload_id); + +CREATE INDEX index_gitlab_subscription_histories_on_gitlab_subscription_id ON gitlab_subscription_histories USING btree (gitlab_subscription_id); + +CREATE INDEX index_gitlab_subscriptions_on_hosted_plan_id ON gitlab_subscriptions USING btree (hosted_plan_id); + +CREATE UNIQUE INDEX index_gitlab_subscriptions_on_namespace_id ON gitlab_subscriptions USING btree (namespace_id); + +CREATE UNIQUE INDEX index_gpg_key_subkeys_on_fingerprint ON gpg_key_subkeys USING btree (fingerprint); + +CREATE INDEX index_gpg_key_subkeys_on_gpg_key_id ON gpg_key_subkeys USING btree (gpg_key_id); + +CREATE UNIQUE INDEX index_gpg_key_subkeys_on_keyid ON gpg_key_subkeys USING btree (keyid); + +CREATE UNIQUE INDEX index_gpg_keys_on_fingerprint ON gpg_keys USING btree (fingerprint); + +CREATE UNIQUE INDEX index_gpg_keys_on_primary_keyid ON gpg_keys USING btree (primary_keyid); + +CREATE INDEX index_gpg_keys_on_user_id ON gpg_keys USING btree (user_id); + +CREATE UNIQUE INDEX index_gpg_signatures_on_commit_sha ON gpg_signatures USING btree (commit_sha); + +CREATE INDEX index_gpg_signatures_on_gpg_key_id ON gpg_signatures USING btree (gpg_key_id); + +CREATE INDEX index_gpg_signatures_on_gpg_key_primary_keyid ON gpg_signatures USING btree (gpg_key_primary_keyid); + +CREATE INDEX index_gpg_signatures_on_gpg_key_subkey_id ON gpg_signatures USING btree (gpg_key_subkey_id); + +CREATE INDEX index_gpg_signatures_on_project_id ON gpg_signatures USING btree (project_id); + +CREATE INDEX index_grafana_integrations_on_enabled ON grafana_integrations USING btree (enabled) WHERE (enabled IS TRUE); + +CREATE INDEX index_grafana_integrations_on_project_id ON grafana_integrations USING btree (project_id); + +CREATE UNIQUE INDEX index_group_custom_attributes_on_group_id_and_key ON group_custom_attributes USING btree (group_id, key); + +CREATE INDEX index_group_custom_attributes_on_key_and_value ON group_custom_attributes USING btree (key, value); + +CREATE INDEX index_group_deletion_schedules_on_marked_for_deletion_on ON group_deletion_schedules USING btree (marked_for_deletion_on); + +CREATE INDEX index_group_deletion_schedules_on_user_id ON group_deletion_schedules USING btree (user_id); + +CREATE UNIQUE INDEX index_group_group_links_on_shared_group_and_shared_with_group ON group_group_links USING btree (shared_group_id, shared_with_group_id); + +CREATE INDEX index_group_group_links_on_shared_with_group_id ON group_group_links USING btree (shared_with_group_id); + +CREATE INDEX index_identities_on_saml_provider_id ON identities USING btree (saml_provider_id) WHERE (saml_provider_id IS NOT NULL); + +CREATE INDEX index_identities_on_user_id ON identities USING btree (user_id); + +CREATE UNIQUE INDEX index_import_export_uploads_on_group_id ON import_export_uploads USING btree (group_id) WHERE (group_id IS NOT NULL); + +CREATE INDEX index_import_export_uploads_on_project_id ON import_export_uploads USING btree (project_id); + +CREATE INDEX index_import_export_uploads_on_updated_at ON import_export_uploads USING btree (updated_at); + +CREATE INDEX index_import_failures_on_correlation_id_value ON import_failures USING btree (correlation_id_value); + +CREATE INDEX index_import_failures_on_project_id ON import_failures USING btree (project_id); + +CREATE UNIQUE INDEX index_index_statuses_on_project_id ON index_statuses USING btree (project_id); + +CREATE INDEX index_insights_on_namespace_id ON insights USING btree (namespace_id); + +CREATE INDEX index_insights_on_project_id ON insights USING btree (project_id); + +CREATE INDEX index_internal_ids_on_namespace_id ON internal_ids USING btree (namespace_id); + +CREATE INDEX index_internal_ids_on_project_id ON internal_ids USING btree (project_id); + +CREATE UNIQUE INDEX index_internal_ids_on_usage_and_namespace_id ON internal_ids USING btree (usage, namespace_id) WHERE (namespace_id IS NOT NULL); + +CREATE UNIQUE INDEX index_internal_ids_on_usage_and_project_id ON internal_ids USING btree (usage, project_id) WHERE (project_id IS NOT NULL); + +CREATE INDEX index_ip_restrictions_on_group_id ON ip_restrictions USING btree (group_id); + +CREATE UNIQUE INDEX index_issue_assignees_on_issue_id_and_user_id ON issue_assignees USING btree (issue_id, user_id); + +CREATE INDEX index_issue_assignees_on_user_id ON issue_assignees USING btree (user_id); + +CREATE INDEX index_issue_links_on_source_id ON issue_links USING btree (source_id); + +CREATE UNIQUE INDEX index_issue_links_on_source_id_and_target_id ON issue_links USING btree (source_id, target_id); + +CREATE INDEX index_issue_links_on_target_id ON issue_links USING btree (target_id); + +CREATE INDEX index_issue_metrics ON issue_metrics USING btree (issue_id); + +CREATE INDEX index_issue_metrics_on_issue_id_and_timestamps ON issue_metrics USING btree (issue_id, first_mentioned_in_commit_at, first_associated_with_milestone_at, first_added_to_board_at); + +CREATE UNIQUE INDEX index_issue_milestones_on_issue_id ON issue_milestones USING btree (issue_id); + +CREATE UNIQUE INDEX index_issue_milestones_on_issue_id_and_milestone_id ON issue_milestones USING btree (issue_id, milestone_id); + +CREATE INDEX index_issue_milestones_on_milestone_id ON issue_milestones USING btree (milestone_id); + +CREATE INDEX index_issue_tracker_data_on_service_id ON issue_tracker_data USING btree (service_id); + +CREATE UNIQUE INDEX index_issue_user_mentions_on_note_id ON issue_user_mentions USING btree (note_id) WHERE (note_id IS NOT NULL); + +CREATE INDEX index_issues_on_author_id ON issues USING btree (author_id); + +CREATE INDEX index_issues_on_closed_by_id ON issues USING btree (closed_by_id); + +CREATE INDEX index_issues_on_confidential ON issues USING btree (confidential); + +CREATE INDEX index_issues_on_description_trigram ON issues USING gin (description gin_trgm_ops); + +CREATE INDEX index_issues_on_duplicated_to_id ON issues USING btree (duplicated_to_id) WHERE (duplicated_to_id IS NOT NULL); + +CREATE INDEX index_issues_on_milestone_id ON issues USING btree (milestone_id); + +CREATE INDEX index_issues_on_moved_to_id ON issues USING btree (moved_to_id) WHERE (moved_to_id IS NOT NULL); + +CREATE INDEX index_issues_on_project_id_and_created_at_and_id_and_state ON issues USING btree (project_id, created_at, id, state); + +CREATE UNIQUE INDEX index_issues_on_project_id_and_iid ON issues USING btree (project_id, iid); + +CREATE INDEX index_issues_on_project_id_and_rel_position_and_state_and_id ON issues USING btree (project_id, relative_position, state, id DESC); + +CREATE INDEX index_issues_on_project_id_and_updated_at_and_id_and_state ON issues USING btree (project_id, updated_at, id, state); + +CREATE INDEX index_issues_on_promoted_to_epic_id ON issues USING btree (promoted_to_epic_id) WHERE (promoted_to_epic_id IS NOT NULL); + +CREATE INDEX index_issues_on_relative_position ON issues USING btree (relative_position); + +CREATE INDEX index_issues_on_state ON issues USING btree (state); + +CREATE INDEX index_issues_on_title_trigram ON issues USING gin (title gin_trgm_ops); + +CREATE INDEX index_issues_on_updated_at ON issues USING btree (updated_at); + +CREATE INDEX index_issues_on_updated_by_id ON issues USING btree (updated_by_id) WHERE (updated_by_id IS NOT NULL); + +CREATE UNIQUE INDEX index_jira_connect_installations_on_client_key ON jira_connect_installations USING btree (client_key); + +CREATE INDEX index_jira_connect_subscriptions_on_namespace_id ON jira_connect_subscriptions USING btree (namespace_id); + +CREATE INDEX index_jira_tracker_data_on_service_id ON jira_tracker_data USING btree (service_id); + +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); + +CREATE INDEX index_keys_on_last_used_at ON keys USING btree (last_used_at DESC NULLS LAST); + +CREATE INDEX index_keys_on_user_id ON keys USING btree (user_id); + +CREATE UNIQUE INDEX index_kubernetes_namespaces_on_cluster_project_environment_id ON clusters_kubernetes_namespaces USING btree (cluster_id, project_id, environment_id); + +CREATE INDEX index_label_links_on_label_id ON label_links USING btree (label_id); + +CREATE INDEX index_label_links_on_target_id_and_target_type ON label_links USING btree (target_id, target_type); + +CREATE INDEX index_label_priorities_on_label_id ON label_priorities USING btree (label_id); + +CREATE INDEX index_label_priorities_on_priority ON label_priorities USING btree (priority); + +CREATE UNIQUE INDEX index_label_priorities_on_project_id_and_label_id ON label_priorities USING btree (project_id, label_id); + +CREATE UNIQUE INDEX index_labels_on_group_id_and_project_id_and_title ON labels USING btree (group_id, project_id, title); + +CREATE INDEX index_labels_on_group_id_and_title ON labels USING btree (group_id, title) WHERE (project_id = NULL::integer); + +CREATE INDEX index_labels_on_project_id ON labels USING btree (project_id); + +CREATE INDEX index_labels_on_project_id_and_title ON labels USING btree (project_id, title) WHERE (group_id = NULL::integer); + +CREATE INDEX index_labels_on_template ON labels USING btree (template) WHERE template; + +CREATE INDEX index_labels_on_title ON labels USING btree (title); + +CREATE INDEX index_labels_on_type_and_project_id ON labels USING btree (type, project_id); + +CREATE UNIQUE INDEX index_lfs_file_locks_on_project_id_and_path ON lfs_file_locks USING btree (project_id, path); + +CREATE INDEX index_lfs_file_locks_on_user_id ON lfs_file_locks USING btree (user_id); + +CREATE INDEX index_lfs_objects_on_file_store ON lfs_objects USING btree (file_store); + +CREATE UNIQUE INDEX index_lfs_objects_on_oid ON lfs_objects USING btree (oid); + +CREATE INDEX index_lfs_objects_projects_on_lfs_object_id ON lfs_objects_projects USING btree (lfs_object_id); + +CREATE INDEX index_lfs_objects_projects_on_project_id ON lfs_objects_projects USING btree (project_id); + +CREATE INDEX index_list_user_preferences_on_list_id ON list_user_preferences USING btree (list_id); + +CREATE INDEX index_list_user_preferences_on_user_id ON list_user_preferences USING btree (user_id); + +CREATE UNIQUE INDEX index_list_user_preferences_on_user_id_and_list_id ON list_user_preferences USING btree (user_id, list_id); + +CREATE UNIQUE INDEX index_lists_on_board_id_and_label_id ON lists USING btree (board_id, label_id); + +CREATE INDEX index_lists_on_label_id ON lists USING btree (label_id); + +CREATE INDEX index_lists_on_list_type ON lists USING btree (list_type); + +CREATE INDEX index_lists_on_milestone_id ON lists USING btree (milestone_id); + +CREATE INDEX index_lists_on_user_id ON lists USING btree (user_id); + +CREATE INDEX index_members_on_access_level ON members USING btree (access_level); + +CREATE INDEX index_members_on_expires_at ON members USING btree (expires_at); + +CREATE INDEX index_members_on_invite_email ON members USING btree (invite_email); + +CREATE UNIQUE INDEX index_members_on_invite_token ON members USING btree (invite_token); + +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_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); + +CREATE INDEX index_merge_request_assignees_on_user_id ON merge_request_assignees USING btree (user_id); + +CREATE INDEX index_merge_request_blocks_on_blocked_merge_request_id ON merge_request_blocks USING btree (blocked_merge_request_id); + +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_commits_on_mr_diff_id_and_order ON merge_request_diff_commits USING btree (merge_request_diff_id, relative_order); + +CREATE INDEX index_merge_request_diff_commits_on_sha ON merge_request_diff_commits USING btree (sha); + +CREATE UNIQUE INDEX index_merge_request_diff_files_on_mr_diff_id_and_order ON merge_request_diff_files USING btree (merge_request_diff_id, relative_order); + +CREATE INDEX index_merge_request_diffs_on_merge_request_id_and_id ON merge_request_diffs USING btree (merge_request_id, id); + +CREATE INDEX index_merge_request_diffs_on_merge_request_id_and_id_partial ON merge_request_diffs USING btree (merge_request_id, id) WHERE ((NOT stored_externally) OR (stored_externally IS NULL)); + +CREATE INDEX index_merge_request_metrics ON merge_request_metrics USING btree (merge_request_id); + +CREATE INDEX index_merge_request_metrics_on_first_deployed_to_production_at ON merge_request_metrics USING btree (first_deployed_to_production_at); + +CREATE INDEX index_merge_request_metrics_on_latest_closed_at ON merge_request_metrics USING btree (latest_closed_at) WHERE (latest_closed_at IS NOT NULL); + +CREATE INDEX index_merge_request_metrics_on_latest_closed_by_id ON merge_request_metrics USING btree (latest_closed_by_id); + +CREATE INDEX index_merge_request_metrics_on_merge_request_id_and_merged_at ON merge_request_metrics USING btree (merge_request_id, merged_at) WHERE (merged_at IS NOT NULL); + +CREATE INDEX index_merge_request_metrics_on_merged_at ON merge_request_metrics USING btree (merged_at); + +CREATE INDEX index_merge_request_metrics_on_merged_by_id ON merge_request_metrics USING btree (merged_by_id); + +CREATE INDEX index_merge_request_metrics_on_pipeline_id ON merge_request_metrics USING btree (pipeline_id); + +CREATE UNIQUE INDEX index_merge_request_milestones_on_merge_request_id ON merge_request_milestones USING btree (merge_request_id); + +CREATE INDEX index_merge_request_milestones_on_milestone_id ON merge_request_milestones USING btree (milestone_id); + +CREATE UNIQUE INDEX index_merge_request_user_mentions_on_note_id ON merge_request_user_mentions USING btree (note_id) WHERE (note_id IS NOT NULL); + +CREATE INDEX index_merge_requests_closing_issues_on_issue_id ON merge_requests_closing_issues USING btree (issue_id); + +CREATE INDEX index_merge_requests_closing_issues_on_merge_request_id ON merge_requests_closing_issues USING btree (merge_request_id); + +CREATE INDEX index_merge_requests_on_assignee_id ON merge_requests USING btree (assignee_id); + +CREATE INDEX index_merge_requests_on_author_id ON merge_requests USING btree (author_id); + +CREATE INDEX index_merge_requests_on_created_at ON merge_requests USING btree (created_at); + +CREATE INDEX index_merge_requests_on_description_trigram ON merge_requests USING gin (description gin_trgm_ops); + +CREATE INDEX index_merge_requests_on_head_pipeline_id ON merge_requests USING btree (head_pipeline_id); + +CREATE INDEX index_merge_requests_on_id_and_merge_jid ON merge_requests USING btree (id, merge_jid) WHERE ((merge_jid IS NOT NULL) AND ((state)::text = 'locked'::text)); + +CREATE INDEX index_merge_requests_on_latest_merge_request_diff_id ON merge_requests USING btree (latest_merge_request_diff_id); + +CREATE INDEX index_merge_requests_on_merge_user_id ON merge_requests USING btree (merge_user_id) WHERE (merge_user_id IS NOT NULL); + +CREATE INDEX index_merge_requests_on_milestone_id ON merge_requests USING btree (milestone_id); + +CREATE INDEX index_merge_requests_on_source_branch ON merge_requests USING btree (source_branch); + +CREATE INDEX index_merge_requests_on_source_project_and_branch_state_opened ON merge_requests USING btree (source_project_id, source_branch) WHERE ((state)::text = 'opened'::text); + +CREATE INDEX index_merge_requests_on_source_project_id_and_source_branch ON merge_requests USING btree (source_project_id, source_branch); + +CREATE INDEX index_merge_requests_on_state_and_merge_status ON merge_requests USING btree (state, merge_status) WHERE (((state)::text = 'opened'::text) AND ((merge_status)::text = 'can_be_merged'::text)); + +CREATE INDEX index_merge_requests_on_target_branch ON merge_requests USING btree (target_branch); + +CREATE UNIQUE INDEX index_merge_requests_on_target_project_id_and_iid ON merge_requests USING btree (target_project_id, iid); + +CREATE INDEX index_merge_requests_on_target_project_id_and_iid_opened ON merge_requests USING btree (target_project_id, iid) WHERE ((state)::text = 'opened'::text); + +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)); + +CREATE INDEX index_merge_requests_on_title ON merge_requests USING btree (title); + +CREATE INDEX index_merge_requests_on_title_trigram ON merge_requests USING gin (title gin_trgm_ops); + +CREATE INDEX index_merge_requests_on_tp_id_and_merge_commit_sha_and_id ON merge_requests USING btree (target_project_id, merge_commit_sha, id); + +CREATE INDEX index_merge_requests_on_updated_by_id ON merge_requests USING btree (updated_by_id) WHERE (updated_by_id IS NOT NULL); + +CREATE INDEX index_merge_requests_target_project_id_created_at ON merge_requests USING btree (target_project_id, created_at); + +CREATE UNIQUE INDEX index_merge_trains_on_merge_request_id ON merge_trains USING btree (merge_request_id); + +CREATE INDEX index_merge_trains_on_pipeline_id ON merge_trains USING btree (pipeline_id); + +CREATE INDEX index_merge_trains_on_user_id ON merge_trains USING btree (user_id); + +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); + +CREATE INDEX index_milestones_on_due_date ON milestones USING btree (due_date); + +CREATE INDEX index_milestones_on_group_id ON milestones USING btree (group_id); + +CREATE UNIQUE INDEX index_milestones_on_project_id_and_iid ON milestones USING btree (project_id, iid); + +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 UNIQUE INDEX index_miletone_releases_on_milestone_and_release ON milestone_releases USING btree (milestone_id, release_id); + +CREATE INDEX index_mirror_data_on_next_execution_and_retry_count ON project_mirror_data USING btree (next_execution_timestamp, retry_count); + +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); + +CREATE UNIQUE INDEX index_mr_context_commits_on_merge_request_id_and_sha ON merge_request_context_commits USING btree (merge_request_id, sha); + +CREATE UNIQUE INDEX index_mrs_milestones_on_mr_id_and_milestone_id ON merge_request_milestones USING btree (merge_request_id, milestone_id); + +CREATE UNIQUE INDEX index_namespace_aggregation_schedules_on_namespace_id ON namespace_aggregation_schedules USING btree (namespace_id); + +CREATE UNIQUE INDEX index_namespace_root_storage_statistics_on_namespace_id ON namespace_root_storage_statistics USING btree (namespace_id); + +CREATE UNIQUE INDEX index_namespace_statistics_on_namespace_id ON namespace_statistics USING btree (namespace_id); + +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); + +CREATE INDEX index_namespaces_on_file_template_project_id ON namespaces USING btree (file_template_project_id); + +CREATE INDEX index_namespaces_on_ldap_sync_last_successful_update_at ON namespaces USING btree (ldap_sync_last_successful_update_at); + +CREATE INDEX index_namespaces_on_ldap_sync_last_update_at ON namespaces USING btree (ldap_sync_last_update_at); + +CREATE UNIQUE INDEX index_namespaces_on_name_and_parent_id ON namespaces USING btree (name, parent_id); + +CREATE INDEX index_namespaces_on_name_trigram ON namespaces USING gin (name gin_trgm_ops); + +CREATE INDEX index_namespaces_on_owner_id ON namespaces USING btree (owner_id); + +CREATE UNIQUE INDEX index_namespaces_on_parent_id_and_id ON namespaces USING btree (parent_id, id); + +CREATE INDEX index_namespaces_on_path ON namespaces USING btree (path); + +CREATE INDEX index_namespaces_on_path_trigram ON namespaces USING gin (path gin_trgm_ops); + +CREATE INDEX index_namespaces_on_plan_id ON namespaces USING btree (plan_id); + +CREATE INDEX index_namespaces_on_require_two_factor_authentication ON namespaces USING btree (require_two_factor_authentication); + +CREATE UNIQUE INDEX index_namespaces_on_runners_token ON namespaces USING btree (runners_token); + +CREATE UNIQUE INDEX index_namespaces_on_runners_token_encrypted ON namespaces USING btree (runners_token_encrypted); + +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_trial_ends_on ON namespaces USING btree (trial_ends_on) WHERE (trial_ends_on IS NOT NULL); + +CREATE INDEX index_namespaces_on_type_partial ON namespaces USING btree (type) WHERE (type IS NOT NULL); + +CREATE UNIQUE INDEX index_note_diff_files_on_diff_note_id ON note_diff_files USING btree (diff_note_id); + +CREATE INDEX index_notes_on_author_id ON notes USING btree (author_id); + +CREATE INDEX index_notes_on_commit_id ON notes USING btree (commit_id); + +CREATE INDEX index_notes_on_created_at ON notes USING btree (created_at); + +CREATE INDEX index_notes_on_discussion_id ON notes USING btree (discussion_id); + +CREATE INDEX index_notes_on_line_code ON notes USING btree (line_code); + +CREATE INDEX index_notes_on_note_trigram ON notes USING gin (note gin_trgm_ops); + +CREATE INDEX index_notes_on_noteable_id_and_noteable_type ON notes USING btree (noteable_id, noteable_type); + +CREATE INDEX index_notes_on_project_id_and_id_and_system_false ON notes USING btree (project_id, id) WHERE (NOT system); + +CREATE INDEX index_notes_on_project_id_and_noteable_type ON notes USING btree (project_id, noteable_type); + +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 UNIQUE INDEX index_notifications_on_user_id_and_source_id_and_source_type ON notification_settings USING btree (user_id, source_id, source_type); + +CREATE UNIQUE INDEX index_oauth_access_grants_on_token ON oauth_access_grants USING btree (token); + +CREATE INDEX index_oauth_access_tokens_on_application_id ON oauth_access_tokens USING btree (application_id); + +CREATE UNIQUE INDEX index_oauth_access_tokens_on_refresh_token ON oauth_access_tokens USING btree (refresh_token); + +CREATE INDEX index_oauth_access_tokens_on_resource_owner_id ON oauth_access_tokens USING btree (resource_owner_id); + +CREATE UNIQUE INDEX index_oauth_access_tokens_on_token ON oauth_access_tokens USING btree (token); + +CREATE INDEX index_oauth_applications_on_owner_id_and_owner_type ON oauth_applications USING btree (owner_id, owner_type); + +CREATE UNIQUE INDEX index_oauth_applications_on_uid ON oauth_applications USING btree (uid); + +CREATE INDEX index_oauth_openid_requests_on_access_grant_id ON oauth_openid_requests USING btree (access_grant_id); + +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_identities_lower_extern_uid_and_provider ON identities USING btree (lower((extern_uid)::text), provider); + +CREATE INDEX index_on_users_name_lower ON users USING btree (lower((name)::text)); + +CREATE UNIQUE INDEX index_operations_feature_flags_on_project_id_and_name ON operations_feature_flags USING btree (project_id, name); + +CREATE UNIQUE INDEX index_packages_build_infos_on_package_id ON packages_build_infos USING btree (package_id); + +CREATE INDEX index_packages_build_infos_on_pipeline_id ON packages_build_infos USING btree (pipeline_id); + +CREATE UNIQUE INDEX index_packages_conan_file_metadata_on_package_file_id ON packages_conan_file_metadata USING btree (package_file_id); + +CREATE UNIQUE INDEX index_packages_conan_metadata_on_package_id ON packages_conan_metadata USING btree (package_id); + +CREATE UNIQUE INDEX index_packages_dependencies_on_name_and_version_pattern ON packages_dependencies USING btree (name, version_pattern); + +CREATE INDEX index_packages_dependency_links_on_dependency_id ON packages_dependency_links USING btree (dependency_id); + +CREATE INDEX index_packages_maven_metadata_on_package_id_and_path ON packages_maven_metadata USING btree (package_id, path); + +CREATE INDEX index_packages_package_files_on_package_id_and_file_name ON packages_package_files USING btree (package_id, file_name); + +CREATE INDEX index_packages_packages_on_name_trigram ON packages_packages USING gin (name gin_trgm_ops); + +CREATE INDEX index_packages_packages_on_project_id ON packages_packages USING btree (project_id); + +CREATE INDEX index_packages_tags_on_package_id ON packages_tags USING btree (package_id); + +CREATE INDEX index_pages_domain_acme_orders_on_challenge_token ON pages_domain_acme_orders USING btree (challenge_token); + +CREATE INDEX index_pages_domain_acme_orders_on_pages_domain_id ON pages_domain_acme_orders USING btree (pages_domain_id); + +CREATE INDEX index_pages_domains_need_auto_ssl_renewal ON pages_domains USING btree (certificate_source, certificate_valid_not_after) WHERE (auto_ssl_enabled = true); + +CREATE UNIQUE INDEX index_pages_domains_on_domain ON pages_domains USING btree (domain); + +CREATE INDEX index_pages_domains_on_domain_type ON pages_domains USING btree (domain_type); + +CREATE INDEX index_pages_domains_on_project_id ON pages_domains USING btree (project_id); + +CREATE INDEX index_pages_domains_on_project_id_and_enabled_until ON pages_domains USING btree (project_id, enabled_until); + +CREATE INDEX index_pages_domains_on_remove_at ON pages_domains USING btree (remove_at); + +CREATE INDEX index_pages_domains_on_verified_at ON pages_domains USING btree (verified_at); + +CREATE INDEX index_pages_domains_on_verified_at_and_enabled_until ON pages_domains USING btree (verified_at, enabled_until); + +CREATE INDEX index_pages_domains_on_wildcard ON pages_domains USING btree (wildcard); + +CREATE INDEX index_pat_on_user_id_and_expires_at ON personal_access_tokens USING btree (user_id, expires_at); + +CREATE INDEX index_path_locks_on_path ON path_locks USING btree (path); + +CREATE INDEX index_path_locks_on_project_id ON path_locks USING btree (project_id); + +CREATE INDEX index_path_locks_on_user_id ON path_locks USING btree (user_id); + +CREATE UNIQUE INDEX index_personal_access_tokens_on_token_digest ON personal_access_tokens USING btree (token_digest); + +CREATE INDEX index_personal_access_tokens_on_user_id ON personal_access_tokens USING btree (user_id); + +CREATE UNIQUE INDEX index_plan_limits_on_plan_id ON plan_limits USING btree (plan_id); + +CREATE INDEX index_plans_on_name ON plans USING btree (name); + +CREATE UNIQUE INDEX index_pool_repositories_on_disk_path ON pool_repositories USING btree (disk_path); + +CREATE INDEX index_pool_repositories_on_shard_id ON pool_repositories USING btree (shard_id); + +CREATE UNIQUE INDEX index_pool_repositories_on_source_project_id_and_shard_id ON pool_repositories USING btree (source_project_id, shard_id); + +CREATE UNIQUE INDEX index_programming_languages_on_name ON programming_languages USING btree (name); + +CREATE UNIQUE INDEX index_project_aliases_on_name ON project_aliases USING btree (name); + +CREATE INDEX index_project_aliases_on_project_id ON project_aliases USING btree (project_id); + +CREATE INDEX index_project_authorizations_on_project_id ON project_authorizations USING btree (project_id); + +CREATE UNIQUE INDEX index_project_authorizations_on_user_id_project_id_access_level ON project_authorizations USING btree (user_id, project_id, access_level); + +CREATE UNIQUE INDEX index_project_auto_devops_on_project_id ON project_auto_devops USING btree (project_id); + +CREATE UNIQUE INDEX index_project_ci_cd_settings_on_project_id ON project_ci_cd_settings USING btree (project_id); + +CREATE INDEX index_project_custom_attributes_on_key_and_value ON project_custom_attributes USING btree (key, value); + +CREATE UNIQUE INDEX index_project_custom_attributes_on_project_id_and_key ON project_custom_attributes USING btree (project_id, key); + +CREATE UNIQUE INDEX index_project_daily_statistics_on_project_id_and_date ON project_daily_statistics USING btree (project_id, date DESC); + +CREATE INDEX index_project_deploy_tokens_on_deploy_token_id ON project_deploy_tokens USING btree (deploy_token_id); + +CREATE UNIQUE INDEX index_project_deploy_tokens_on_project_id_and_deploy_token_id ON project_deploy_tokens USING btree (project_id, deploy_token_id); + +CREATE INDEX index_project_feature_usages_on_project_id ON project_feature_usages USING btree (project_id); + +CREATE UNIQUE INDEX index_project_features_on_project_id ON project_features USING btree (project_id); + +CREATE INDEX index_project_group_links_on_group_id ON project_group_links USING btree (group_id); + +CREATE INDEX index_project_group_links_on_project_id ON project_group_links USING btree (project_id); + +CREATE INDEX index_project_import_data_on_project_id ON project_import_data USING btree (project_id); + +CREATE INDEX index_project_mirror_data_on_jid ON project_mirror_data USING btree (jid); + +CREATE INDEX index_project_mirror_data_on_last_successful_update_at ON project_mirror_data USING btree (last_successful_update_at); + +CREATE INDEX index_project_mirror_data_on_last_update_at_and_retry_count ON project_mirror_data USING btree (last_update_at, retry_count); + +CREATE UNIQUE INDEX index_project_mirror_data_on_project_id ON project_mirror_data USING btree (project_id); + +CREATE INDEX index_project_mirror_data_on_status ON project_mirror_data USING btree (status); + +CREATE UNIQUE INDEX index_project_pages_metadata_on_project_id ON project_pages_metadata USING btree (project_id); + +CREATE INDEX index_project_pages_metadata_on_project_id_and_deployed_is_true ON project_pages_metadata USING btree (project_id) WHERE (deployed = true); + +CREATE UNIQUE INDEX index_project_repositories_on_disk_path ON project_repositories USING btree (disk_path); + +CREATE UNIQUE INDEX index_project_repositories_on_project_id ON project_repositories USING btree (project_id); + +CREATE INDEX index_project_repositories_on_shard_id ON project_repositories USING btree (shard_id); + +CREATE UNIQUE INDEX index_project_repository_states_on_project_id ON project_repository_states USING btree (project_id); + +CREATE INDEX index_project_statistics_on_namespace_id ON project_statistics USING btree (namespace_id); + +CREATE UNIQUE INDEX index_project_statistics_on_project_id ON project_statistics USING btree (project_id); + +CREATE UNIQUE INDEX index_project_tracing_settings_on_project_id ON project_tracing_settings USING btree (project_id); + +CREATE INDEX index_projects_on_created_at_and_id ON projects USING btree (created_at, id); + +CREATE INDEX index_projects_on_creator_id ON projects USING btree (creator_id); + +CREATE INDEX index_projects_on_description_trigram ON projects USING gin (description gin_trgm_ops); + +CREATE UNIQUE INDEX index_projects_on_id_partial_for_visibility ON projects USING btree (id) WHERE (visibility_level = ANY (ARRAY[10, 20])); + +CREATE INDEX index_projects_on_last_activity_at ON projects USING btree (last_activity_at); + +CREATE INDEX index_projects_on_last_repository_check_at ON projects USING btree (last_repository_check_at) WHERE (last_repository_check_at IS NOT NULL); + +CREATE INDEX index_projects_on_last_repository_check_failed ON projects USING btree (last_repository_check_failed); + +CREATE INDEX index_projects_on_last_repository_updated_at ON projects USING btree (last_repository_updated_at); + +CREATE INDEX index_projects_on_lower_name ON projects USING btree (lower((name)::text)); + +CREATE INDEX index_projects_on_marked_for_deletion_at ON projects USING btree (marked_for_deletion_at) WHERE (marked_for_deletion_at IS NOT NULL); + +CREATE INDEX index_projects_on_marked_for_deletion_by_user_id ON projects USING btree (marked_for_deletion_by_user_id) WHERE (marked_for_deletion_by_user_id IS NOT NULL); + +CREATE INDEX index_projects_on_mirror_and_mirror_trigger_builds_both_true ON projects USING btree (id) WHERE ((mirror IS TRUE) AND (mirror_trigger_builds IS TRUE)); + +CREATE INDEX index_projects_on_mirror_last_successful_update_at ON projects USING btree (mirror_last_successful_update_at); + +CREATE INDEX index_projects_on_mirror_user_id ON projects USING btree (mirror_user_id); + +CREATE INDEX index_projects_on_name_trigram ON projects USING gin (name gin_trgm_ops); + +CREATE INDEX index_projects_on_namespace_id ON projects USING btree (namespace_id); + +CREATE INDEX index_projects_on_path ON projects USING btree (path); + +CREATE INDEX index_projects_on_path_trigram ON projects USING gin (path gin_trgm_ops); + +CREATE INDEX index_projects_on_pending_delete ON projects USING btree (pending_delete); + +CREATE INDEX index_projects_on_pool_repository_id ON projects USING btree (pool_repository_id) WHERE (pool_repository_id IS NOT NULL); + +CREATE INDEX index_projects_on_repository_storage ON projects USING btree (repository_storage); + +CREATE INDEX index_projects_on_runners_token ON projects USING btree (runners_token); + +CREATE INDEX index_projects_on_runners_token_encrypted ON projects USING btree (runners_token_encrypted); + +CREATE INDEX index_projects_on_star_count ON projects USING btree (star_count); + +CREATE INDEX index_projects_on_visibility_level_and_created_at_and_id ON projects USING btree (visibility_level, created_at, id); + +CREATE UNIQUE INDEX index_prometheus_alert_event_scoped_payload_key ON prometheus_alert_events USING btree (prometheus_alert_id, payload_key); + +CREATE INDEX index_prometheus_alert_events_on_project_id_and_status ON prometheus_alert_events USING btree (project_id, status); + +CREATE UNIQUE INDEX index_prometheus_alerts_metric_environment ON prometheus_alerts USING btree (project_id, prometheus_metric_id, environment_id); + +CREATE INDEX index_prometheus_alerts_on_environment_id ON prometheus_alerts USING btree (environment_id); + +CREATE INDEX index_prometheus_alerts_on_prometheus_metric_id ON prometheus_alerts USING btree (prometheus_metric_id); + +CREATE INDEX index_prometheus_metrics_on_common ON prometheus_metrics USING btree (common); + +CREATE INDEX index_prometheus_metrics_on_group ON prometheus_metrics USING btree ("group"); + +CREATE UNIQUE INDEX index_prometheus_metrics_on_identifier ON prometheus_metrics USING btree (identifier); + +CREATE INDEX index_prometheus_metrics_on_project_id ON prometheus_metrics USING btree (project_id); + +CREATE INDEX index_protected_branch_merge_access ON protected_branch_merge_access_levels USING btree (protected_branch_id); + +CREATE INDEX index_protected_branch_merge_access_levels_on_group_id ON protected_branch_merge_access_levels USING btree (group_id); + +CREATE INDEX index_protected_branch_merge_access_levels_on_user_id ON protected_branch_merge_access_levels USING btree (user_id); + +CREATE INDEX index_protected_branch_push_access ON protected_branch_push_access_levels USING btree (protected_branch_id); + +CREATE INDEX index_protected_branch_push_access_levels_on_group_id ON protected_branch_push_access_levels USING btree (group_id); + +CREATE INDEX index_protected_branch_push_access_levels_on_user_id ON protected_branch_push_access_levels USING btree (user_id); + +CREATE INDEX index_protected_branch_unprotect_access ON protected_branch_unprotect_access_levels USING btree (protected_branch_id); + +CREATE INDEX index_protected_branch_unprotect_access_levels_on_group_id ON protected_branch_unprotect_access_levels USING btree (group_id); + +CREATE INDEX index_protected_branch_unprotect_access_levels_on_user_id ON protected_branch_unprotect_access_levels USING btree (user_id); + +CREATE INDEX index_protected_branches_on_project_id ON protected_branches USING btree (project_id); + +CREATE INDEX index_protected_environment_deploy_access ON protected_environment_deploy_access_levels USING btree (protected_environment_id); + +CREATE INDEX index_protected_environment_deploy_access_levels_on_group_id ON protected_environment_deploy_access_levels USING btree (group_id); + +CREATE INDEX index_protected_environment_deploy_access_levels_on_user_id ON protected_environment_deploy_access_levels USING btree (user_id); + +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); + +CREATE INDEX index_protected_tag_create_access ON protected_tag_create_access_levels USING btree (protected_tag_id); + +CREATE INDEX index_protected_tag_create_access_levels_on_group_id ON protected_tag_create_access_levels USING btree (group_id); + +CREATE INDEX index_protected_tag_create_access_levels_on_user_id ON protected_tag_create_access_levels USING btree (user_id); + +CREATE INDEX index_protected_tags_on_project_id ON protected_tags USING btree (project_id); + +CREATE UNIQUE INDEX index_protected_tags_on_project_id_and_name ON protected_tags USING btree (project_id, name); + +CREATE UNIQUE INDEX index_push_event_payloads_on_event_id ON push_event_payloads USING btree (event_id); + +CREATE INDEX index_push_rules_on_is_sample ON push_rules USING btree (is_sample) WHERE is_sample; + +CREATE INDEX index_push_rules_on_project_id ON push_rules USING btree (project_id); + +CREATE UNIQUE INDEX index_redirect_routes_on_path ON redirect_routes USING btree (path); + +CREATE UNIQUE INDEX index_redirect_routes_on_path_unique_text_pattern_ops ON redirect_routes USING btree (lower((path)::text) varchar_pattern_ops); + +CREATE INDEX index_redirect_routes_on_source_type_and_source_id ON redirect_routes USING btree (source_type, source_id); + +CREATE UNIQUE INDEX index_release_links_on_release_id_and_name ON release_links USING btree (release_id, name); + +CREATE UNIQUE INDEX index_release_links_on_release_id_and_url ON release_links USING btree (release_id, url); + +CREATE INDEX index_releases_on_author_id ON releases USING btree (author_id); + +CREATE INDEX index_releases_on_project_id_and_tag ON releases USING btree (project_id, tag); + +CREATE INDEX index_remote_mirrors_on_last_successful_update_at ON remote_mirrors USING btree (last_successful_update_at); + +CREATE INDEX index_remote_mirrors_on_project_id ON remote_mirrors USING btree (project_id); + +CREATE UNIQUE INDEX index_repository_languages_on_project_and_languages_id ON repository_languages USING btree (project_id, programming_language_id); + +CREATE INDEX index_resource_label_events_on_epic_id ON resource_label_events USING btree (epic_id); + +CREATE INDEX index_resource_label_events_on_issue_id ON resource_label_events USING btree (issue_id); + +CREATE INDEX index_resource_label_events_on_label_id_and_action ON resource_label_events USING btree (label_id, action); + +CREATE INDEX index_resource_label_events_on_merge_request_id ON resource_label_events USING btree (merge_request_id); + +CREATE INDEX index_resource_label_events_on_user_id ON resource_label_events USING btree (user_id); + +CREATE INDEX index_resource_weight_events_on_issue_id_and_weight ON resource_weight_events USING btree (issue_id, weight); + +CREATE INDEX index_resource_weight_events_on_user_id ON resource_weight_events USING btree (user_id); + +CREATE INDEX index_reviews_on_author_id ON reviews USING btree (author_id); + +CREATE INDEX index_reviews_on_merge_request_id ON reviews USING btree (merge_request_id); + +CREATE INDEX index_reviews_on_project_id ON reviews USING btree (project_id); + +CREATE UNIQUE INDEX index_routes_on_path ON routes USING btree (path); + +CREATE INDEX index_routes_on_path_text_pattern_ops ON routes USING btree (path varchar_pattern_ops); + +CREATE UNIQUE INDEX index_routes_on_source_type_and_source_id ON routes USING btree (source_type, source_id); + +CREATE INDEX index_saml_providers_on_group_id ON saml_providers USING btree (group_id); + +CREATE UNIQUE INDEX index_scim_oauth_access_tokens_on_group_id_and_token_encrypted ON scim_oauth_access_tokens USING btree (group_id, token_encrypted); + +CREATE INDEX index_self_managed_prometheus_alert_events_on_environment_id ON self_managed_prometheus_alert_events USING btree (environment_id); + +CREATE UNIQUE INDEX index_sent_notifications_on_reply_key ON sent_notifications USING btree (reply_key); + +CREATE UNIQUE INDEX index_sentry_issues_on_issue_id ON sentry_issues USING btree (issue_id); + +CREATE INDEX index_serverless_domain_cluster_on_creator_id ON serverless_domain_cluster USING btree (creator_id); + +CREATE INDEX index_serverless_domain_cluster_on_pages_domain_id ON serverless_domain_cluster USING btree (pages_domain_id); + +CREATE INDEX index_services_on_project_id ON services USING btree (project_id); + +CREATE INDEX index_services_on_template ON services USING btree (template); + +CREATE INDEX index_services_on_type ON services USING btree (type); + +CREATE UNIQUE INDEX index_shards_on_name ON shards USING btree (name); + +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); + +CREATE UNIQUE INDEX index_smartcard_identities_on_subject_and_issuer ON smartcard_identities USING btree (subject, issuer); + +CREATE INDEX index_smartcard_identities_on_user_id ON smartcard_identities USING btree (user_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); + +CREATE INDEX index_snippets_on_author_id ON snippets USING btree (author_id); + +CREATE INDEX index_snippets_on_content_trigram ON snippets USING gin (content gin_trgm_ops); + +CREATE INDEX index_snippets_on_created_at ON snippets USING btree (created_at); + +CREATE INDEX index_snippets_on_file_name_trigram ON snippets USING gin (file_name gin_trgm_ops); + +CREATE INDEX index_snippets_on_project_id_and_visibility_level ON snippets USING btree (project_id, visibility_level); + +CREATE INDEX index_snippets_on_title_trigram ON snippets USING gin (title gin_trgm_ops); + +CREATE INDEX index_snippets_on_updated_at ON snippets USING btree (updated_at); + +CREATE INDEX index_snippets_on_visibility_level_and_secret ON snippets USING btree (visibility_level, secret); + +CREATE INDEX index_software_license_policies_on_software_license_id ON software_license_policies USING btree (software_license_id); + +CREATE UNIQUE INDEX index_software_license_policies_unique_per_project ON software_license_policies USING btree (project_id, software_license_id); + +CREATE INDEX index_software_licenses_on_spdx_identifier ON software_licenses USING btree (spdx_identifier); + +CREATE UNIQUE INDEX index_software_licenses_on_unique_name ON software_licenses USING btree (name); + +CREATE INDEX index_subscriptions_on_project_id ON subscriptions USING btree (project_id); + +CREATE UNIQUE INDEX index_subscriptions_on_subscribable_and_user_id_and_project_id ON subscriptions USING btree (subscribable_id, subscribable_type, user_id, project_id); + +CREATE INDEX index_suggestions_on_note_id ON suggestions USING btree (note_id); + +CREATE UNIQUE INDEX index_suggestions_on_note_id_and_relative_order ON suggestions USING btree (note_id, relative_order); + +CREATE UNIQUE INDEX index_system_note_metadata_on_description_version_id ON system_note_metadata USING btree (description_version_id) WHERE (description_version_id IS NOT NULL); + +CREATE UNIQUE INDEX index_system_note_metadata_on_note_id ON system_note_metadata USING btree (note_id); + +CREATE INDEX index_taggings_on_tag_id ON taggings USING btree (tag_id); + +CREATE INDEX index_taggings_on_taggable_id_and_taggable_type ON taggings USING btree (taggable_id, taggable_type); + +CREATE INDEX index_taggings_on_taggable_id_and_taggable_type_and_context ON taggings USING btree (taggable_id, taggable_type, context); + +CREATE UNIQUE INDEX index_tags_on_name ON tags USING btree (name); + +CREATE INDEX index_tags_on_name_trigram ON tags USING gin (name gin_trgm_ops); + +CREATE INDEX index_term_agreements_on_term_id ON term_agreements USING btree (term_id); + +CREATE INDEX index_term_agreements_on_user_id ON term_agreements USING btree (user_id); + +CREATE INDEX index_timelogs_on_issue_id ON timelogs USING btree (issue_id); + +CREATE INDEX index_timelogs_on_merge_request_id ON timelogs USING btree (merge_request_id); + +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); + +CREATE INDEX index_todos_on_author_id ON todos USING btree (author_id); + +CREATE INDEX index_todos_on_commit_id ON todos USING btree (commit_id); + +CREATE INDEX index_todos_on_group_id ON todos USING btree (group_id); + +CREATE INDEX index_todos_on_note_id ON todos USING btree (note_id); + +CREATE INDEX index_todos_on_project_id ON todos USING btree (project_id); + +CREATE INDEX index_todos_on_target_type_and_target_id ON todos USING btree (target_type, target_id); + +CREATE INDEX index_todos_on_user_id ON todos USING btree (user_id); + +CREATE INDEX index_todos_on_user_id_and_id_done ON todos USING btree (user_id, id) WHERE ((state)::text = 'done'::text); + +CREATE INDEX index_todos_on_user_id_and_id_pending ON todos USING btree (user_id, id) WHERE ((state)::text = 'pending'::text); + +CREATE UNIQUE INDEX index_trending_projects_on_project_id ON trending_projects USING btree (project_id); + +CREATE INDEX index_u2f_registrations_on_key_handle ON u2f_registrations USING btree (key_handle); + +CREATE INDEX index_u2f_registrations_on_user_id ON u2f_registrations USING btree (user_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); + +CREATE INDEX index_uploads_on_store ON uploads USING btree (store); + +CREATE INDEX index_uploads_on_uploader_and_path ON uploads USING btree (uploader, path); + +CREATE INDEX index_user_agent_details_on_subject_id_and_subject_type ON user_agent_details USING btree (subject_id, subject_type); + +CREATE INDEX index_user_callouts_on_user_id ON user_callouts USING btree (user_id); + +CREATE UNIQUE INDEX index_user_callouts_on_user_id_and_feature_name ON user_callouts USING btree (user_id, feature_name); + +CREATE INDEX index_user_custom_attributes_on_key_and_value ON user_custom_attributes USING btree (key, value); + +CREATE UNIQUE INDEX index_user_custom_attributes_on_user_id_and_key ON user_custom_attributes USING btree (user_id, key); + +CREATE UNIQUE INDEX index_user_interacted_projects_on_project_id_and_user_id ON user_interacted_projects USING btree (project_id, user_id); + +CREATE INDEX index_user_interacted_projects_on_user_id ON user_interacted_projects USING btree (user_id); + +CREATE UNIQUE INDEX index_user_preferences_on_user_id ON user_preferences USING btree (user_id); + +CREATE INDEX index_user_statuses_on_user_id ON user_statuses USING btree (user_id); + +CREATE UNIQUE INDEX index_user_synced_attributes_metadata_on_user_id ON user_synced_attributes_metadata USING btree (user_id); + +CREATE INDEX index_users_on_accepted_term_id ON users USING btree (accepted_term_id); + +CREATE INDEX index_users_on_admin ON users USING btree (admin); + +CREATE INDEX index_users_on_bot_type ON users USING btree (bot_type); + +CREATE UNIQUE INDEX index_users_on_confirmation_token ON users USING btree (confirmation_token); + +CREATE INDEX index_users_on_created_at ON users USING btree (created_at); + +CREATE UNIQUE INDEX index_users_on_email ON users USING btree (email); + +CREATE INDEX index_users_on_email_trigram ON users USING gin (email gin_trgm_ops); + +CREATE INDEX index_users_on_feed_token ON users USING btree (feed_token); + +CREATE INDEX index_users_on_ghost ON users USING btree (ghost); + +CREATE INDEX index_users_on_group_view ON users USING btree (group_view); + +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); + +CREATE INDEX index_users_on_name ON users USING btree (name); + +CREATE INDEX index_users_on_name_trigram ON users USING gin (name gin_trgm_ops); + +CREATE INDEX index_users_on_public_email ON users USING btree (public_email) WHERE ((public_email)::text <> ''::text); + +CREATE UNIQUE INDEX index_users_on_reset_password_token ON users USING btree (reset_password_token); + +CREATE INDEX index_users_on_state ON users USING btree (state); + +CREATE INDEX index_users_on_state_and_internal ON users USING btree (state) WHERE (ghost IS NOT TRUE); + +CREATE INDEX index_users_on_state_and_internal_ee ON users USING btree (state) WHERE ((ghost IS NOT TRUE) AND (bot_type IS NULL)); + +CREATE UNIQUE INDEX index_users_on_static_object_token ON users USING btree (static_object_token); + +CREATE INDEX index_users_on_unconfirmed_email ON users USING btree (unconfirmed_email) WHERE (unconfirmed_email IS NOT NULL); + +CREATE INDEX index_users_on_username ON users USING btree (username); + +CREATE INDEX index_users_on_username_trigram ON users USING gin (username gin_trgm_ops); + +CREATE INDEX index_users_ops_dashboard_projects_on_project_id ON users_ops_dashboard_projects USING btree (project_id); + +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_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); + +CREATE UNIQUE INDEX index_users_star_projects_on_user_id_and_project_id ON users_star_projects USING btree (user_id, project_id); + +CREATE INDEX index_vulnerabilities_on_author_id ON vulnerabilities USING btree (author_id); + +CREATE INDEX index_vulnerabilities_on_closed_by_id ON vulnerabilities USING btree (closed_by_id); + +CREATE INDEX index_vulnerabilities_on_due_date_sourcing_milestone_id ON vulnerabilities USING btree (due_date_sourcing_milestone_id); + +CREATE INDEX index_vulnerabilities_on_epic_id ON vulnerabilities USING btree (epic_id); + +CREATE INDEX index_vulnerabilities_on_last_edited_by_id ON vulnerabilities USING btree (last_edited_by_id); + +CREATE INDEX index_vulnerabilities_on_milestone_id ON vulnerabilities USING btree (milestone_id); + +CREATE INDEX index_vulnerabilities_on_project_id ON vulnerabilities USING btree (project_id); + +CREATE INDEX index_vulnerabilities_on_resolved_by_id ON vulnerabilities USING btree (resolved_by_id); + +CREATE INDEX index_vulnerabilities_on_start_date_sourcing_milestone_id ON vulnerabilities USING btree (start_date_sourcing_milestone_id); + +CREATE INDEX index_vulnerabilities_on_updated_by_id ON vulnerabilities USING btree (updated_by_id); + +CREATE INDEX index_vulnerability_feedback_on_author_id ON vulnerability_feedback USING btree (author_id); + +CREATE INDEX index_vulnerability_feedback_on_comment_author_id ON vulnerability_feedback USING btree (comment_author_id); + +CREATE INDEX index_vulnerability_feedback_on_issue_id ON vulnerability_feedback USING btree (issue_id); + +CREATE INDEX index_vulnerability_feedback_on_merge_request_id ON vulnerability_feedback USING btree (merge_request_id); + +CREATE INDEX index_vulnerability_feedback_on_pipeline_id ON vulnerability_feedback USING btree (pipeline_id); + +CREATE UNIQUE INDEX index_vulnerability_identifiers_on_project_id_and_fingerprint ON vulnerability_identifiers USING btree (project_id, fingerprint); + +CREATE INDEX index_vulnerability_issue_links_on_issue_id ON vulnerability_issue_links USING btree (issue_id); + +CREATE INDEX index_vulnerability_occurrence_identifiers_on_identifier_id ON vulnerability_occurrence_identifiers USING btree (identifier_id); + +CREATE UNIQUE INDEX index_vulnerability_occurrence_identifiers_on_unique_keys ON vulnerability_occurrence_identifiers USING btree (occurrence_id, identifier_id); + +CREATE INDEX index_vulnerability_occurrence_pipelines_on_pipeline_id ON vulnerability_occurrence_pipelines USING btree (pipeline_id); + +CREATE INDEX index_vulnerability_occurrences_on_primary_identifier_id ON vulnerability_occurrences USING btree (primary_identifier_id); + +CREATE INDEX index_vulnerability_occurrences_on_scanner_id ON vulnerability_occurrences USING btree (scanner_id); + +CREATE UNIQUE INDEX index_vulnerability_occurrences_on_unique_keys ON vulnerability_occurrences USING btree (project_id, primary_identifier_id, location_fingerprint, scanner_id); + +CREATE UNIQUE INDEX index_vulnerability_occurrences_on_uuid ON vulnerability_occurrences USING btree (uuid); + +CREATE INDEX index_vulnerability_occurrences_on_vulnerability_id ON vulnerability_occurrences USING btree (vulnerability_id); + +CREATE UNIQUE INDEX index_vulnerability_scanners_on_project_id_and_external_id ON vulnerability_scanners USING btree (project_id, external_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_web_hook_id ON web_hook_logs USING btree (web_hook_id); + +CREATE INDEX index_web_hooks_on_project_id ON web_hooks USING btree (project_id); + +CREATE INDEX index_web_hooks_on_type ON web_hooks USING btree (type); + +CREATE UNIQUE INDEX index_webauthn_registrations_on_credential_xid ON webauthn_registrations USING btree (credential_xid); + +CREATE INDEX index_webauthn_registrations_on_user_id ON webauthn_registrations USING btree (user_id); + +CREATE INDEX index_x509_certificates_on_subject_key_identifier ON x509_certificates USING btree (subject_key_identifier); + +CREATE INDEX index_x509_certificates_on_x509_issuer_id ON x509_certificates USING btree (x509_issuer_id); + +CREATE INDEX index_x509_commit_signatures_on_commit_sha ON x509_commit_signatures USING btree (commit_sha); + +CREATE INDEX index_x509_commit_signatures_on_project_id ON x509_commit_signatures USING btree (project_id); + +CREATE INDEX index_x509_commit_signatures_on_x509_certificate_id ON x509_commit_signatures USING btree (x509_certificate_id); + +CREATE INDEX index_x509_issuers_on_subject_key_identifier ON x509_issuers USING btree (subject_key_identifier); + +CREATE INDEX index_zoom_meetings_on_issue_id ON zoom_meetings USING btree (issue_id); + +CREATE UNIQUE INDEX index_zoom_meetings_on_issue_id_and_issue_status ON zoom_meetings USING btree (issue_id, issue_status) WHERE (issue_status = 1); + +CREATE INDEX index_zoom_meetings_on_issue_status ON zoom_meetings USING btree (issue_status); + +CREATE INDEX index_zoom_meetings_on_project_id ON zoom_meetings USING btree (project_id); + +CREATE INDEX issue_id_issues_prometheus_alert_events_index ON issues_prometheus_alert_events USING btree (prometheus_alert_event_id); + +CREATE INDEX issue_id_issues_self_managed_rometheus_alert_events_index ON issues_self_managed_prometheus_alert_events USING btree (self_managed_prometheus_alert_event_id); + +CREATE UNIQUE INDEX issue_id_prometheus_alert_event_id_index ON issues_prometheus_alert_events USING btree (issue_id, prometheus_alert_event_id); + +CREATE UNIQUE INDEX issue_id_self_managed_prometheus_alert_event_id_index ON issues_self_managed_prometheus_alert_events USING btree (issue_id, self_managed_prometheus_alert_event_id); + +CREATE UNIQUE INDEX issue_user_mentions_on_issue_id_and_note_id_index ON issue_user_mentions USING btree (issue_id, note_id); + +CREATE UNIQUE INDEX issue_user_mentions_on_issue_id_index ON issue_user_mentions USING btree (issue_id) WHERE (note_id IS NULL); + +CREATE UNIQUE INDEX kubernetes_namespaces_cluster_and_namespace ON clusters_kubernetes_namespaces USING btree (cluster_id, namespace); + +CREATE UNIQUE INDEX merge_request_user_mentions_on_mr_id_and_note_id_index ON merge_request_user_mentions USING btree (merge_request_id, note_id); + +CREATE UNIQUE INDEX merge_request_user_mentions_on_mr_id_index ON merge_request_user_mentions USING btree (merge_request_id) WHERE (note_id IS 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)); + +CREATE INDEX partial_index_deployments_for_project_id_and_tag ON deployments USING btree (project_id) WHERE (tag IS TRUE); + +CREATE UNIQUE INDEX snippet_user_mentions_on_snippet_id_and_note_id_index ON snippet_user_mentions USING btree (snippet_id, note_id); + +CREATE UNIQUE INDEX snippet_user_mentions_on_snippet_id_index ON snippet_user_mentions USING btree (snippet_id) WHERE (note_id IS NULL); + +CREATE UNIQUE INDEX taggings_idx ON taggings USING btree (tag_id, taggable_id, taggable_type, context, tagger_id, tagger_type); + +CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree (user_id, term_id); + +CREATE INDEX tmp_build_stage_position_index ON ci_builds USING btree (stage_id, stage_idx) WHERE (stage_idx IS NOT NULL); + +CREATE UNIQUE INDEX users_security_dashboard_projects_unique_index ON users_security_dashboard_projects USING btree (project_id, user_id); + +CREATE UNIQUE INDEX vulnerability_feedback_unique_idx ON vulnerability_feedback USING btree (project_id, category, feedback_type, project_fingerprint); + +CREATE UNIQUE INDEX vulnerability_occurrence_pipelines_on_unique_keys ON vulnerability_occurrence_pipelines USING btree (occurrence_id, pipeline_id); + +ALTER TABLE ONLY epics + ADD CONSTRAINT fk_013c9f36ca FOREIGN KEY (due_date_sourcing_epic_id) REFERENCES epics(id) ON DELETE SET NULL; + +ALTER TABLE ONLY clusters_applications_runners + ADD CONSTRAINT fk_02de2ded36 FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE SET NULL; + +ALTER TABLE ONLY design_management_designs_versions + ADD CONSTRAINT fk_03c671965c FOREIGN KEY (design_id) REFERENCES design_management_designs(id) ON DELETE CASCADE; + +ALTER TABLE ONLY issues + ADD CONSTRAINT fk_05f1e72feb FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY merge_requests + ADD CONSTRAINT fk_06067f5644 FOREIGN KEY (latest_merge_request_diff_id) REFERENCES merge_request_diffs(id) ON DELETE SET NULL; + +ALTER TABLE ONLY projects + ADD CONSTRAINT fk_0a31cca0b8 FOREIGN KEY (marked_for_deletion_by_user_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY web_hooks + ADD CONSTRAINT fk_0c8ca6d9d1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY notification_settings + ADD CONSTRAINT fk_0c95e91db7 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY lists + ADD CONSTRAINT fk_0d3f677137 FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE; + +ALTER TABLE ONLY group_deletion_schedules + ADD CONSTRAINT fk_11e3ebfcdd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerabilities + ADD CONSTRAINT fk_1302949740 FOREIGN KEY (last_edited_by_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY vulnerabilities + ADD CONSTRAINT fk_131d289c65 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; + +ALTER TABLE ONLY internal_ids + ADD CONSTRAINT fk_162941d509 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_event_log + ADD CONSTRAINT fk_176d3fbb5d FOREIGN KEY (job_artifact_deleted_event_id) REFERENCES geo_job_artifact_deleted_events(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_features + ADD CONSTRAINT fk_18513d9b92 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +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 vulnerabilities + ADD CONSTRAINT fk_1d37cddf91 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_sources_pipelines + ADD CONSTRAINT fk_1e53c97c0a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY epics + ADD CONSTRAINT fk_1fbed67632 FOREIGN KEY (start_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL NOT VALID; + +ALTER TABLE ONLY geo_container_repository_updated_events + ADD CONSTRAINT fk_212c89c706 FOREIGN KEY (container_repository_id) REFERENCES container_repositories(id) ON DELETE CASCADE; + +ALTER TABLE ONLY users_star_projects + ADD CONSTRAINT fk_22cd27ddfc FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_stages + ADD CONSTRAINT fk_2360681d1d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_ci_cd_settings + ADD CONSTRAINT fk_24c15d2f2e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY epics + ADD CONSTRAINT fk_25b99c1be3 FOREIGN KEY (parent_id) REFERENCES epics(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_pipelines + ADD CONSTRAINT fk_262d4c2d19 FOREIGN KEY (auto_canceled_by_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_build_trace_sections + ADD CONSTRAINT fk_264e112c66 FOREIGN KEY (section_name_id) REFERENCES ci_build_trace_section_names(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_event_log + ADD CONSTRAINT fk_27548c6db3 FOREIGN KEY (hashed_storage_migrated_event_id) REFERENCES geo_hashed_storage_migrated_events(id) ON DELETE CASCADE; + +ALTER TABLE ONLY deployments + ADD CONSTRAINT fk_289bba3222 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE SET NULL; + +ALTER TABLE ONLY notes + ADD CONSTRAINT fk_2e82291620 FOREIGN KEY (review_id) REFERENCES reviews(id) ON DELETE SET NULL; + +ALTER TABLE ONLY members + ADD CONSTRAINT fk_2e88fb7ce9 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approvals + ADD CONSTRAINT fk_310d714958 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +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 epics + ADD CONSTRAINT fk_3654b61b03 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY push_event_payloads + ADD CONSTRAINT fk_36c74129da FOREIGN KEY (event_id) REFERENCES events(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 epics + ADD CONSTRAINT fk_3c1fd1cccc FOREIGN KEY (due_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL NOT VALID; + +ALTER TABLE ONLY ci_pipelines + ADD CONSTRAINT fk_3d34ab2e06 FOREIGN KEY (pipeline_schedule_id) REFERENCES ci_pipeline_schedules(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_pipeline_schedule_variables + ADD CONSTRAINT fk_41c35fda51 FOREIGN KEY (pipeline_schedule_id) REFERENCES ci_pipeline_schedules(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_event_log + ADD CONSTRAINT fk_42c3b54bed FOREIGN KEY (cache_invalidation_event_id) REFERENCES geo_cache_invalidation_events(id) ON DELETE CASCADE; + +ALTER TABLE ONLY forked_project_links + ADD CONSTRAINT fk_434510edb0 FOREIGN KEY (forked_to_project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_runner_projects + ADD CONSTRAINT fk_4478a6f1e4 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY todos + ADD CONSTRAINT fk_45054f9c45 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY releases + ADD CONSTRAINT fk_47fe2a0596 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_event_log + ADD CONSTRAINT fk_4a99ebfd60 FOREIGN KEY (repositories_changed_event_id) REFERENCES geo_repositories_changed_events(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_build_trace_sections + ADD CONSTRAINT fk_4ebe41f502 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + +ALTER TABLE ONLY path_locks + ADD CONSTRAINT fk_5265c98f24 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_feedback + ADD CONSTRAINT fk_563ff1912e FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE SET NULL; + +ALTER TABLE ONLY deploy_keys_projects + ADD CONSTRAINT fk_58a901ca7e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY issue_assignees + ADD CONSTRAINT fk_5e0c8d9154 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_requests + ADD CONSTRAINT fk_6149611a04 FOREIGN KEY (assignee_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY dependency_proxy_group_settings + ADD CONSTRAINT fk_616ddd680a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY events + ADD CONSTRAINT fk_61fbf6ca48 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_requests + ADD CONSTRAINT fk_641731faff FOREIGN KEY (updated_by_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_builds + ADD CONSTRAINT fk_6661f4f0e8 FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE SET NULL; + +ALTER TABLE ONLY merge_requests + ADD CONSTRAINT fk_6a5165a692 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; + +ALTER TABLE ONLY geo_event_log + ADD CONSTRAINT fk_6ada82d42a FOREIGN KEY (container_repository_updated_event_id) REFERENCES geo_container_repository_updated_events(id) ON DELETE CASCADE; + +ALTER TABLE ONLY projects + ADD CONSTRAINT fk_6e5c14658a FOREIGN KEY (pool_repository_id) REFERENCES pool_repositories(id) ON DELETE SET NULL; + +ALTER TABLE ONLY protected_branch_push_access_levels + ADD CONSTRAINT fk_7111b68cdb FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY services + ADD CONSTRAINT fk_71cce407f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY index_statuses + ADD CONSTRAINT fk_74b2492545 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerabilities + ADD CONSTRAINT fk_76bc5f5455 FOREIGN KEY (resolved_by_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY oauth_openid_requests + ADD CONSTRAINT fk_77114b3b09 FOREIGN KEY (access_grant_id) REFERENCES oauth_access_grants(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_resource_groups + ADD CONSTRAINT fk_774722d144 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY users + ADD CONSTRAINT fk_789cd90b35 FOREIGN KEY (accepted_term_id) REFERENCES application_setting_terms(id) ON DELETE CASCADE; + +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 lists + ADD CONSTRAINT fk_7a5553d60f FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; + +ALTER TABLE ONLY protected_branches + ADD CONSTRAINT fk_7a9c6d93e7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerabilities + ADD CONSTRAINT fk_7ac31eacb9 FOREIGN KEY (updated_by_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY vulnerabilities + ADD CONSTRAINT fk_7c5bb22a22 FOREIGN KEY (due_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; + +ALTER TABLE ONLY labels + ADD CONSTRAINT fk_7de4989a69 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_request_metrics + ADD CONSTRAINT fk_7f28d925f3 FOREIGN KEY (merged_by_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY import_export_uploads + ADD CONSTRAINT fk_83319d9721 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY push_rules + ADD CONSTRAINT fk_83b29894de FOREIGN KEY (project_id) REFERENCES projects(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; + +ALTER TABLE ONLY ci_pipelines + ADD CONSTRAINT fk_86635dbd80 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_event_log + ADD CONSTRAINT fk_86c84214ec FOREIGN KEY (repository_renamed_event_id) REFERENCES geo_repository_renamed_events(id) ON DELETE CASCADE; + +ALTER TABLE ONLY packages_package_files + ADD CONSTRAINT fk_86f0f182f8 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_builds + ADD CONSTRAINT fk_87f4cefcda FOREIGN KEY (upstream_pipeline_id) REFERENCES ci_pipelines(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; + +ALTER TABLE ONLY issues + ADD CONSTRAINT fk_899c8f3231 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +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 releases + ADD CONSTRAINT fk_8e4456f90f FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY protected_tags + ADD CONSTRAINT fk_8e4af87648 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_pipeline_schedules + ADD CONSTRAINT fk_8ead60fcc4 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY todos + ADD CONSTRAINT fk_91d1f47b13 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_feedback + ADD CONSTRAINT fk_94f7c8a81e FOREIGN KEY (comment_author_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY milestones + ADD CONSTRAINT fk_95650a40d4 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY application_settings + ADD CONSTRAINT fk_964370041d FOREIGN KEY (usage_stats_set_by_user_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY issues + ADD CONSTRAINT fk_96b1dd429c FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; + +ALTER TABLE ONLY vulnerability_occurrences + ADD CONSTRAINT fk_97ffe77653 FOREIGN KEY (vulnerability_id) REFERENCES vulnerabilities(id) ON DELETE SET NULL; + +ALTER TABLE ONLY protected_branch_merge_access_levels + ADD CONSTRAINT fk_98f3d044fe FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY notes + ADD CONSTRAINT fk_99e097b079 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_event_log + ADD CONSTRAINT fk_9b9afb1916 FOREIGN KEY (repository_created_event_id) REFERENCES geo_repository_created_events(id) ON DELETE CASCADE; + +ALTER TABLE ONLY milestones + ADD CONSTRAINT fk_9bd0a0c791 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY issues + ADD CONSTRAINT fk_9c4516d665 FOREIGN KEY (duplicated_to_id) REFERENCES issues(id) ON DELETE SET NULL; + +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 ci_pipeline_schedules + ADD CONSTRAINT fk_9ea99f58d2 FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY protected_branch_push_access_levels + ADD CONSTRAINT fk_9ffc86a3d9 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE; + +ALTER TABLE ONLY issues + ADD CONSTRAINT fk_a194299be1 FOREIGN KEY (moved_to_id) REFERENCES issues(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_builds + ADD CONSTRAINT fk_a2141b1522 FOREIGN KEY (auto_canceled_by_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_pipelines + ADD CONSTRAINT fk_a23be95014 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY todos + ADD CONSTRAINT fk_a27c483435 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY jira_connect_subscriptions + ADD CONSTRAINT fk_a3c10bcf7d FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY users + ADD CONSTRAINT fk_a4b8fefe3e FOREIGN KEY (managing_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; + +ALTER TABLE ONLY merge_requests + ADD CONSTRAINT fk_a6963e8447 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY epics + ADD CONSTRAINT fk_aa5798e761 FOREIGN KEY (closed_by_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY identities + ADD CONSTRAINT fk_aade90f0fc FOREIGN KEY (saml_provider_id) REFERENCES saml_providers(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_sources_pipelines + ADD CONSTRAINT fk_acd9737679 FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_requests + ADD CONSTRAINT fk_ad525e1f87 FOREIGN KEY (merge_user_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_variables + ADD CONSTRAINT fk_ada5eb64b3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_request_metrics + ADD CONSTRAINT fk_ae440388cc FOREIGN KEY (latest_closed_by_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY fork_network_members + ADD CONSTRAINT fk_b01280dae4 FOREIGN KEY (forked_from_project_id) REFERENCES projects(id) ON DELETE SET NULL; + +ALTER TABLE ONLY vulnerabilities + ADD CONSTRAINT fk_b1de915a15 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY protected_tag_create_access_levels + ADD CONSTRAINT fk_b4eb82fe3c FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY issue_assignees + ADD CONSTRAINT fk_b7d881734a FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_trigger_requests + ADD CONSTRAINT fk_b8ec8b7245 FOREIGN KEY (trigger_id) REFERENCES ci_triggers(id) ON DELETE CASCADE; + +ALTER TABLE ONLY deployments + ADD CONSTRAINT fk_b9a3851b82 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gitlab_subscriptions + ADD CONSTRAINT fk_bd0c4019c3 FOREIGN KEY (hosted_plan_id) REFERENCES plans(id) ON DELETE CASCADE; + +ALTER TABLE ONLY snippets + ADD CONSTRAINT fk_be41fd4bb7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_sources_pipelines + ADD CONSTRAINT fk_be5624bf37 FOREIGN KEY (source_job_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + +ALTER TABLE ONLY packages_maven_metadata + ADD CONSTRAINT fk_be88aed360 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_builds + ADD CONSTRAINT fk_befce0568a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY design_management_versions + ADD CONSTRAINT fk_c1440b4896 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY geo_event_log + ADD CONSTRAINT fk_c1f241c70d FOREIGN KEY (upload_deleted_event_id) REFERENCES geo_upload_deleted_events(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; + +ALTER TABLE ONLY issues + ADD CONSTRAINT fk_c63cbf6c25 FOREIGN KEY (closed_by_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY issue_links + ADD CONSTRAINT fk_c900194ff2 FOREIGN KEY (source_id) REFERENCES issues(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 vulnerabilities + ADD CONSTRAINT fk_cf5c60acbf FOREIGN KEY (closed_by_id) REFERENCES users(id) ON DELETE SET NULL; + +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; + +ALTER TABLE ONLY environments + ADD CONSTRAINT fk_d1c8c1da6a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_builds + ADD CONSTRAINT fk_d3130c9a7f FOREIGN KEY (commit_id) REFERENCES ci_pipelines(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; + +ALTER TABLE ONLY geo_event_log + ADD CONSTRAINT fk_d5af95fcd9 FOREIGN KEY (lfs_object_deleted_event_id) REFERENCES geo_lfs_object_deleted_events(id) ON DELETE CASCADE; + +ALTER TABLE ONLY lists + ADD CONSTRAINT fk_d6cf4279f7 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY system_note_metadata + ADD CONSTRAINT fk_d83a918cb1 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; + +ALTER TABLE ONLY todos + ADD CONSTRAINT fk_d94154aa95 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_group_links + ADD CONSTRAINT fk_daa8cee94c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY dependency_proxy_blobs + ADD CONSTRAINT fk_db58bbc5d7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY epics + ADD CONSTRAINT fk_dccd3f98fc FOREIGN KEY (assignee_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY issues + ADD CONSTRAINT fk_df75a7c8b8 FOREIGN KEY (promoted_to_epic_id) REFERENCES epics(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_resources + ADD CONSTRAINT fk_e169a8e3d5 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_sources_pipelines + ADD CONSTRAINT fk_e1bad85861 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gitlab_subscriptions + ADD CONSTRAINT fk_e2595d00a1 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_triggers + ADD CONSTRAINT fk_e3e63f966e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_requests + ADD CONSTRAINT fk_e719a85f8a FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY issue_links + ADD CONSTRAINT fk_e71bb44f1f FOREIGN KEY (target_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY namespaces + ADD CONSTRAINT fk_e7a0b20a6b FOREIGN KEY (custom_project_templates_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; + +ALTER TABLE ONLY fork_networks + ADD CONSTRAINT fk_e7b436b2b5 FOREIGN KEY (root_project_id) REFERENCES projects(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_triggers + ADD CONSTRAINT fk_e8e10d1964 FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY pages_domains + ADD CONSTRAINT fk_ea2f6dfc6f FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY application_settings + ADD CONSTRAINT fk_ec757bd087 FOREIGN KEY (file_template_project_id) REFERENCES projects(id) ON DELETE SET NULL; + +ALTER TABLE ONLY events + ADD CONSTRAINT fk_edfd187b6f FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerabilities + ADD CONSTRAINT fk_efb96ab1e2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters + ADD CONSTRAINT fk_f05c5e5a42 FOREIGN KEY (management_project_id) REFERENCES projects(id) ON DELETE SET NULL; + +ALTER TABLE ONLY epics + ADD CONSTRAINT fk_f081aa4489 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY boards + ADD CONSTRAINT fk_f15266b5f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY jira_connect_subscriptions + ADD CONSTRAINT fk_f1d617343f FOREIGN KEY (jira_connect_installation_id) REFERENCES jira_connect_installations(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_pipeline_variables + ADD CONSTRAINT fk_f29c5f4380 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(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; + +ALTER TABLE ONLY protected_tag_create_access_levels + ADD CONSTRAINT fk_f7dfda8c51 FOREIGN KEY (protected_tag_id) REFERENCES protected_tags(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_stages + ADD CONSTRAINT fk_fb57e6cc56 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + +ALTER TABLE ONLY system_note_metadata + ADD CONSTRAINT fk_fbd87415c9 FOREIGN KEY (description_version_id) REFERENCES description_versions(id) ON DELETE SET NULL; + +ALTER TABLE ONLY merge_requests + ADD CONSTRAINT fk_fd82eae0b9 FOREIGN KEY (head_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; + +ALTER TABLE ONLY namespaces + ADD CONSTRAINT fk_fdd12e5b80 FOREIGN KEY (plan_id) REFERENCES plans(id) ON DELETE SET NULL; + +ALTER TABLE ONLY project_import_data + ADD CONSTRAINT fk_ffb9ee3a10 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY issues + ADD CONSTRAINT fk_ffed080f01 FOREIGN KEY (updated_by_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY personal_access_tokens + ADD CONSTRAINT fk_personal_access_tokens_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approval_merge_request_rules + ADD CONSTRAINT fk_rails_004ce82224 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY namespace_statistics + ADD CONSTRAINT fk_rails_0062050394 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters_applications_elastic_stacks + ADD CONSTRAINT fk_rails_026f219f46 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +ALTER TABLE ONLY events + ADD CONSTRAINT fk_rails_0434b48643 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ip_restrictions + ADD CONSTRAINT fk_rails_04a93778d5 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_subscriptions_projects + ADD CONSTRAINT fk_rails_0818751483 FOREIGN KEY (downstream_project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY user_interacted_projects + ADD CONSTRAINT fk_rails_0894651f08 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY trending_projects + ADD CONSTRAINT fk_rails_09feecd872 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_deploy_tokens + ADD CONSTRAINT fk_rails_0aca134388 FOREIGN KEY (deploy_token_id) REFERENCES deploy_tokens(id) ON DELETE CASCADE; + +ALTER TABLE ONLY analytics_repository_file_commits + ADD CONSTRAINT fk_rails_0aefa9ee3e FOREIGN KEY (analytics_repository_file_id) REFERENCES analytics_repository_files(id) ON DELETE CASCADE; + +ALTER TABLE ONLY packages_conan_file_metadata + ADD CONSTRAINT fk_rails_0afabd9328 FOREIGN KEY (package_file_id) REFERENCES packages_package_files(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_node_statuses + ADD CONSTRAINT fk_rails_0ecc699c2a FOREIGN KEY (geo_node_id) REFERENCES geo_nodes(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_repository_states + ADD CONSTRAINT fk_rails_0f2298ca8a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY user_synced_attributes_metadata + ADD CONSTRAINT fk_rails_0f4aa0981f FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_authorizations + ADD CONSTRAINT fk_rails_0f84bb11f3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_request_context_commits + ADD CONSTRAINT fk_rails_0fe0039f60 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_build_trace_chunks + ADD CONSTRAINT fk_rails_1013b761f2 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + +ALTER TABLE ONLY prometheus_alert_events + ADD CONSTRAINT fk_rails_106f901176 FOREIGN KEY (prometheus_alert_id) REFERENCES prometheus_alerts(id) ON DELETE CASCADE; + +ALTER TABLE ONLY zoom_meetings + ADD CONSTRAINT fk_rails_1190f0e0fa FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gpg_signatures + ADD CONSTRAINT fk_rails_11ae8cb9a7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_authorizations + ADD CONSTRAINT fk_rails_11e7aa3ed9 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY description_versions + ADD CONSTRAINT fk_rails_12b144011c FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_statistics + ADD CONSTRAINT fk_rails_12c471002f FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY users_security_dashboard_projects + ADD CONSTRAINT fk_rails_150cd5682c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_deploy_tokens + ADD CONSTRAINT fk_rails_170e03cbaf FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY analytics_cycle_analytics_project_stages + ADD CONSTRAINT fk_rails_1722574860 FOREIGN KEY (start_event_label_id) REFERENCES labels(id) ON DELETE CASCADE; + +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 clusters_applications_jupyter + ADD CONSTRAINT fk_rails_17df21c98c FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +ALTER TABLE ONLY cluster_providers_aws + ADD CONSTRAINT fk_rails_18983d9ea4 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +ALTER TABLE ONLY grafana_integrations + ADD CONSTRAINT fk_rails_18d0e2b564 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gpg_signatures + ADD CONSTRAINT fk_rails_19d4f1c6f9 FOREIGN KEY (gpg_key_subkey_id) REFERENCES gpg_key_subkeys(id) ON DELETE SET NULL; + +ALTER TABLE ONLY board_assignees + ADD CONSTRAINT fk_rails_1c0ff59e82 FOREIGN KEY (assignee_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY epic_user_mentions + ADD CONSTRAINT fk_rails_1c65976a49 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approver_groups + ADD CONSTRAINT fk_rails_1cdcbd7723 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_refs + ADD CONSTRAINT fk_rails_1da48d19ce FOREIGN KEY (last_updated_by_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; + +ALTER TABLE ONLY boards + ADD CONSTRAINT fk_rails_1e9a074a35 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_repository_created_events + ADD CONSTRAINT fk_rails_1f49e46a61 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approval_merge_request_rules_groups + ADD CONSTRAINT fk_rails_2020a7124a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_feedback + ADD CONSTRAINT fk_rails_20976e6fd9 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; + +ALTER TABLE ONLY merge_request_milestones + ADD CONSTRAINT fk_rails_212ba37b52 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY user_statuses + ADD CONSTRAINT fk_rails_2178592333 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY users_ops_dashboard_projects + ADD CONSTRAINT fk_rails_220a0562db FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters_applications_runners + ADD CONSTRAINT fk_rails_22388594e9 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +ALTER TABLE ONLY service_desk_settings + ADD CONSTRAINT fk_rails_223a296a85 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY protected_tag_create_access_levels + ADD CONSTRAINT fk_rails_2349b78b91 FOREIGN KEY (user_id) REFERENCES users(id); + +ALTER TABLE ONLY group_custom_attributes + ADD CONSTRAINT fk_rails_246e0db83a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY lfs_file_locks + ADD CONSTRAINT fk_rails_27a1d98fa8 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_alerting_settings + ADD CONSTRAINT fk_rails_27a84b407d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY reviews + ADD CONSTRAINT fk_rails_29e6f859c4 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY draft_notes + ADD CONSTRAINT fk_rails_2a8dac9901 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY packages_tags + ADD CONSTRAINT fk_rails_2b18ae9256 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; + +ALTER TABLE ONLY group_group_links + ADD CONSTRAINT fk_rails_2b2353ca49 FOREIGN KEY (shared_with_group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_repository_updated_events + ADD CONSTRAINT fk_rails_2b70854c08 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY protected_branch_unprotect_access_levels + ADD CONSTRAINT fk_rails_2d2aba21ef FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY saml_providers + ADD CONSTRAINT fk_rails_306d459be7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_request_diff_commits + ADD CONSTRAINT fk_rails_316aaceda3 FOREIGN KEY (merge_request_diff_id) REFERENCES merge_request_diffs(id) ON DELETE CASCADE; + +ALTER TABLE ONLY zoom_meetings + ADD CONSTRAINT fk_rails_3263f29616 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY container_repositories + ADD CONSTRAINT fk_rails_32f7bf5aad FOREIGN KEY (project_id) REFERENCES projects(id); + +ALTER TABLE ONLY clusters_applications_jupyter + ADD CONSTRAINT fk_rails_331f0aff78 FOREIGN KEY (oauth_application_id) REFERENCES oauth_applications(id) ON DELETE SET NULL; + +ALTER TABLE ONLY merge_request_metrics + ADD CONSTRAINT fk_rails_33ae169d48 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + +ALTER TABLE ONLY suggestions + ADD CONSTRAINT fk_rails_33b03a535c FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; + +ALTER TABLE ONLY board_labels + ADD CONSTRAINT fk_rails_362b0600a3 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_request_blocks + ADD CONSTRAINT fk_rails_364d4bea8b FOREIGN KEY (blocked_merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +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 issue_user_mentions + ADD CONSTRAINT fk_rails_3861d9fefa FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; + +ALTER TABLE ONLY self_managed_prometheus_alert_events + ADD CONSTRAINT fk_rails_3936dadc62 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approval_project_rules_groups + ADD CONSTRAINT fk_rails_396841e79e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY self_managed_prometheus_alert_events + ADD CONSTRAINT fk_rails_39d83d1b65 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE; + +ALTER TABLE ONLY chat_teams + ADD CONSTRAINT fk_rails_3b543909cb FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_build_needs + ADD CONSTRAINT fk_rails_3cf221d4ed FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + +ALTER TABLE ONLY cluster_groups + ADD CONSTRAINT fk_rails_3d28377556 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY note_diff_files + ADD CONSTRAINT fk_rails_3d66047aeb FOREIGN KEY (diff_note_id) REFERENCES notes(id) ON DELETE CASCADE; + +ALTER TABLE ONLY snippet_user_mentions + ADD CONSTRAINT fk_rails_3e00189191 FOREIGN KEY (snippet_id) REFERENCES snippets(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters_applications_helm + ADD CONSTRAINT fk_rails_3e2b1c06bc FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +ALTER TABLE ONLY epic_user_mentions + ADD CONSTRAINT fk_rails_3eaf4d88cc FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; + +ALTER TABLE ONLY analytics_cycle_analytics_project_stages + ADD CONSTRAINT fk_rails_3ec9fd7912 FOREIGN KEY (end_event_label_id) REFERENCES labels(id) ON DELETE CASCADE; + +ALTER TABLE ONLY board_assignees + ADD CONSTRAINT fk_rails_3f6f926bd5 FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE; + +ALTER TABLE ONLY description_versions + ADD CONSTRAINT fk_rails_3ff658220b FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters_kubernetes_namespaces + ADD CONSTRAINT fk_rails_40cc7ccbc3 FOREIGN KEY (cluster_project_id) REFERENCES cluster_projects(id) ON DELETE SET NULL; + +ALTER TABLE ONLY geo_node_namespace_links + ADD CONSTRAINT fk_rails_41ff5fb854 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY epic_issues + ADD CONSTRAINT fk_rails_4209981af6 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_refs + ADD CONSTRAINT fk_rails_4249db8cc3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_resources + ADD CONSTRAINT fk_rails_430336af2d FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE CASCADE; + +ALTER TABLE ONLY remote_mirrors + ADD CONSTRAINT fk_rails_43a9aa4ca8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY lfs_file_locks + ADD CONSTRAINT fk_rails_43df7a0412 FOREIGN KEY (project_id) REFERENCES projects(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; + +ALTER TABLE ONLY packages_dependency_links + ADD CONSTRAINT fk_rails_4437bf4070 FOREIGN KEY (dependency_id) REFERENCES packages_dependencies(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_auto_devops + ADD CONSTRAINT fk_rails_45436b12b2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_requests_closing_issues + ADD CONSTRAINT fk_rails_458eda8667 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY protected_environment_deploy_access_levels + ADD CONSTRAINT fk_rails_45cc02a931 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY prometheus_alert_events + ADD CONSTRAINT fk_rails_4675865839 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY smartcard_identities + ADD CONSTRAINT fk_rails_4689f889a9 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_feedback + ADD CONSTRAINT fk_rails_472f69b043 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY user_custom_attributes + ADD CONSTRAINT fk_rails_47b91868a8 FOREIGN KEY (user_id) REFERENCES users(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; + +ALTER TABLE ONLY design_management_designs + ADD CONSTRAINT fk_rails_4bb1073360 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY issue_metrics + ADD CONSTRAINT fk_rails_4bb543d85d FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_metrics_settings + ADD CONSTRAINT fk_rails_4c6037ee4f FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY prometheus_metrics + ADD CONSTRAINT fk_rails_4c8957a707 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY snippet_user_mentions + ADD CONSTRAINT fk_rails_4d3f96b2cb FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_repository_renamed_events + ADD CONSTRAINT fk_rails_4e6524febb FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY aws_roles + ADD CONSTRAINT fk_rails_4ed56f4720 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_request_diff_files + ADD CONSTRAINT fk_rails_501aa0a391 FOREIGN KEY (merge_request_diff_id) REFERENCES merge_request_diffs(id) ON DELETE CASCADE; + +ALTER TABLE ONLY x509_commit_signatures + ADD CONSTRAINT fk_rails_53fe41188f FOREIGN KEY (x509_certificate_id) REFERENCES x509_certificates(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_node_namespace_links + ADD CONSTRAINT fk_rails_546bf08d3e FOREIGN KEY (geo_node_id) REFERENCES geo_nodes(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters_applications_knative + ADD CONSTRAINT fk_rails_54fc91e0a0 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters_applications_prometheus + ADD CONSTRAINT fk_rails_557e773639 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +ALTER TABLE ONLY issue_user_mentions + ADD CONSTRAINT fk_rails_57581fda73 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_request_assignees + ADD CONSTRAINT fk_rails_579d375628 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY analytics_cycle_analytics_group_stages + ADD CONSTRAINT fk_rails_5a22f40223 FOREIGN KEY (start_event_label_id) REFERENCES labels(id) ON DELETE CASCADE; + +ALTER TABLE ONLY badges + ADD CONSTRAINT fk_rails_5a7c055bdc FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY resource_label_events + ADD CONSTRAINT fk_rails_5ac1d2fc24 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approval_merge_request_rules_groups + ADD CONSTRAINT fk_rails_5b2ecf6139 FOREIGN KEY (approval_merge_request_rule_id) REFERENCES approval_merge_request_rules(id) ON DELETE CASCADE; + +ALTER TABLE ONLY protected_environment_deploy_access_levels + ADD CONSTRAINT fk_rails_5b9f6970fe FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY protected_branch_unprotect_access_levels + ADD CONSTRAINT fk_rails_5be1abfc25 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY cluster_providers_gcp + ADD CONSTRAINT fk_rails_5c2c3bc814 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +ALTER TABLE ONLY insights + ADD CONSTRAINT fk_rails_5c4391f60a FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_scanners + ADD CONSTRAINT fk_rails_5c9d42a221 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY reviews + ADD CONSTRAINT fk_rails_5ca11d8c31 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY epic_issues + ADD CONSTRAINT fk_rails_5d942936b4 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; + +ALTER TABLE ONLY resource_weight_events + ADD CONSTRAINT fk_rails_5eb5cb92a1 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approval_project_rules + ADD CONSTRAINT fk_rails_5fb4dd100b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY protected_branch_merge_access_levels + ADD CONSTRAINT fk_rails_5ffb4f3590 FOREIGN KEY (user_id) REFERENCES users(id); + +ALTER TABLE ONLY evidences + ADD CONSTRAINT fk_rails_6388b435a6 FOREIGN KEY (release_id) REFERENCES releases(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_occurrence_pipelines + ADD CONSTRAINT fk_rails_6421e35d7d FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + +ALTER TABLE ONLY reviews + ADD CONSTRAINT fk_rails_64798be025 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY operations_feature_flags + ADD CONSTRAINT fk_rails_648e241be7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY board_group_recent_visits + ADD CONSTRAINT fk_rails_64bfc19bc5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approval_merge_request_rule_sources + ADD CONSTRAINT fk_rails_64e8ed3c7e FOREIGN KEY (approval_project_rule_id) REFERENCES approval_project_rules(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_pipeline_chat_data + ADD CONSTRAINT fk_rails_64ebfab6b3 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + +ALTER TABLE ONLY design_management_versions + ADD CONSTRAINT fk_rails_6574200d99 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approval_merge_request_rules_approved_approvers + ADD CONSTRAINT fk_rails_6577725edb FOREIGN KEY (approval_merge_request_rule_id) REFERENCES approval_merge_request_rules(id) ON DELETE CASCADE; + +ALTER TABLE ONLY operations_feature_flags_clients + ADD CONSTRAINT fk_rails_6650ed902c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY web_hook_logs + ADD CONSTRAINT fk_rails_666826e111 FOREIGN KEY (web_hook_id) REFERENCES web_hooks(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 plan_limits + ADD CONSTRAINT fk_rails_69f8b6184f FOREIGN KEY (plan_id) REFERENCES plans(id) ON DELETE CASCADE; + +ALTER TABLE ONLY prometheus_alerts + ADD CONSTRAINT fk_rails_6d9b283465 FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_request_milestones + ADD CONSTRAINT fk_rails_6da5e88b3c FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE CASCADE; + +ALTER TABLE ONLY term_agreements + ADD CONSTRAINT fk_rails_6ea6520e4a FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY users_security_dashboard_projects + ADD CONSTRAINT fk_rails_6f6cf8e66e FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_builds_runner_session + ADD CONSTRAINT fk_rails_70707857d3 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + +ALTER TABLE ONLY list_user_preferences + ADD CONSTRAINT fk_rails_70b2ef5ce2 FOREIGN KEY (list_id) REFERENCES lists(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_custom_attributes + ADD CONSTRAINT fk_rails_719c3dccc5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY user_interacted_projects + ADD CONSTRAINT fk_rails_722ceba4f7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY slack_integrations + ADD CONSTRAINT fk_rails_73db19721a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_request_context_commit_diff_files + ADD CONSTRAINT fk_rails_74a00a1787 FOREIGN KEY (merge_request_context_commit_id) REFERENCES merge_request_context_commits(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters_applications_ingress + ADD CONSTRAINT fk_rails_753a7b41c1 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +ALTER TABLE ONLY release_links + ADD CONSTRAINT fk_rails_753be7ae29 FOREIGN KEY (release_id) REFERENCES releases(id) ON DELETE CASCADE; + +ALTER TABLE ONLY milestone_releases + ADD CONSTRAINT fk_rails_754f27dbfa FOREIGN KEY (release_id) REFERENCES releases(id) ON DELETE CASCADE; + +ALTER TABLE ONLY analytics_repository_files + ADD CONSTRAINT fk_rails_755b835007 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_repositories_changed_events + ADD CONSTRAINT fk_rails_75ec0fefcc FOREIGN KEY (geo_node_id) REFERENCES geo_nodes(id) ON DELETE CASCADE; + +ALTER TABLE ONLY resource_label_events + ADD CONSTRAINT fk_rails_75efb0a653 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; + +ALTER TABLE ONLY path_locks + ADD CONSTRAINT fk_rails_762cdcf942 FOREIGN KEY (user_id) REFERENCES users(id); + +ALTER TABLE ONLY x509_certificates + ADD CONSTRAINT fk_rails_76479fb5b4 FOREIGN KEY (x509_issuer_id) REFERENCES x509_issuers(id) ON DELETE CASCADE; + +ALTER TABLE ONLY pages_domain_acme_orders + ADD CONSTRAINT fk_rails_76581b1c16 FOREIGN KEY (pages_domain_id) REFERENCES pages_domains(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 software_license_policies + ADD CONSTRAINT fk_rails_7a7a2a92de FOREIGN KEY (software_license_id) REFERENCES software_licenses(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_repositories + ADD CONSTRAINT fk_rails_7a810d4121 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY milestone_releases + ADD CONSTRAINT fk_rails_7ae0756a2d FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE CASCADE; + +ALTER TABLE ONLY application_settings + ADD CONSTRAINT fk_rails_7e112a9599 FOREIGN KEY (instance_administration_project_id) REFERENCES projects(id) ON DELETE SET NULL; + +ALTER TABLE ONLY clusters_kubernetes_namespaces + ADD CONSTRAINT fk_rails_7e7688ecaf FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approval_merge_request_rules_users + ADD CONSTRAINT fk_rails_80e6801803 FOREIGN KEY (approval_merge_request_rule_id) REFERENCES approval_merge_request_rules(id) ON DELETE CASCADE; + +ALTER TABLE ONLY deployment_merge_requests + ADD CONSTRAINT fk_rails_86a6d8bf12 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY analytics_language_trend_repository_languages + ADD CONSTRAINT fk_rails_86cc9aef5f FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters_applications_crossplane + ADD CONSTRAINT fk_rails_87186702df FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_runner_namespaces + ADD CONSTRAINT fk_rails_8767676b7a FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE CASCADE; + +ALTER TABLE ONLY software_license_policies + ADD CONSTRAINT fk_rails_87b2247ce5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY protected_environment_deploy_access_levels + ADD CONSTRAINT fk_rails_898a13b650 FOREIGN KEY (protected_environment_id) REFERENCES protected_environments(id) ON DELETE CASCADE; + +ALTER TABLE ONLY analytics_repository_file_commits + ADD CONSTRAINT fk_rails_89bc941356 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gpg_key_subkeys + ADD CONSTRAINT fk_rails_8b2c90b046 FOREIGN KEY (gpg_key_id) REFERENCES gpg_keys(id) ON DELETE CASCADE; + +ALTER TABLE ONLY allowed_email_domains + ADD CONSTRAINT fk_rails_8b5da859f9 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY cluster_projects + ADD CONSTRAINT fk_rails_8b8c5caf07 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_pages_metadata + ADD CONSTRAINT fk_rails_8c28a61485 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY packages_conan_metadata + ADD CONSTRAINT fk_rails_8c68cfec8b FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_feedback + ADD CONSTRAINT fk_rails_8c77e5891a FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE SET NULL; + +ALTER TABLE ONLY approval_merge_request_rules_approved_approvers + ADD CONSTRAINT fk_rails_8dc94cff4d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY protected_branch_push_access_levels + ADD CONSTRAINT fk_rails_8dcb712d65 FOREIGN KEY (user_id) REFERENCES users(id); + +ALTER TABLE ONLY design_user_mentions + ADD CONSTRAINT fk_rails_8de8c6d632 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters_kubernetes_namespaces + ADD CONSTRAINT fk_rails_8df789f3ab FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE SET NULL; + +ALTER TABLE ONLY project_daily_statistics + ADD CONSTRAINT fk_rails_8e549b272d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_pipelines_config + ADD CONSTRAINT fk_rails_906c9a2533 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approval_project_rules_groups + ADD CONSTRAINT fk_rails_9071e863d1 FOREIGN KEY (approval_project_rule_id) REFERENCES approval_project_rules(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_occurrences + ADD CONSTRAINT fk_rails_90fed4faba FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_reset_checksum_events + ADD CONSTRAINT fk_rails_910a06f12b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_error_tracking_settings + ADD CONSTRAINT fk_rails_910a2b8bd9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY list_user_preferences + ADD CONSTRAINT fk_rails_916d72cafd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY board_labels + ADD CONSTRAINT fk_rails_9374a16edd FOREIGN KEY (board_id) REFERENCES boards(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; + +ALTER TABLE ONLY resource_label_events + ADD CONSTRAINT fk_rails_9851a00031 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_job_artifacts + ADD CONSTRAINT fk_rails_9862d392f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY board_project_recent_visits + ADD CONSTRAINT fk_rails_98f8843922 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters_kubernetes_namespaces + ADD CONSTRAINT fk_rails_98fe21e486 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE SET NULL; + +ALTER TABLE ONLY users_ops_dashboard_projects + ADD CONSTRAINT fk_rails_9b4ebf005b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_incident_management_settings + ADD CONSTRAINT fk_rails_9c2ea1b7dd FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gpg_keys + ADD CONSTRAINT fk_rails_9d1f5d8719 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY analytics_language_trend_repository_languages + ADD CONSTRAINT fk_rails_9d851d566c FOREIGN KEY (programming_language_id) REFERENCES programming_languages(id) ON DELETE CASCADE; + +ALTER TABLE ONLY badges + ADD CONSTRAINT fk_rails_9df4a56538 FOREIGN KEY (group_id) REFERENCES namespaces(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; + +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 project_aliases + ADD CONSTRAINT fk_rails_a1804f74a7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY jira_tracker_data + ADD CONSTRAINT fk_rails_a299066916 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE; + +ALTER TABLE ONLY protected_environments + ADD CONSTRAINT fk_rails_a354313d11 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY fork_network_members + ADD CONSTRAINT fk_rails_a40860a1ca FOREIGN KEY (fork_network_id) REFERENCES fork_networks(id) ON DELETE CASCADE; + +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 cluster_projects + ADD CONSTRAINT fk_rails_a5a958bca1 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +ALTER TABLE ONLY commit_user_mentions + ADD CONSTRAINT fk_rails_a6760813e0 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_identifiers + ADD CONSTRAINT fk_rails_a67a16c885 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY user_preferences + ADD CONSTRAINT fk_rails_a69bfcfd81 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY sentry_issues + ADD CONSTRAINT fk_rails_a6a9612965 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY repository_languages + ADD CONSTRAINT fk_rails_a750ec87a8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY term_agreements + ADD CONSTRAINT fk_rails_a88721bcdf FOREIGN KEY (term_id) REFERENCES application_setting_terms(id); + +ALTER TABLE ONLY merge_request_user_mentions + ADD CONSTRAINT fk_rails_aa1b2961b1 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY x509_commit_signatures + ADD CONSTRAINT fk_rails_ab07452314 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_build_trace_sections + ADD CONSTRAINT fk_rails_ab7c104e26 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters + ADD CONSTRAINT fk_rails_ac3a663d79 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY analytics_cycle_analytics_group_stages + ADD CONSTRAINT fk_rails_ae5da3409b FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY pool_repositories + ADD CONSTRAINT fk_rails_af3f8c5d62 FOREIGN KEY (shard_id) REFERENCES shards(id) ON DELETE RESTRICT; + +ALTER TABLE ONLY resource_label_events + ADD CONSTRAINT fk_rails_b126799f57 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE SET NULL; + +ALTER TABLE ONLY packages_build_infos + ADD CONSTRAINT fk_rails_b18868292d FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_trains + ADD CONSTRAINT fk_rails_b29261ce31 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY board_project_recent_visits + ADD CONSTRAINT fk_rails_b315dd0c80 FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE; + +ALTER TABLE ONLY issues_prometheus_alert_events + ADD CONSTRAINT fk_rails_b32edb790f FOREIGN KEY (prometheus_alert_event_id) REFERENCES prometheus_alert_events(id) ON DELETE CASCADE; + +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 issue_milestones + ADD CONSTRAINT fk_rails_b3daad894f FOREIGN KEY (milestone_id) REFERENCES milestones(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; + +ALTER TABLE ONLY namespace_aggregation_schedules + ADD CONSTRAINT fk_rails_b565c8d16c FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY alerts_service_data + ADD CONSTRAINT fk_rails_b93215a42c FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_trains + ADD CONSTRAINT fk_rails_b9d67af01d FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approval_project_rules_users + ADD CONSTRAINT fk_rails_b9e9394efb FOREIGN KEY (approval_project_rule_id) REFERENCES approval_project_rules(id) ON DELETE CASCADE; + +ALTER TABLE ONLY lists + ADD CONSTRAINT fk_rails_baed5f39b7 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approval_merge_request_rules_users + ADD CONSTRAINT fk_rails_bc8972fa55 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY external_pull_requests + ADD CONSTRAINT fk_rails_bcae9b5c7b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY elasticsearch_indexed_projects + ADD CONSTRAINT fk_rails_bd13bbdc3d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY elasticsearch_indexed_namespaces + ADD CONSTRAINT fk_rails_bdcf044f37 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_occurrence_identifiers + ADD CONSTRAINT fk_rails_be2e49e1d0 FOREIGN KEY (identifier_id) REFERENCES vulnerability_identifiers(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_occurrences + ADD CONSTRAINT fk_rails_bf5b788ca7 FOREIGN KEY (scanner_id) REFERENCES vulnerability_scanners(id) ON DELETE CASCADE; + +ALTER TABLE ONLY resource_weight_events + ADD CONSTRAINT fk_rails_bfc406b47c FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY design_management_designs + ADD CONSTRAINT fk_rails_bfe283ec3c FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY u2f_registrations + ADD CONSTRAINT fk_rails_bfe6a84544 FOREIGN KEY (user_id) REFERENCES users(id); + +ALTER TABLE ONLY serverless_domain_cluster + ADD CONSTRAINT fk_rails_c09009dee1 FOREIGN KEY (pages_domain_id) REFERENCES pages_domains(id) ON DELETE CASCADE; + +ALTER TABLE ONLY labels + ADD CONSTRAINT fk_rails_c1ac5161d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_feature_usages + ADD CONSTRAINT fk_rails_c22a50024b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_repositories + ADD CONSTRAINT fk_rails_c3258dc63b FOREIGN KEY (shard_id) REFERENCES shards(id) ON DELETE RESTRICT; + +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 ci_job_artifacts + ADD CONSTRAINT fk_rails_c5137cb2c1 FOREIGN KEY (job_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_settings + ADD CONSTRAINT fk_rails_c6df6e6328 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY container_expiration_policies + ADD CONSTRAINT fk_rails_c7360f09ad FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY scim_oauth_access_tokens + ADD CONSTRAINT fk_rails_c84404fb6c FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_occurrences + ADD CONSTRAINT fk_rails_c8661a61eb FOREIGN KEY (primary_identifier_id) REFERENCES vulnerability_identifiers(id) ON DELETE CASCADE; + +ALTER TABLE ONLY gpg_signatures + ADD CONSTRAINT fk_rails_c97176f5f7 FOREIGN KEY (gpg_key_id) REFERENCES gpg_keys(id) ON DELETE SET NULL; + +ALTER TABLE ONLY board_group_recent_visits + ADD CONSTRAINT fk_rails_ca04c38720 FOREIGN KEY (board_id) REFERENCES boards(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; + +ALTER TABLE ONLY issue_tracker_data + ADD CONSTRAINT fk_rails_ccc0840427 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE; + +ALTER TABLE ONLY analytics_repository_file_edits + ADD CONSTRAINT fk_rails_ce1d13b872 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY epic_metrics + ADD CONSTRAINT fk_rails_d071904753 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; + +ALTER TABLE ONLY subscriptions + ADD CONSTRAINT fk_rails_d0c8bda804 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_mirror_data + ADD CONSTRAINT fk_rails_d1aad367d7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +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 group_group_links + ADD CONSTRAINT fk_rails_d3a0488427 FOREIGN KEY (shared_group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_issue_links + ADD CONSTRAINT fk_rails_d459c19036 FOREIGN KEY (vulnerability_id) REFERENCES vulnerabilities(id) ON DELETE CASCADE; + +ALTER TABLE ONLY geo_hashed_storage_attachments_events + ADD CONSTRAINT fk_rails_d496b088e9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY analytics_repository_file_edits + ADD CONSTRAINT fk_rails_d74fd62274 FOREIGN KEY (analytics_repository_file_id) REFERENCES analytics_repository_files(id) ON DELETE CASCADE; + +ALTER TABLE ONLY issues_prometheus_alert_events + ADD CONSTRAINT fk_rails_db5b756534 FOREIGN KEY (issue_id) REFERENCES issues(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; + +ALTER TABLE ONLY deployment_merge_requests + ADD CONSTRAINT fk_rails_dcbce9f4df FOREIGN KEY (deployment_id) REFERENCES deployments(id) ON DELETE CASCADE; + +ALTER TABLE ONLY user_callouts + ADD CONSTRAINT fk_rails_ddfdd80f3d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_feedback + ADD CONSTRAINT fk_rails_debd54e456 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +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 label_priorities + ADD CONSTRAINT fk_rails_e161058b0f FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; + +ALTER TABLE ONLY packages_packages + ADD CONSTRAINT fk_rails_e1ac527425 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY cluster_platforms_kubernetes + ADD CONSTRAINT fk_rails_e1e2cf841a FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +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_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 approval_merge_request_rule_sources + ADD CONSTRAINT fk_rails_e605a04f76 FOREIGN KEY (approval_merge_request_rule_id) REFERENCES approval_merge_request_rules(id) ON DELETE CASCADE; + +ALTER TABLE ONLY prometheus_alerts + ADD CONSTRAINT fk_rails_e6351447ec FOREIGN KEY (prometheus_metric_id) REFERENCES prometheus_metrics(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_request_metrics + ADD CONSTRAINT fk_rails_e6d7c24d1b FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY draft_notes + ADD CONSTRAINT fk_rails_e753681674 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY description_versions + ADD CONSTRAINT fk_rails_e8f4caf9c7 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; + +ALTER TABLE ONLY vulnerability_issue_links + ADD CONSTRAINT fk_rails_e9180d534b FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_request_blocks + ADD CONSTRAINT fk_rails_e9387863bc FOREIGN KEY (blocking_merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + +ALTER TABLE ONLY protected_branch_unprotect_access_levels + ADD CONSTRAINT fk_rails_e9eb8dc025 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE; + +ALTER TABLE ONLY cluster_providers_aws + ADD CONSTRAINT fk_rails_ed1fdfaeb2 FOREIGN KEY (created_by_user_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY label_priorities + ADD CONSTRAINT fk_rails_ef916d14fa FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY fork_network_members + ADD CONSTRAINT fk_rails_efccadc4ec FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY prometheus_alerts + ADD CONSTRAINT fk_rails_f0e8db86aa FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY import_export_uploads + ADD CONSTRAINT fk_rails_f129140f9e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_pipeline_chat_data + ADD CONSTRAINT fk_rails_f300456b63 FOREIGN KEY (chat_name_id) REFERENCES chat_names(id) ON DELETE CASCADE; + +ALTER TABLE ONLY approval_project_rules_users + ADD CONSTRAINT fk_rails_f365da8250 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY insights + ADD CONSTRAINT fk_rails_f36fda3932 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY board_group_recent_visits + ADD CONSTRAINT fk_rails_f410736518 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY design_user_mentions + ADD CONSTRAINT fk_rails_f7075a53c1 FOREIGN KEY (design_id) REFERENCES design_management_designs(id) ON DELETE CASCADE; + +ALTER TABLE ONLY internal_ids + ADD CONSTRAINT fk_rails_f7d46b66c6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY issues_self_managed_prometheus_alert_events + ADD CONSTRAINT fk_rails_f7db2d72eb FOREIGN KEY (self_managed_prometheus_alert_event_id) REFERENCES self_managed_prometheus_alert_events(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_requests_closing_issues + ADD CONSTRAINT fk_rails_f8540692be FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_build_trace_section_names + ADD CONSTRAINT fk_rails_f8cd72cd26 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_trains + ADD CONSTRAINT fk_rails_f90820cb08 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_runner_namespaces + ADD CONSTRAINT fk_rails_f9d9ed3308 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY board_project_recent_visits + ADD CONSTRAINT fk_rails_fb6fc419cb FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + +ALTER TABLE ONLY serverless_domain_cluster + ADD CONSTRAINT fk_rails_fbdba67eb1 FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_job_variables + ADD CONSTRAINT fk_rails_fbf3b34792 FOREIGN KEY (job_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + +ALTER TABLE ONLY cluster_groups + ADD CONSTRAINT fk_rails_fdb8648a96 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + +ALTER TABLE ONLY project_tracing_settings + ADD CONSTRAINT fk_rails_fe56f57fc6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY resource_label_events + ADD CONSTRAINT fk_rails_fe91ece594 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY issue_milestones + ADD CONSTRAINT fk_rails_ff90aaa198 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_builds_metadata + ADD CONSTRAINT fk_rails_ffcf702a02 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +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; diff --git a/db/migrate/20181228175414_init_schema.rb b/db/migrate/20181228175414_init_schema.rb index d4212f405d9..df68927d79a 100644 --- a/db/migrate/20181228175414_init_schema.rb +++ b/db/migrate/20181228175414_init_schema.rb @@ -1,2562 +1,13 @@ # frozen_string_literal: true -# rubocop:disable Metrics/AbcSize -# rubocop:disable Migration/AddConcurrentForeignKey -# rubocop:disable Style/WordArray -# rubocop:disable Migration/PreventStrings -# rubocop:disable Migration/AddLimitToTextColumns -# rubocop:disable Migration/Datetime - class InitSchema < ActiveRecord::Migration[6.0] DOWNTIME = false def up - # These are extensions that must be enabled in order to support this database - enable_extension "pg_trgm" - enable_extension "plpgsql" - - create_table "abuse_reports", id: :serial, force: :cascade do |t| - t.integer "reporter_id" - t.integer "user_id" - t.text "message" - t.datetime "created_at" - t.datetime "updated_at" - t.text "message_html" - t.integer "cached_markdown_version" - end - - create_table "appearances", id: :serial, force: :cascade do |t| - t.string "title", null: false - t.text "description", null: false - t.string "header_logo" - t.string "logo" - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.text "description_html" - t.integer "cached_markdown_version" - t.string "favicon" - t.text "new_project_guidelines" - t.text "new_project_guidelines_html" - t.text "header_message" - t.text "header_message_html" - t.text "footer_message" - t.text "footer_message_html" - t.text "message_background_color" - t.text "message_font_color" - end - - create_table "application_setting_terms", id: :serial, force: :cascade do |t| - t.integer "cached_markdown_version" - t.text "terms", null: false - t.text "terms_html" - end - - create_table "application_settings", id: :serial, force: :cascade do |t| - t.integer "default_projects_limit" - t.boolean "signup_enabled" - t.boolean "gravatar_enabled" - t.text "sign_in_text" - t.datetime "created_at" - t.datetime "updated_at" - t.string "home_page_url" - t.integer "default_branch_protection", default: 2 - t.text "restricted_visibility_levels" - t.boolean "version_check_enabled", default: true - t.integer "max_attachment_size", default: 10, null: false - t.integer "default_project_visibility" - t.integer "default_snippet_visibility" - t.text "domain_whitelist" - t.boolean "user_oauth_applications", default: true - t.string "after_sign_out_path" - t.integer "session_expire_delay", default: 10080, null: false - t.text "import_sources" - t.text "help_page_text" - t.string "admin_notification_email" - t.boolean "shared_runners_enabled", default: true, null: false - t.integer "max_artifacts_size", default: 100, null: false - t.string "runners_registration_token" - t.integer "max_pages_size", default: 100, null: false - t.boolean "require_two_factor_authentication", default: false - t.integer "two_factor_grace_period", default: 48 - t.boolean "metrics_enabled", default: false - t.string "metrics_host", default: "localhost" - t.integer "metrics_pool_size", default: 16 - t.integer "metrics_timeout", default: 10 - t.integer "metrics_method_call_threshold", default: 10 - t.boolean "recaptcha_enabled", default: false - t.string "recaptcha_site_key" - t.string "recaptcha_private_key" - t.integer "metrics_port", default: 8089 - t.boolean "akismet_enabled", default: false - t.string "akismet_api_key" - t.integer "metrics_sample_interval", default: 15 - t.boolean "sentry_enabled", default: false - t.string "sentry_dsn" - t.boolean "email_author_in_body", default: false - t.integer "default_group_visibility" - t.boolean "repository_checks_enabled", default: false - t.text "shared_runners_text" - t.integer "metrics_packet_size", default: 1 - t.text "disabled_oauth_sign_in_sources" - t.string "health_check_access_token" - t.boolean "send_user_confirmation_email", default: false - t.integer "container_registry_token_expire_delay", default: 5 - t.text "after_sign_up_text" - t.boolean "user_default_external", default: false, null: false - t.string "repository_storages", default: "default" - t.string "enabled_git_access_protocol" - t.boolean "domain_blacklist_enabled", default: false - t.text "domain_blacklist" - t.boolean "usage_ping_enabled", default: true, null: false - t.text "sign_in_text_html" - t.text "help_page_text_html" - t.text "shared_runners_text_html" - t.text "after_sign_up_text_html" - t.integer "rsa_key_restriction", default: 0, null: false - t.integer "dsa_key_restriction", default: -1, null: false - t.integer "ecdsa_key_restriction", default: 0, null: false - t.integer "ed25519_key_restriction", default: 0, null: false - t.boolean "housekeeping_enabled", default: true, null: false - t.boolean "housekeeping_bitmaps_enabled", default: true, null: false - t.integer "housekeeping_incremental_repack_period", default: 10, null: false - t.integer "housekeeping_full_repack_period", default: 50, null: false - t.integer "housekeeping_gc_period", default: 200, null: false - t.boolean "html_emails_enabled", default: true - t.string "plantuml_url" - t.boolean "plantuml_enabled" - t.integer "terminal_max_session_time", default: 0, null: false - t.integer "unique_ips_limit_per_user" - t.integer "unique_ips_limit_time_window" - t.boolean "unique_ips_limit_enabled", default: false, null: false - t.string "default_artifacts_expire_in", default: "0", null: false - t.string "uuid" - t.decimal "polling_interval_multiplier", default: "1.0", null: false - t.integer "cached_markdown_version" - t.boolean "clientside_sentry_enabled", default: false, null: false - t.string "clientside_sentry_dsn" - t.boolean "prometheus_metrics_enabled", default: true, null: false - t.boolean "authorized_keys_enabled", default: true, null: false - t.boolean "help_page_hide_commercial_content", default: false - t.string "help_page_support_url" - t.integer "performance_bar_allowed_group_id" - t.boolean "hashed_storage_enabled", default: false, null: false - t.boolean "project_export_enabled", default: true, null: false - t.boolean "auto_devops_enabled", default: true, null: false - t.boolean "throttle_unauthenticated_enabled", default: false, null: false - t.integer "throttle_unauthenticated_requests_per_period", default: 3600, null: false - t.integer "throttle_unauthenticated_period_in_seconds", default: 3600, null: false - t.boolean "throttle_authenticated_api_enabled", default: false, null: false - t.integer "throttle_authenticated_api_requests_per_period", default: 7200, null: false - t.integer "throttle_authenticated_api_period_in_seconds", default: 3600, null: false - t.boolean "throttle_authenticated_web_enabled", default: false, null: false - t.integer "throttle_authenticated_web_requests_per_period", default: 7200, null: false - t.integer "throttle_authenticated_web_period_in_seconds", default: 3600, null: false - t.integer "gitaly_timeout_default", default: 55, null: false - t.integer "gitaly_timeout_medium", default: 30, null: false - t.integer "gitaly_timeout_fast", default: 10, null: false - t.boolean "password_authentication_enabled_for_web" - t.boolean "password_authentication_enabled_for_git", default: true, null: false - t.boolean "external_authorization_service_enabled", default: false, null: false - t.string "external_authorization_service_url" - t.string "external_authorization_service_default_label" - t.integer "default_project_creation", default: 2, null: false - t.string "auto_devops_domain" - t.boolean "pages_domain_verification_enabled", default: true, null: false - t.boolean "allow_local_requests_from_hooks_and_services", default: false, null: false - t.string "user_default_internal_regex" - t.float "external_authorization_service_timeout", default: 0.5 - t.text "external_auth_client_cert" - t.text "encrypted_external_auth_client_key" - t.string "encrypted_external_auth_client_key_iv" - t.string "encrypted_external_auth_client_key_pass" - t.string "encrypted_external_auth_client_key_pass_iv" - t.boolean "enforce_terms", default: false - t.boolean "mirror_available", default: true, null: false - t.boolean "hide_third_party_offers", default: false, null: false - t.boolean "instance_statistics_visibility_private", default: false, null: false - t.integer "receive_max_input_size" - t.boolean "web_ide_clientside_preview_enabled", default: false, null: false - t.boolean "user_show_add_ssh_key_message", default: true, null: false - t.string "outbound_local_requests_whitelist", limit: 255, array: true - t.integer "usage_stats_set_by_user_id" - t.integer "diff_max_patch_bytes", default: 102400, null: false - t.integer "archive_builds_in_seconds" - t.string "commit_email_hostname" - t.integer "first_day_of_week", default: 0, null: false - t.boolean "protected_ci_variables", default: false, null: false - t.string "runners_registration_token_encrypted" - t.index ["usage_stats_set_by_user_id"], name: "index_application_settings_on_usage_stats_set_by_user_id" - end - - create_table "audit_events", id: :serial, force: :cascade do |t| - t.integer "author_id", null: false - t.string "type", null: false - t.integer "entity_id", null: false - t.string "entity_type", null: false - t.text "details" - t.datetime "created_at" - t.datetime "updated_at" - t.index ["entity_id", "entity_type"], name: "index_audit_events_on_entity_id_and_entity_type" - end - - create_table "award_emoji", id: :serial, force: :cascade do |t| - t.string "name" - t.integer "user_id" - t.string "awardable_type" - t.integer "awardable_id" - t.datetime "created_at" - t.datetime "updated_at" - t.index ["awardable_type", "awardable_id"], name: "index_award_emoji_on_awardable_type_and_awardable_id" - t.index ["user_id", "name"], name: "index_award_emoji_on_user_id_and_name" - end - - create_table "badges", id: :serial, force: :cascade do |t| - t.string "link_url", null: false - t.string "image_url", null: false - t.integer "project_id" - t.integer "group_id" - t.string "type", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.index ["group_id"], name: "index_badges_on_group_id" - t.index ["project_id"], name: "index_badges_on_project_id" - end - - create_table "board_group_recent_visits", force: :cascade do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "user_id" - t.integer "board_id" - t.integer "group_id" - t.index ["board_id"], name: "index_board_group_recent_visits_on_board_id" - t.index ["group_id"], name: "index_board_group_recent_visits_on_group_id" - t.index ["user_id", "group_id", "board_id"], name: "index_board_group_recent_visits_on_user_group_and_board", unique: true - t.index ["user_id"], name: "index_board_group_recent_visits_on_user_id" - end - - create_table "board_project_recent_visits", force: :cascade do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "user_id" - t.integer "project_id" - t.integer "board_id" - t.index ["board_id"], name: "index_board_project_recent_visits_on_board_id" - t.index ["project_id"], name: "index_board_project_recent_visits_on_project_id" - t.index ["user_id", "project_id", "board_id"], name: "index_board_project_recent_visits_on_user_project_and_board", unique: true - t.index ["user_id"], name: "index_board_project_recent_visits_on_user_id" - end - - create_table "boards", id: :serial, force: :cascade do |t| - t.integer "project_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "group_id" - t.index ["group_id"], name: "index_boards_on_group_id" - t.index ["project_id"], name: "index_boards_on_project_id" - end - - create_table "broadcast_messages", id: :serial, force: :cascade do |t| - t.text "message", null: false - t.datetime "starts_at", null: false - t.datetime "ends_at", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "color" - t.string "font" - t.text "message_html", null: false - t.integer "cached_markdown_version" - t.index ["starts_at", "ends_at", "id"], name: "index_broadcast_messages_on_starts_at_and_ends_at_and_id" - end - - create_table "chat_names", id: :serial, force: :cascade do |t| - t.integer "user_id", null: false - t.integer "service_id", null: false - t.string "team_id", null: false - t.string "team_domain" - t.string "chat_id", null: false - t.string "chat_name" - t.datetime "last_used_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["service_id", "team_id", "chat_id"], name: "index_chat_names_on_service_id_and_team_id_and_chat_id", unique: true - t.index ["user_id", "service_id"], name: "index_chat_names_on_user_id_and_service_id", unique: true - end - - create_table "chat_teams", id: :serial, force: :cascade do |t| - t.integer "namespace_id", null: false - t.string "team_id" - t.string "name" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["namespace_id"], name: "index_chat_teams_on_namespace_id", unique: true - end - - create_table "ci_build_trace_chunks", force: :cascade do |t| - t.integer "build_id", null: false - t.integer "chunk_index", null: false - t.integer "data_store", null: false - t.binary "raw_data" - t.index ["build_id", "chunk_index"], name: "index_ci_build_trace_chunks_on_build_id_and_chunk_index", unique: true - end - - create_table "ci_build_trace_section_names", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.string "name", null: false - t.index ["project_id", "name"], name: "index_ci_build_trace_section_names_on_project_id_and_name", unique: true - end - - create_table "ci_build_trace_sections", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.datetime_with_timezone "date_start", null: false - t.datetime_with_timezone "date_end", null: false - t.bigint "byte_start", null: false - t.bigint "byte_end", null: false - t.integer "build_id", null: false - t.integer "section_name_id", null: false - t.index ["build_id", "section_name_id"], name: "index_ci_build_trace_sections_on_build_id_and_section_name_id", unique: true - t.index ["project_id"], name: "index_ci_build_trace_sections_on_project_id" - t.index ["section_name_id"], name: "index_ci_build_trace_sections_on_section_name_id" - end - - create_table "ci_builds", id: :serial, force: :cascade do |t| - t.string "status" - t.datetime "finished_at" - t.text "trace" - t.datetime "created_at" - t.datetime "updated_at" - t.datetime "started_at" - t.integer "runner_id" - t.float "coverage" - t.integer "commit_id" - t.text "commands" - t.string "name" - t.text "options" - t.boolean "allow_failure", default: false, null: false - t.string "stage" - t.integer "trigger_request_id" - t.integer "stage_idx" - t.boolean "tag" - t.string "ref" - t.integer "user_id" - t.string "type" - t.string "target_url" - t.string "description" - t.text "artifacts_file" - t.integer "project_id" - t.text "artifacts_metadata" - t.integer "erased_by_id" - t.datetime "erased_at" - t.datetime "artifacts_expire_at" - t.string "environment" - t.bigint "artifacts_size" - t.string "when" - t.text "yaml_variables" - t.datetime "queued_at" - t.string "token" - t.integer "lock_version" - t.string "coverage_regex" - t.integer "auto_canceled_by_id" - t.boolean "retried" - t.integer "stage_id" - t.integer "artifacts_file_store" - t.integer "artifacts_metadata_store" - t.boolean "protected" - t.integer "failure_reason" - t.datetime_with_timezone "scheduled_at" - t.string "token_encrypted" - t.index ["artifacts_expire_at"], name: "index_ci_builds_on_artifacts_expire_at", where: "(artifacts_file <> ''::text)" - t.index ["auto_canceled_by_id"], name: "index_ci_builds_on_auto_canceled_by_id" - t.index ["commit_id", "artifacts_expire_at", "id"], name: "index_ci_builds_on_commit_id_and_artifacts_expireatandidpartial", where: "(((type)::text = 'Ci::Build'::text) AND ((retried = false) OR (retried IS NULL)) AND ((name)::text = ANY (ARRAY[('sast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('sast:container'::character varying)::text, ('container_scanning'::character varying)::text, ('dast'::character varying)::text])))" - t.index ["commit_id", "stage_idx", "created_at"], name: "index_ci_builds_on_commit_id_and_stage_idx_and_created_at" - t.index ["commit_id", "status", "type"], name: "index_ci_builds_on_commit_id_and_status_and_type" - t.index ["commit_id", "type", "name", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_name_and_ref" - t.index ["commit_id", "type", "ref"], name: "index_ci_builds_on_commit_id_and_type_and_ref" - t.index ["id"], name: "partial_index_ci_builds_on_id_with_legacy_artifacts", where: "(artifacts_file <> ''::text)" - t.index ["project_id", "id"], name: "index_ci_builds_on_project_id_and_id" - t.index ["project_id", "status"], name: "index_ci_builds_project_id_and_status_for_live_jobs_partial2", where: "(((type)::text = 'Ci::Build'::text) AND ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text])))" - t.index ["protected"], name: "index_ci_builds_on_protected" - t.index ["runner_id"], name: "index_ci_builds_on_runner_id" - t.index ["scheduled_at"], name: "partial_index_ci_builds_on_scheduled_at_with_scheduled_jobs", where: "((scheduled_at IS NOT NULL) AND ((type)::text = 'Ci::Build'::text) AND ((status)::text = 'scheduled'::text))" - t.index ["stage_id", "stage_idx"], name: "tmp_build_stage_position_index", where: "(stage_idx IS NOT NULL)" - t.index ["stage_id"], name: "index_ci_builds_on_stage_id" - t.index ["status", "type", "runner_id"], name: "index_ci_builds_on_status_and_type_and_runner_id" - t.index ["token"], name: "index_ci_builds_on_token", unique: true - t.index ["token_encrypted"], name: "index_ci_builds_on_token_encrypted", unique: true, where: "(token_encrypted IS NOT NULL)" - t.index ["updated_at"], name: "index_ci_builds_on_updated_at" - t.index ["user_id"], name: "index_ci_builds_on_user_id" - end - - create_table "ci_builds_metadata", id: :serial, force: :cascade do |t| - t.integer "build_id", null: false - t.integer "project_id", null: false - t.integer "timeout" - t.integer "timeout_source", default: 1, null: false - t.jsonb "config_options" - t.jsonb "config_variables" - t.index ["build_id"], name: "index_ci_builds_metadata_on_build_id", unique: true - t.index ["project_id"], name: "index_ci_builds_metadata_on_project_id" - end - - create_table "ci_builds_runner_session", force: :cascade do |t| - t.integer "build_id", null: false - t.string "url", null: false - t.string "certificate" - t.string "authorization" - t.index ["build_id"], name: "index_ci_builds_runner_session_on_build_id", unique: true - end - - create_table "ci_group_variables", id: :serial, force: :cascade do |t| - t.string "key", null: false - t.text "value" - t.text "encrypted_value" - t.string "encrypted_value_salt" - t.string "encrypted_value_iv" - t.integer "group_id", null: false - t.boolean "protected", default: false, null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.index ["group_id", "key"], name: "index_ci_group_variables_on_group_id_and_key", unique: true - end - - create_table "ci_job_artifacts", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.integer "job_id", null: false - t.integer "file_type", null: false - t.bigint "size" - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.datetime_with_timezone "expire_at" - t.string "file" - t.integer "file_store" - t.binary "file_sha256" - t.integer "file_format", limit: 2 - t.integer "file_location", limit: 2 - t.index ["expire_at", "job_id"], name: "index_ci_job_artifacts_on_expire_at_and_job_id" - t.index ["file_store"], name: "index_ci_job_artifacts_on_file_store" - t.index ["job_id", "file_type"], name: "index_ci_job_artifacts_on_job_id_and_file_type", unique: true - t.index ["project_id"], name: "index_ci_job_artifacts_on_project_id" - end - - create_table "ci_pipeline_chat_data", force: :cascade do |t| - t.integer "pipeline_id", null: false - t.integer "chat_name_id", null: false - t.text "response_url", null: false - t.index ["chat_name_id"], name: "index_ci_pipeline_chat_data_on_chat_name_id" - t.index ["pipeline_id"], name: "index_ci_pipeline_chat_data_on_pipeline_id", unique: true - end - - create_table "ci_pipeline_schedule_variables", id: :serial, force: :cascade do |t| - t.string "key", null: false - t.text "value" - t.text "encrypted_value" - t.string "encrypted_value_salt" - t.string "encrypted_value_iv" - t.integer "pipeline_schedule_id", null: false - t.datetime_with_timezone "created_at" - t.datetime_with_timezone "updated_at" - t.index ["pipeline_schedule_id", "key"], name: "index_ci_pipeline_schedule_variables_on_schedule_id_and_key", unique: true - end - - create_table "ci_pipeline_schedules", id: :serial, force: :cascade do |t| - t.string "description" - t.string "ref" - t.string "cron" - t.string "cron_timezone" - t.datetime "next_run_at" - t.integer "project_id" - t.integer "owner_id" - t.boolean "active", default: true - t.datetime "created_at" - t.datetime "updated_at" - t.index ["next_run_at", "active"], name: "index_ci_pipeline_schedules_on_next_run_at_and_active" - t.index ["owner_id"], name: "index_ci_pipeline_schedules_on_owner_id" - t.index ["project_id"], name: "index_ci_pipeline_schedules_on_project_id" - end - - create_table "ci_pipeline_variables", id: :serial, force: :cascade do |t| - t.string "key", null: false - t.text "value" - t.text "encrypted_value" - t.string "encrypted_value_salt" - t.string "encrypted_value_iv" - t.integer "pipeline_id", null: false - t.index ["pipeline_id", "key"], name: "index_ci_pipeline_variables_on_pipeline_id_and_key", unique: true - end - - create_table "ci_pipelines", id: :serial, force: :cascade do |t| - t.string "ref" - t.string "sha" - t.string "before_sha" - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "tag", default: false - t.text "yaml_errors" - t.datetime "committed_at" - t.integer "project_id" - t.string "status" - t.datetime "started_at" - t.datetime "finished_at" - t.integer "duration" - t.integer "user_id" - t.integer "lock_version" - t.integer "auto_canceled_by_id" - t.integer "pipeline_schedule_id" - t.integer "source" - t.boolean "protected" - t.integer "config_source" - t.integer "failure_reason" - t.integer "iid" - t.integer "merge_request_id" - t.index ["auto_canceled_by_id"], name: "index_ci_pipelines_on_auto_canceled_by_id" - t.index ["merge_request_id"], name: "index_ci_pipelines_on_merge_request_id", where: "(merge_request_id IS NOT NULL)" - t.index ["pipeline_schedule_id"], name: "index_ci_pipelines_on_pipeline_schedule_id" - t.index ["project_id", "iid"], name: "index_ci_pipelines_on_project_id_and_iid", unique: true, where: "(iid IS NOT NULL)" - t.index ["project_id", "ref", "id"], name: "index_ci_pipelines_on_project_idandrefandiddesc", order: { id: :desc } - t.index ["project_id", "ref", "status", "id"], name: "index_ci_pipelines_on_project_id_and_ref_and_status_and_id" - t.index ["project_id", "sha"], name: "index_ci_pipelines_on_project_id_and_sha" - t.index ["project_id", "source"], name: "index_ci_pipelines_on_project_id_and_source" - t.index ["project_id", "status", "config_source"], name: "index_ci_pipelines_on_project_id_and_status_and_config_source" - t.index ["project_id"], name: "index_ci_pipelines_on_project_id" - t.index ["status"], name: "index_ci_pipelines_on_status" - t.index ["user_id"], name: "index_ci_pipelines_on_user_id" - end - - create_table "ci_runner_namespaces", id: :serial, force: :cascade do |t| - t.integer "runner_id" - t.integer "namespace_id" - t.index ["namespace_id"], name: "index_ci_runner_namespaces_on_namespace_id" - t.index ["runner_id", "namespace_id"], name: "index_ci_runner_namespaces_on_runner_id_and_namespace_id", unique: true - end - - create_table "ci_runner_projects", id: :serial, force: :cascade do |t| - t.integer "runner_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.integer "project_id" - t.index ["project_id"], name: "index_ci_runner_projects_on_project_id" - t.index ["runner_id"], name: "index_ci_runner_projects_on_runner_id" - end - - create_table "ci_runners", id: :serial, force: :cascade do |t| - t.string "token" - t.datetime "created_at" - t.datetime "updated_at" - t.string "description" - t.datetime "contacted_at" - t.boolean "active", default: true, null: false - t.boolean "is_shared", default: false - t.string "name" - t.string "version" - t.string "revision" - t.string "platform" - t.string "architecture" - t.boolean "run_untagged", default: true, null: false - t.boolean "locked", default: false, null: false - t.integer "access_level", default: 0, null: false - t.integer "maximum_timeout" - t.string "ip_address" - t.integer "runner_type", limit: 2, null: false - t.string "token_encrypted" - t.index ["contacted_at"], name: "index_ci_runners_on_contacted_at" - t.index ["is_shared"], name: "index_ci_runners_on_is_shared" - t.index ["locked"], name: "index_ci_runners_on_locked" - t.index ["runner_type"], name: "index_ci_runners_on_runner_type" - t.index ["token"], name: "index_ci_runners_on_token" - end - - create_table "ci_stages", id: :serial, force: :cascade do |t| - t.integer "project_id" - t.integer "pipeline_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "name" - t.integer "status" - t.integer "lock_version" - t.integer "position" - t.index ["pipeline_id", "name"], name: "index_ci_stages_on_pipeline_id_and_name", unique: true - t.index ["pipeline_id", "position"], name: "index_ci_stages_on_pipeline_id_and_position" - t.index ["pipeline_id"], name: "index_ci_stages_on_pipeline_id" - t.index ["project_id"], name: "index_ci_stages_on_project_id" - end - - create_table "ci_trigger_requests", id: :serial, force: :cascade do |t| - t.integer "trigger_id", null: false - t.text "variables" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "commit_id" - t.index ["commit_id"], name: "index_ci_trigger_requests_on_commit_id" - t.index ["trigger_id"], name: "index_ci_trigger_requests_on_trigger_id" - end - - create_table "ci_triggers", id: :serial, force: :cascade do |t| - t.string "token" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "project_id" - t.integer "owner_id" - t.string "description" - t.string "ref" - t.index ["owner_id"], name: "index_ci_triggers_on_owner_id" - t.index ["project_id"], name: "index_ci_triggers_on_project_id" - end - - create_table "ci_variables", id: :serial, force: :cascade do |t| - t.string "key", null: false - t.text "value" - t.text "encrypted_value" - t.string "encrypted_value_salt" - t.string "encrypted_value_iv" - t.integer "project_id", null: false - t.boolean "protected", default: false, null: false - t.string "environment_scope", default: "*", null: false - t.index ["project_id", "key", "environment_scope"], name: "index_ci_variables_on_project_id_and_key_and_environment_scope", unique: true - end - - create_table "cluster_groups", id: :serial, force: :cascade do |t| - t.integer "cluster_id", null: false - t.integer "group_id", null: false - t.index ["cluster_id", "group_id"], name: "index_cluster_groups_on_cluster_id_and_group_id", unique: true - t.index ["group_id"], name: "index_cluster_groups_on_group_id" - end - - create_table "cluster_platforms_kubernetes", id: :serial, force: :cascade do |t| - t.integer "cluster_id", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.text "api_url" - t.text "ca_cert" - t.string "namespace" - t.string "username" - t.text "encrypted_password" - t.string "encrypted_password_iv" - t.text "encrypted_token" - t.string "encrypted_token_iv" - t.integer "authorization_type", limit: 2 - t.index ["cluster_id"], name: "index_cluster_platforms_kubernetes_on_cluster_id", unique: true - end - - create_table "cluster_projects", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.integer "cluster_id", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.index ["cluster_id"], name: "index_cluster_projects_on_cluster_id" - t.index ["project_id"], name: "index_cluster_projects_on_project_id" - end - - create_table "cluster_providers_gcp", id: :serial, force: :cascade do |t| - t.integer "cluster_id", null: false - t.integer "status" - t.integer "num_nodes", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.text "status_reason" - t.string "gcp_project_id", null: false - t.string "zone", null: false - t.string "machine_type" - t.string "operation_id" - t.string "endpoint" - t.text "encrypted_access_token" - t.string "encrypted_access_token_iv" - t.boolean "legacy_abac", default: true, null: false - t.index ["cluster_id"], name: "index_cluster_providers_gcp_on_cluster_id", unique: true - end - - create_table "clusters", id: :serial, force: :cascade do |t| - t.integer "user_id" - t.integer "provider_type" - t.integer "platform_type" - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.boolean "enabled", default: true - t.string "name", null: false - t.string "environment_scope", default: "*", null: false - t.integer "cluster_type", limit: 2, default: 3, null: false - t.index ["enabled"], name: "index_clusters_on_enabled" - t.index ["user_id"], name: "index_clusters_on_user_id" - end - - create_table "clusters_applications_cert_managers", id: :serial, force: :cascade do |t| - t.integer "cluster_id", null: false - t.integer "status", null: false - t.string "version", null: false - t.string "email", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.text "status_reason" - t.index ["cluster_id"], name: "index_clusters_applications_cert_managers_on_cluster_id", unique: true - end - - create_table "clusters_applications_helm", id: :serial, force: :cascade do |t| - t.integer "cluster_id", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "status", null: false - t.string "version", null: false - t.text "status_reason" - t.text "encrypted_ca_key" - t.text "encrypted_ca_key_iv" - t.text "ca_cert" - t.index ["cluster_id"], name: "index_clusters_applications_helm_on_cluster_id", unique: true - end - - create_table "clusters_applications_ingress", id: :serial, force: :cascade do |t| - t.integer "cluster_id", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "status", null: false - t.integer "ingress_type", null: false - t.string "version", null: false - t.string "cluster_ip" - t.text "status_reason" - t.string "external_ip" - t.index ["cluster_id"], name: "index_clusters_applications_ingress_on_cluster_id", unique: true - end - - create_table "clusters_applications_jupyter", id: :serial, force: :cascade do |t| - t.integer "cluster_id", null: false - t.integer "oauth_application_id" - t.integer "status", null: false - t.string "version", null: false - t.string "hostname" - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.text "status_reason" - t.index ["cluster_id"], name: "index_clusters_applications_jupyter_on_cluster_id", unique: true - t.index ["oauth_application_id"], name: "index_clusters_applications_jupyter_on_oauth_application_id" - end - - create_table "clusters_applications_knative", id: :serial, force: :cascade do |t| - t.integer "cluster_id", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "status", null: false - t.string "version", null: false - t.string "hostname" - t.text "status_reason" - t.string "external_ip" - t.index ["cluster_id"], name: "index_clusters_applications_knative_on_cluster_id", unique: true - end - - create_table "clusters_applications_prometheus", id: :serial, force: :cascade do |t| - t.integer "cluster_id", null: false - t.integer "status", null: false - t.string "version", null: false - t.text "status_reason" - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.index ["cluster_id"], name: "index_clusters_applications_prometheus_on_cluster_id", unique: true - end - - create_table "clusters_applications_runners", id: :serial, force: :cascade do |t| - t.integer "cluster_id", null: false - t.integer "runner_id" - t.integer "status", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.string "version", null: false - t.text "status_reason" - t.boolean "privileged", default: true, null: false - t.index ["cluster_id"], name: "index_clusters_applications_runners_on_cluster_id", unique: true - t.index ["runner_id"], name: "index_clusters_applications_runners_on_runner_id" - end - - create_table "clusters_kubernetes_namespaces", force: :cascade do |t| - t.integer "cluster_id", null: false - t.integer "project_id" - t.integer "cluster_project_id" - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.string "encrypted_service_account_token_iv" - t.string "namespace", null: false - t.string "service_account_name" - t.text "encrypted_service_account_token" - t.index ["cluster_id", "namespace"], name: "kubernetes_namespaces_cluster_and_namespace", unique: true - t.index ["cluster_id"], name: "index_clusters_kubernetes_namespaces_on_cluster_id" - t.index ["cluster_project_id"], name: "index_clusters_kubernetes_namespaces_on_cluster_project_id" - t.index ["project_id"], name: "index_clusters_kubernetes_namespaces_on_project_id" - end - - create_table "container_repositories", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.string "name", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["project_id", "name"], name: "index_container_repositories_on_project_id_and_name", unique: true - t.index ["project_id"], name: "index_container_repositories_on_project_id" - end - - create_table "conversational_development_index_metrics", id: :serial, force: :cascade do |t| - t.float "leader_issues", null: false - t.float "instance_issues", null: false - t.float "leader_notes", null: false - t.float "instance_notes", null: false - t.float "leader_milestones", null: false - t.float "instance_milestones", null: false - t.float "leader_boards", null: false - t.float "instance_boards", null: false - t.float "leader_merge_requests", null: false - t.float "instance_merge_requests", null: false - t.float "leader_ci_pipelines", null: false - t.float "instance_ci_pipelines", null: false - t.float "leader_environments", null: false - t.float "instance_environments", null: false - t.float "leader_deployments", null: false - t.float "instance_deployments", null: false - t.float "leader_projects_prometheus_active", null: false - t.float "instance_projects_prometheus_active", null: false - t.float "leader_service_desk_issues", null: false - t.float "instance_service_desk_issues", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.float "percentage_boards", default: 0.0, null: false - t.float "percentage_ci_pipelines", default: 0.0, null: false - t.float "percentage_deployments", default: 0.0, null: false - t.float "percentage_environments", default: 0.0, null: false - t.float "percentage_issues", default: 0.0, null: false - t.float "percentage_merge_requests", default: 0.0, null: false - t.float "percentage_milestones", default: 0.0, null: false - t.float "percentage_notes", default: 0.0, null: false - t.float "percentage_projects_prometheus_active", default: 0.0, null: false - t.float "percentage_service_desk_issues", default: 0.0, null: false - end - - create_table "deploy_keys_projects", id: :serial, force: :cascade do |t| - t.integer "deploy_key_id", null: false - t.integer "project_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "can_push", default: false, null: false - t.index ["project_id"], name: "index_deploy_keys_projects_on_project_id" - end - - create_table "deploy_tokens", id: :serial, force: :cascade do |t| - t.boolean "revoked", default: false - t.boolean "read_repository", default: false, null: false - t.boolean "read_registry", default: false, null: false - t.datetime_with_timezone "expires_at", null: false - t.datetime_with_timezone "created_at", null: false - t.string "name", null: false - t.string "token", null: false - t.index ["token", "expires_at", "id"], name: "index_deploy_tokens_on_token_and_expires_at_and_id", where: "(revoked IS FALSE)" - t.index ["token"], name: "index_deploy_tokens_on_token", unique: true - end - - create_table "deployments", id: :serial, force: :cascade do |t| - t.integer "iid", null: false - t.integer "project_id", null: false - t.integer "environment_id", null: false - t.string "ref", null: false - t.boolean "tag", null: false - t.string "sha", null: false - t.integer "user_id" - t.integer "deployable_id" - t.string "deployable_type" - t.datetime "created_at" - t.datetime "updated_at" - t.string "on_stop" - t.datetime_with_timezone "finished_at" - t.integer "status", limit: 2, null: false - t.index ["created_at"], name: "index_deployments_on_created_at" - t.index ["deployable_type", "deployable_id"], name: "index_deployments_on_deployable_type_and_deployable_id" - t.index ["environment_id", "id"], name: "index_deployments_on_environment_id_and_id" - t.index ["environment_id", "iid", "project_id"], name: "index_deployments_on_environment_id_and_iid_and_project_id" - t.index ["environment_id", "status"], name: "index_deployments_on_environment_id_and_status" - t.index ["id"], name: "partial_index_deployments_for_legacy_successful_deployments", where: "((finished_at IS NULL) AND (status = 2))" - t.index ["project_id", "iid"], name: "index_deployments_on_project_id_and_iid", unique: true - t.index ["project_id", "status", "created_at"], name: "index_deployments_on_project_id_and_status_and_created_at" - t.index ["project_id", "status"], name: "index_deployments_on_project_id_and_status" - end - - create_table "emails", id: :serial, force: :cascade do |t| - t.integer "user_id", null: false - t.string "email", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.string "confirmation_token" - t.datetime_with_timezone "confirmed_at" - t.datetime_with_timezone "confirmation_sent_at" - t.index ["confirmation_token"], name: "index_emails_on_confirmation_token", unique: true - t.index ["email"], name: "index_emails_on_email", unique: true - t.index ["user_id"], name: "index_emails_on_user_id" - end - - create_table "environments", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.string "name", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.string "external_url" - t.string "environment_type" - t.string "state", default: "available", null: false - t.string "slug", null: false - t.index ["project_id", "name"], name: "index_environments_on_project_id_and_name", unique: true - t.index ["project_id", "slug"], name: "index_environments_on_project_id_and_slug", unique: true - end - - create_table "events", id: :serial, force: :cascade do |t| - t.integer "project_id" - t.integer "author_id", null: false - t.integer "target_id" - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "action", limit: 2, null: false - t.string "target_type" - t.index ["action"], name: "index_events_on_action" - t.index ["author_id", "project_id"], name: "index_events_on_author_id_and_project_id" - t.index ["project_id", "created_at"], name: "index_events_on_project_id_and_created_at" - t.index ["project_id", "id"], name: "index_events_on_project_id_and_id" - t.index ["target_type", "target_id"], name: "index_events_on_target_type_and_target_id" - end - - create_table "feature_gates", id: :serial, force: :cascade do |t| - t.string "feature_key", null: false - t.string "key", null: false - t.string "value" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["feature_key", "key", "value"], name: "index_feature_gates_on_feature_key_and_key_and_value", unique: true - end - - create_table "features", id: :serial, force: :cascade do |t| - t.string "key", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["key"], name: "index_features_on_key", unique: true - end - - create_table "fork_network_members", id: :serial, force: :cascade do |t| - t.integer "fork_network_id", null: false - t.integer "project_id", null: false - t.integer "forked_from_project_id" - t.index ["fork_network_id"], name: "index_fork_network_members_on_fork_network_id" - t.index ["forked_from_project_id"], name: "index_fork_network_members_on_forked_from_project_id" - t.index ["project_id"], name: "index_fork_network_members_on_project_id", unique: true - end - - create_table "fork_networks", id: :serial, force: :cascade do |t| - t.integer "root_project_id" - t.string "deleted_root_project_name" - t.index ["root_project_id"], name: "index_fork_networks_on_root_project_id", unique: true - end - - create_table "forked_project_links", id: :serial, force: :cascade do |t| - t.integer "forked_to_project_id", null: false - t.integer "forked_from_project_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.index ["forked_to_project_id"], name: "index_forked_project_links_on_forked_to_project_id", unique: true - end - - create_table "gpg_key_subkeys", id: :serial, force: :cascade do |t| - t.integer "gpg_key_id", null: false - t.binary "keyid" - t.binary "fingerprint" - t.index ["fingerprint"], name: "index_gpg_key_subkeys_on_fingerprint", unique: true - t.index ["gpg_key_id"], name: "index_gpg_key_subkeys_on_gpg_key_id" - t.index ["keyid"], name: "index_gpg_key_subkeys_on_keyid", unique: true - end - - create_table "gpg_keys", id: :serial, force: :cascade do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "user_id" - t.binary "primary_keyid" - t.binary "fingerprint" - t.text "key" - t.index ["fingerprint"], name: "index_gpg_keys_on_fingerprint", unique: true - t.index ["primary_keyid"], name: "index_gpg_keys_on_primary_keyid", unique: true - t.index ["user_id"], name: "index_gpg_keys_on_user_id" - end - - create_table "gpg_signatures", id: :serial, force: :cascade do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "project_id" - t.integer "gpg_key_id" - t.binary "commit_sha" - t.binary "gpg_key_primary_keyid" - t.text "gpg_key_user_name" - t.text "gpg_key_user_email" - t.integer "verification_status", limit: 2, default: 0, null: false - t.integer "gpg_key_subkey_id" - t.index ["commit_sha"], name: "index_gpg_signatures_on_commit_sha", unique: true - t.index ["gpg_key_id"], name: "index_gpg_signatures_on_gpg_key_id" - t.index ["gpg_key_primary_keyid"], name: "index_gpg_signatures_on_gpg_key_primary_keyid" - t.index ["gpg_key_subkey_id"], name: "index_gpg_signatures_on_gpg_key_subkey_id" - t.index ["project_id"], name: "index_gpg_signatures_on_project_id" - end - - create_table "group_custom_attributes", id: :serial, force: :cascade do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "group_id", null: false - t.string "key", null: false - t.string "value", null: false - t.index ["group_id", "key"], name: "index_group_custom_attributes_on_group_id_and_key", unique: true - t.index ["key", "value"], name: "index_group_custom_attributes_on_key_and_value" - end - - create_table "group_group_links", force: :cascade do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.bigint "shared_group_id", null: false - t.bigint "shared_with_group_id", null: false - t.date "expires_at" - t.integer "group_access", limit: 2, default: 30, null: false - t.index ["shared_group_id", "shared_with_group_id"], name: "index_group_group_links_on_shared_group_and_shared_with_group", unique: true - t.index ["shared_with_group_id"], name: "index_group_group_links_on_shared_with_group_id" - end - - create_table "identities", id: :serial, force: :cascade do |t| - t.string "extern_uid" - t.string "provider" - t.integer "user_id" - t.datetime "created_at" - t.datetime "updated_at" - t.index ["user_id"], name: "index_identities_on_user_id" - end - - create_table "import_export_uploads", id: :serial, force: :cascade do |t| - t.datetime_with_timezone "updated_at", null: false - t.integer "project_id" - t.text "import_file" - t.text "export_file" - t.index ["project_id"], name: "index_import_export_uploads_on_project_id" - t.index ["updated_at"], name: "index_import_export_uploads_on_updated_at" - end - - create_table "internal_ids", force: :cascade do |t| - t.integer "project_id" - t.integer "usage", null: false - t.integer "last_value", null: false - t.integer "namespace_id" - t.index ["namespace_id"], name: "index_internal_ids_on_namespace_id" - t.index ["project_id"], name: "index_internal_ids_on_project_id" - t.index ["usage", "namespace_id"], name: "index_internal_ids_on_usage_and_namespace_id", unique: true, where: "(namespace_id IS NOT NULL)" - t.index ["usage", "project_id"], name: "index_internal_ids_on_usage_and_project_id", unique: true, where: "(project_id IS NOT NULL)" - end - - create_table "issue_assignees", id: false, force: :cascade do |t| - t.integer "user_id", null: false - t.integer "issue_id", null: false - t.index ["issue_id", "user_id"], name: "index_issue_assignees_on_issue_id_and_user_id", unique: true - t.index ["user_id"], name: "index_issue_assignees_on_user_id" - end - - create_table "issue_metrics", id: :serial, force: :cascade do |t| - t.integer "issue_id", null: false - t.datetime "first_mentioned_in_commit_at" - t.datetime "first_associated_with_milestone_at" - t.datetime "first_added_to_board_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["issue_id"], name: "index_issue_metrics" - end - - create_table "issues", id: :serial, force: :cascade do |t| - t.string "title" - t.integer "author_id" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.text "description" - t.integer "milestone_id" - t.string "state" - t.integer "iid" - t.integer "updated_by_id" - t.boolean "confidential", default: false, null: false - t.date "due_date" - t.integer "moved_to_id" - t.integer "lock_version" - t.text "title_html" - t.text "description_html" - t.integer "time_estimate" - t.integer "relative_position" - t.integer "cached_markdown_version" - t.datetime "last_edited_at" - t.integer "last_edited_by_id" - t.boolean "discussion_locked" - t.datetime_with_timezone "closed_at" - t.integer "closed_by_id" - t.index ["author_id"], name: "index_issues_on_author_id" - t.index ["closed_by_id"], name: "index_issues_on_closed_by_id" - t.index ["confidential"], name: "index_issues_on_confidential" - t.index ["description"], name: "index_issues_on_description_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["milestone_id"], name: "index_issues_on_milestone_id" - t.index ["moved_to_id"], name: "index_issues_on_moved_to_id", where: "(moved_to_id IS NOT NULL)" - t.index ["project_id", "created_at", "id", "state"], name: "index_issues_on_project_id_and_created_at_and_id_and_state" - t.index ["project_id", "due_date", "id", "state"], name: "idx_issues_on_project_id_and_due_date_and_id_and_state_partial", where: "(due_date IS NOT NULL)" - t.index ["project_id", "iid"], name: "index_issues_on_project_id_and_iid", unique: true - t.index ["project_id", "updated_at", "id", "state"], name: "index_issues_on_project_id_and_updated_at_and_id_and_state" - t.index ["relative_position"], name: "index_issues_on_relative_position" - t.index ["state"], name: "index_issues_on_state" - t.index ["title"], name: "index_issues_on_title_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["updated_at"], name: "index_issues_on_updated_at" - t.index ["updated_by_id"], name: "index_issues_on_updated_by_id", where: "(updated_by_id IS NOT NULL)" - end - - create_table "keys", id: :serial, force: :cascade do |t| - t.integer "user_id" - t.datetime "created_at" - t.datetime "updated_at" - t.text "key" - t.string "title" - t.string "type" - t.string "fingerprint" - t.boolean "public", default: false, null: false - t.datetime "last_used_at" - t.index ["fingerprint"], name: "index_keys_on_fingerprint", unique: true - t.index ["user_id"], name: "index_keys_on_user_id" - end - - create_table "label_links", id: :serial, force: :cascade do |t| - t.integer "label_id" - t.integer "target_id" - t.string "target_type" - t.datetime "created_at" - t.datetime "updated_at" - t.index ["label_id"], name: "index_label_links_on_label_id" - t.index ["target_id", "target_type"], name: "index_label_links_on_target_id_and_target_type" - end - - create_table "label_priorities", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.integer "label_id", null: false - t.integer "priority", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["label_id"], name: "index_label_priorities_on_label_id" - t.index ["priority"], name: "index_label_priorities_on_priority" - t.index ["project_id", "label_id"], name: "index_label_priorities_on_project_id_and_label_id", unique: true - end - - create_table "labels", id: :serial, force: :cascade do |t| - t.string "title" - t.string "color" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "template", default: false - t.string "description" - t.text "description_html" - t.string "type" - t.integer "group_id" - t.integer "cached_markdown_version" - t.index ["group_id", "project_id", "title"], name: "index_labels_on_group_id_and_project_id_and_title", unique: true - t.index ["project_id"], name: "index_labels_on_project_id" - t.index ["template"], name: "index_labels_on_template", where: "template" - t.index ["title"], name: "index_labels_on_title" - t.index ["type", "project_id"], name: "index_labels_on_type_and_project_id" - end - - create_table "lfs_file_locks", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.integer "user_id", null: false - t.datetime "created_at", null: false - t.string "path", limit: 511 - t.index ["project_id", "path"], name: "index_lfs_file_locks_on_project_id_and_path", unique: true - t.index ["user_id"], name: "index_lfs_file_locks_on_user_id" - end - - create_table "lfs_objects", id: :serial, force: :cascade do |t| - t.string "oid", null: false - t.bigint "size", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.string "file" - t.integer "file_store" - t.index ["file_store"], name: "index_lfs_objects_on_file_store" - t.index ["oid"], name: "index_lfs_objects_on_oid", unique: true - end - - create_table "lfs_objects_projects", id: :serial, force: :cascade do |t| - t.integer "lfs_object_id", null: false - t.integer "project_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.index ["project_id"], name: "index_lfs_objects_projects_on_project_id" - end - - create_table "lists", id: :serial, force: :cascade do |t| - t.integer "board_id", null: false - t.integer "label_id" - t.integer "list_type", default: 1, null: false - t.integer "position" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["board_id", "label_id"], name: "index_lists_on_board_id_and_label_id", unique: true - t.index ["label_id"], name: "index_lists_on_label_id" - t.index ["list_type"], name: "index_lists_on_list_type" - end - - create_table "members", id: :serial, force: :cascade do |t| - t.integer "access_level", null: false - t.integer "source_id", null: false - t.string "source_type", null: false - t.integer "user_id" - t.integer "notification_level", null: false - t.string "type" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "created_by_id" - t.string "invite_email" - t.string "invite_token" - t.datetime "invite_accepted_at" - t.datetime "requested_at" - t.date "expires_at" - t.index ["access_level"], name: "index_members_on_access_level" - t.index ["invite_token"], name: "index_members_on_invite_token", unique: true - t.index ["requested_at"], name: "index_members_on_requested_at" - t.index ["source_id", "source_type"], name: "index_members_on_source_id_and_source_type" - t.index ["user_id"], name: "index_members_on_user_id" - end - - create_table "merge_request_diff_commits", id: false, force: :cascade do |t| - t.datetime_with_timezone "authored_date" - t.datetime_with_timezone "committed_date" - t.integer "merge_request_diff_id", null: false - t.integer "relative_order", null: false - t.binary "sha", null: false - t.text "author_name" - t.text "author_email" - t.text "committer_name" - t.text "committer_email" - t.text "message" - t.index ["merge_request_diff_id", "relative_order"], name: "index_merge_request_diff_commits_on_mr_diff_id_and_order", unique: true - t.index ["sha"], name: "index_merge_request_diff_commits_on_sha" - end - - create_table "merge_request_diff_files", id: false, force: :cascade do |t| - t.integer "merge_request_diff_id", null: false - t.integer "relative_order", null: false - t.boolean "new_file", null: false - t.boolean "renamed_file", null: false - t.boolean "deleted_file", null: false - t.boolean "too_large", null: false - t.string "a_mode", null: false - t.string "b_mode", null: false - t.text "new_path", null: false - t.text "old_path", null: false - t.text "diff", null: false - t.boolean "binary" - t.index ["merge_request_diff_id", "relative_order"], name: "index_merge_request_diff_files_on_mr_diff_id_and_order", unique: true - end - - create_table "merge_request_diffs", id: :serial, force: :cascade do |t| - t.string "state" - t.integer "merge_request_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.string "base_commit_sha" - t.string "real_size" - t.string "head_commit_sha" - t.string "start_commit_sha" - t.integer "commits_count" - t.index ["merge_request_id", "id"], name: "index_merge_request_diffs_on_merge_request_id_and_id" - end - - create_table "merge_request_metrics", id: :serial, force: :cascade do |t| - t.integer "merge_request_id", null: false - t.datetime "latest_build_started_at" - t.datetime "latest_build_finished_at" - t.datetime "first_deployed_to_production_at" - t.datetime "merged_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "pipeline_id" - t.integer "merged_by_id" - t.integer "latest_closed_by_id" - t.datetime_with_timezone "latest_closed_at" - t.index ["first_deployed_to_production_at"], name: "index_merge_request_metrics_on_first_deployed_to_production_at" - t.index ["latest_closed_by_id"], name: "index_merge_request_metrics_on_latest_closed_by_id" - t.index ["merge_request_id"], name: "index_merge_request_metrics" - t.index ["merged_by_id"], name: "index_merge_request_metrics_on_merged_by_id" - t.index ["pipeline_id"], name: "index_merge_request_metrics_on_pipeline_id" - end - - create_table "merge_requests", id: :serial, force: :cascade do |t| - t.string "target_branch", null: false - t.string "source_branch", null: false - t.integer "source_project_id" - t.integer "author_id" - t.integer "assignee_id" - t.string "title" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "milestone_id" - t.string "state", default: "opened", null: false - t.string "merge_status", default: "unchecked", null: false - t.integer "target_project_id", null: false - t.integer "iid" - t.text "description" - t.integer "updated_by_id" - t.text "merge_error" - t.text "merge_params" - t.boolean "merge_when_pipeline_succeeds", default: false, null: false - t.integer "merge_user_id" - t.string "merge_commit_sha" - t.string "rebase_commit_sha" - t.string "in_progress_merge_commit_sha" - t.integer "lock_version" - t.text "title_html" - t.text "description_html" - t.integer "time_estimate" - t.integer "cached_markdown_version" - t.datetime "last_edited_at" - t.integer "last_edited_by_id" - t.integer "head_pipeline_id" - t.string "merge_jid" - t.boolean "discussion_locked" - t.integer "latest_merge_request_diff_id" - t.boolean "allow_maintainer_to_push" - t.boolean "squash", default: false, null: false - t.index ["assignee_id"], name: "index_merge_requests_on_assignee_id" - t.index ["author_id"], name: "index_merge_requests_on_author_id" - t.index ["created_at"], name: "index_merge_requests_on_created_at" - t.index ["description"], name: "index_merge_requests_on_description_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["head_pipeline_id"], name: "index_merge_requests_on_head_pipeline_id" - t.index ["id", "merge_jid"], name: "index_merge_requests_on_id_and_merge_jid", where: "((merge_jid IS NOT NULL) AND ((state)::text = 'locked'::text))" - t.index ["latest_merge_request_diff_id"], name: "index_merge_requests_on_latest_merge_request_diff_id" - t.index ["merge_user_id"], name: "index_merge_requests_on_merge_user_id", where: "(merge_user_id IS NOT NULL)" - t.index ["milestone_id"], name: "index_merge_requests_on_milestone_id" - t.index ["source_branch"], name: "index_merge_requests_on_source_branch" - t.index ["source_project_id", "source_branch"], name: "index_merge_requests_on_source_project_and_branch_state_opened", where: "((state)::text = 'opened'::text)" - t.index ["source_project_id", "source_branch"], name: "index_merge_requests_on_source_project_id_and_source_branch" - t.index ["target_branch"], name: "index_merge_requests_on_target_branch" - t.index ["target_project_id", "iid"], name: "index_merge_requests_on_target_project_id_and_iid", unique: true - t.index ["target_project_id", "iid"], name: "index_merge_requests_on_target_project_id_and_iid_opened", where: "((state)::text = 'opened'::text)" - t.index ["target_project_id", "merge_commit_sha", "id"], name: "index_merge_requests_on_tp_id_and_merge_commit_sha_and_id" - t.index ["title"], name: "index_merge_requests_on_title" - t.index ["title"], name: "index_merge_requests_on_title_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["updated_by_id"], name: "index_merge_requests_on_updated_by_id", where: "(updated_by_id IS NOT NULL)" - end - - create_table "merge_requests_closing_issues", id: :serial, force: :cascade do |t| - t.integer "merge_request_id", null: false - t.integer "issue_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["issue_id"], name: "index_merge_requests_closing_issues_on_issue_id" - t.index ["merge_request_id"], name: "index_merge_requests_closing_issues_on_merge_request_id" - end - - create_table "milestones", id: :serial, force: :cascade do |t| - t.string "title", null: false - t.integer "project_id" - t.text "description" - t.date "due_date" - t.datetime "created_at" - t.datetime "updated_at" - t.string "state" - t.integer "iid" - t.text "title_html" - t.text "description_html" - t.date "start_date" - t.integer "cached_markdown_version" - t.integer "group_id" - t.index ["description"], name: "index_milestones_on_description_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["due_date"], name: "index_milestones_on_due_date" - t.index ["group_id"], name: "index_milestones_on_group_id" - t.index ["project_id", "iid"], name: "index_milestones_on_project_id_and_iid", unique: true - t.index ["title"], name: "index_milestones_on_title" - t.index ["title"], name: "index_milestones_on_title_trigram", opclass: :gin_trgm_ops, using: :gin - end - - create_table "namespaces", id: :serial, force: :cascade do |t| - t.string "name", null: false - t.string "path", null: false - t.integer "owner_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "type" - t.string "description", default: "", null: false - t.string "avatar" - t.boolean "share_with_group_lock", default: false - t.integer "visibility_level", default: 20, null: false - t.boolean "request_access_enabled", default: false, null: false - t.text "description_html" - t.boolean "lfs_enabled" - t.integer "parent_id" - t.boolean "require_two_factor_authentication", default: false, null: false - t.integer "two_factor_grace_period", default: 48, null: false - t.integer "cached_markdown_version" - t.string "runners_token" - t.integer "project_creation_level" - t.string "runners_token_encrypted" - t.index ["created_at"], name: "index_namespaces_on_created_at" - t.index ["name", "parent_id"], name: "index_namespaces_on_name_and_parent_id", unique: true - t.index ["name"], name: "index_namespaces_on_name_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["owner_id"], name: "index_namespaces_on_owner_id" - t.index ["parent_id", "id"], name: "index_namespaces_on_parent_id_and_id", unique: true - t.index ["path"], name: "index_namespaces_on_path" - t.index ["path"], name: "index_namespaces_on_path_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["require_two_factor_authentication"], name: "index_namespaces_on_require_two_factor_authentication" - t.index ["runners_token"], name: "index_namespaces_on_runners_token", unique: true - t.index ["type"], name: "index_namespaces_on_type" - end - - create_table "note_diff_files", id: :serial, force: :cascade do |t| - t.integer "diff_note_id", null: false - t.text "diff", null: false - t.boolean "new_file", null: false - t.boolean "renamed_file", null: false - t.boolean "deleted_file", null: false - t.string "a_mode", null: false - t.string "b_mode", null: false - t.text "new_path", null: false - t.text "old_path", null: false - t.index ["diff_note_id"], name: "index_note_diff_files_on_diff_note_id", unique: true - end - - create_table "notes", id: :serial, force: :cascade do |t| - t.text "note" - t.string "noteable_type" - t.integer "author_id" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "project_id" - t.string "attachment" - t.string "line_code" - t.string "commit_id" - t.integer "noteable_id" - t.boolean "system", default: false, null: false - t.text "st_diff" - t.integer "updated_by_id" - t.string "type" - t.text "position" - t.text "original_position" - t.datetime "resolved_at" - t.integer "resolved_by_id" - t.string "discussion_id" - t.text "note_html" - t.integer "cached_markdown_version" - t.text "change_position" - t.boolean "resolved_by_push" - t.index ["author_id"], name: "index_notes_on_author_id" - t.index ["commit_id"], name: "index_notes_on_commit_id" - t.index ["created_at"], name: "index_notes_on_created_at" - t.index ["discussion_id"], name: "index_notes_on_discussion_id" - t.index ["line_code"], name: "index_notes_on_line_code" - t.index ["note"], name: "index_notes_on_note_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["noteable_id", "noteable_type"], name: "index_notes_on_noteable_id_and_noteable_type" - t.index ["noteable_type"], name: "index_notes_on_noteable_type" - t.index ["project_id", "noteable_type"], name: "index_notes_on_project_id_and_noteable_type" - end - - create_table "notification_settings", id: :serial, force: :cascade do |t| - t.integer "user_id", null: false - t.string "source_type" - t.integer "source_id" - t.integer "level", default: 0, null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.boolean "new_note" - t.boolean "new_issue" - t.boolean "reopen_issue" - t.boolean "close_issue" - t.boolean "reassign_issue" - t.boolean "new_merge_request" - t.boolean "reopen_merge_request" - t.boolean "close_merge_request" - t.boolean "reassign_merge_request" - t.boolean "merge_merge_request" - t.boolean "failed_pipeline" - t.boolean "success_pipeline" - t.boolean "push_to_merge_request" - t.boolean "issue_due" - t.index ["source_id", "source_type"], name: "index_notification_settings_on_source_id_and_source_type" - t.index ["user_id", "source_id", "source_type"], name: "index_notifications_on_user_id_and_source_id_and_source_type", unique: true - t.index ["user_id"], name: "index_notification_settings_on_user_id" - end - - create_table "oauth_access_grants", id: :serial, force: :cascade do |t| - t.integer "resource_owner_id", null: false - t.integer "application_id", null: false - t.string "token", null: false - t.integer "expires_in", null: false - t.text "redirect_uri", null: false - t.datetime "created_at", null: false - t.datetime "revoked_at" - t.string "scopes" - t.index ["token"], name: "index_oauth_access_grants_on_token", unique: true - end - - create_table "oauth_access_tokens", id: :serial, force: :cascade do |t| - t.integer "resource_owner_id" - t.integer "application_id" - t.string "token", null: false - t.string "refresh_token" - t.integer "expires_in" - t.datetime "revoked_at" - t.datetime "created_at", null: false - t.string "scopes" - t.index ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true - t.index ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id" - t.index ["token"], name: "index_oauth_access_tokens_on_token", unique: true - end - - create_table "oauth_applications", id: :serial, force: :cascade do |t| - t.string "name", null: false - t.string "uid", null: false - t.string "secret", null: false - t.text "redirect_uri", null: false - t.string "scopes", default: "", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.integer "owner_id" - t.string "owner_type" - t.boolean "trusted", default: false, null: false - t.index ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type" - t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true - end - - create_table "oauth_openid_requests", id: :serial, force: :cascade do |t| - t.integer "access_grant_id", null: false - t.string "nonce", null: false - t.index ["access_grant_id"], name: "index_oauth_openid_requests_on_access_grant_id" - end - - create_table "pages_domains", id: :serial, force: :cascade do |t| - t.integer "project_id" - t.text "certificate" - t.text "encrypted_key" - t.string "encrypted_key_iv" - t.string "encrypted_key_salt" - t.string "domain" - t.datetime_with_timezone "verified_at" - t.string "verification_code", null: false - t.datetime_with_timezone "enabled_until" - t.index ["domain"], name: "index_pages_domains_on_domain", unique: true - t.index ["project_id", "enabled_until"], name: "index_pages_domains_on_project_id_and_enabled_until" - t.index ["project_id"], name: "index_pages_domains_on_project_id" - t.index ["verified_at", "enabled_until"], name: "index_pages_domains_on_verified_at_and_enabled_until" - t.index ["verified_at"], name: "index_pages_domains_on_verified_at" - end - - create_table "personal_access_tokens", id: :serial, force: :cascade do |t| - t.integer "user_id", null: false - t.string "name", null: false - t.boolean "revoked", default: false - t.date "expires_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "scopes", default: "--- []\n", null: false - t.boolean "impersonation", default: false, null: false - t.string "token_digest" - t.index ["token_digest"], name: "index_personal_access_tokens_on_token_digest", unique: true - t.index ["user_id"], name: "index_personal_access_tokens_on_user_id" - end - - create_table "pool_repositories", force: :cascade do |t| - t.integer "shard_id", null: false - t.string "disk_path" - t.string "state" - t.integer "source_project_id" - t.index ["disk_path"], name: "index_pool_repositories_on_disk_path", unique: true - t.index ["shard_id"], name: "index_pool_repositories_on_shard_id" - t.index ["source_project_id"], name: "index_pool_repositories_on_source_project_id", unique: true - end - - create_table "programming_languages", id: :serial, force: :cascade do |t| - t.string "name", null: false - t.string "color", null: false - t.datetime_with_timezone "created_at", null: false - t.index ["name"], name: "index_programming_languages_on_name", unique: true - end - - create_table "project_authorizations", id: false, force: :cascade do |t| - t.integer "user_id", null: false - t.integer "project_id", null: false - t.integer "access_level", null: false - t.index ["project_id"], name: "index_project_authorizations_on_project_id" - t.index ["user_id", "project_id", "access_level"], name: "index_project_authorizations_on_user_id_project_id_access_level", unique: true - end - - create_table "project_auto_devops", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.boolean "enabled" - t.string "domain" - t.integer "deploy_strategy", default: 0, null: false - t.index ["project_id"], name: "index_project_auto_devops_on_project_id", unique: true - end - - create_table "project_ci_cd_settings", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.boolean "group_runners_enabled", default: true, null: false - t.index ["project_id"], name: "index_project_ci_cd_settings_on_project_id", unique: true - end - - create_table "project_custom_attributes", id: :serial, force: :cascade do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "project_id", null: false - t.string "key", null: false - t.string "value", null: false - t.index ["key", "value"], name: "index_project_custom_attributes_on_key_and_value" - t.index ["project_id", "key"], name: "index_project_custom_attributes_on_project_id_and_key", unique: true - end - - create_table "project_daily_statistics", force: :cascade do |t| - t.integer "project_id", null: false - t.integer "fetch_count", null: false - t.date "date" - t.index ["project_id", "date"], name: "index_project_daily_statistics_on_project_id_and_date", unique: true, order: { date: :desc } - end - - create_table "project_deploy_tokens", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.integer "deploy_token_id", null: false - t.datetime_with_timezone "created_at", null: false - t.index ["deploy_token_id"], name: "index_project_deploy_tokens_on_deploy_token_id" - t.index ["project_id", "deploy_token_id"], name: "index_project_deploy_tokens_on_project_id_and_deploy_token_id", unique: true - end - - create_table "project_error_tracking_settings", primary_key: "project_id", id: :integer, default: nil, force: :cascade do |t| - t.boolean "enabled", default: true, null: false - t.string "api_url", null: false - t.string "encrypted_token" - t.string "encrypted_token_iv" - end - - create_table "project_features", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.integer "merge_requests_access_level" - t.integer "issues_access_level" - t.integer "wiki_access_level" - t.integer "snippets_access_level", default: 20, null: false - t.integer "builds_access_level" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "repository_access_level", default: 20, null: false - t.integer "pages_access_level", default: 20, null: false - t.index ["project_id"], name: "index_project_features_on_project_id", unique: true - end - - create_table "project_group_links", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.integer "group_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.integer "group_access", default: 30, null: false - t.date "expires_at" - t.index ["group_id"], name: "index_project_group_links_on_group_id" - t.index ["project_id"], name: "index_project_group_links_on_project_id" - end - - create_table "project_import_data", id: :serial, force: :cascade do |t| - t.integer "project_id" - t.text "data" - t.text "encrypted_credentials" - t.string "encrypted_credentials_iv" - t.string "encrypted_credentials_salt" - t.index ["project_id"], name: "index_project_import_data_on_project_id" - end - - create_table "project_mirror_data", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.string "status" - t.string "jid" - t.text "last_error" - t.index ["jid"], name: "index_project_mirror_data_on_jid" - t.index ["project_id"], name: "index_project_mirror_data_on_project_id", unique: true - t.index ["status"], name: "index_project_mirror_data_on_status" - end - - create_table "project_repositories", force: :cascade do |t| - t.integer "shard_id", null: false - t.string "disk_path", null: false - t.integer "project_id", null: false - t.index ["disk_path"], name: "index_project_repositories_on_disk_path", unique: true - t.index ["project_id"], name: "index_project_repositories_on_project_id", unique: true - t.index ["shard_id"], name: "index_project_repositories_on_shard_id" - end - - create_table "project_statistics", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.integer "namespace_id", null: false - t.bigint "commit_count", default: 0, null: false - t.bigint "storage_size", default: 0, null: false - t.bigint "repository_size", default: 0, null: false - t.bigint "lfs_objects_size", default: 0, null: false - t.bigint "build_artifacts_size", default: 0, null: false - t.index ["namespace_id"], name: "index_project_statistics_on_namespace_id" - t.index ["project_id"], name: "index_project_statistics_on_project_id", unique: true - end - - create_table "projects", id: :serial, force: :cascade do |t| - t.string "name" - t.string "path" - t.text "description" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "creator_id" - t.integer "namespace_id", null: false - t.datetime "last_activity_at" - t.string "import_url" - t.integer "visibility_level", default: 0, null: false - t.boolean "archived", default: false, null: false - t.string "avatar" - t.string "import_status" - t.integer "star_count", default: 0, null: false - t.boolean "merge_requests_rebase_enabled", default: false, null: false - t.string "import_type" - t.string "import_source" - t.boolean "merge_requests_ff_only_enabled", default: false, null: false - t.text "import_error" - t.integer "ci_id" - t.boolean "shared_runners_enabled", default: true, null: false - t.string "runners_token" - t.string "build_coverage_regex" - t.boolean "build_allow_git_fetch", default: true, null: false - t.integer "build_timeout", default: 3600, null: false - t.boolean "pending_delete", default: false - t.boolean "public_builds", default: true, null: false - t.boolean "last_repository_check_failed" - t.datetime "last_repository_check_at" - t.boolean "container_registry_enabled" - t.boolean "only_allow_merge_if_pipeline_succeeds", default: false, null: false - t.boolean "has_external_issue_tracker" - t.string "repository_storage", default: "default", null: false - t.boolean "repository_read_only" - t.boolean "request_access_enabled", default: false, null: false - t.boolean "has_external_wiki" - t.string "ci_config_path" - t.boolean "lfs_enabled" - t.text "description_html" - t.boolean "only_allow_merge_if_all_discussions_are_resolved" - t.boolean "printing_merge_request_link_enabled", default: true, null: false - t.integer "auto_cancel_pending_pipelines", default: 1, null: false - t.string "import_jid" - t.integer "cached_markdown_version" - t.text "delete_error" - t.datetime "last_repository_updated_at" - t.integer "storage_version", limit: 2 - t.boolean "resolve_outdated_diff_discussions" - t.string "external_authorization_classification_label" - t.integer "jobs_cache_index" - t.boolean "pages_https_only", default: true - t.boolean "remote_mirror_available_overridden" - t.bigint "pool_repository_id" - t.string "runners_token_encrypted" - t.string "bfg_object_map" - t.index "lower((name)::text)", name: "index_projects_on_lower_name" - t.index ["ci_id"], name: "index_projects_on_ci_id" - t.index ["created_at"], name: "index_projects_on_created_at" - t.index ["creator_id"], name: "index_projects_on_creator_id" - t.index ["description"], name: "index_projects_on_description_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["id"], name: "index_projects_on_id_partial_for_visibility", unique: true, where: "(visibility_level = ANY (ARRAY[10, 20]))" - t.index ["last_activity_at"], name: "index_projects_on_last_activity_at" - t.index ["last_repository_check_at"], name: "index_projects_on_last_repository_check_at", where: "(last_repository_check_at IS NOT NULL)" - t.index ["last_repository_check_failed"], name: "index_projects_on_last_repository_check_failed" - t.index ["last_repository_updated_at"], name: "index_projects_on_last_repository_updated_at" - t.index ["name"], name: "index_projects_on_name_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["namespace_id"], name: "index_projects_on_namespace_id" - t.index ["path"], name: "index_projects_on_path" - t.index ["path"], name: "index_projects_on_path_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["pending_delete"], name: "index_projects_on_pending_delete" - t.index ["pool_repository_id"], name: "index_projects_on_pool_repository_id", where: "(pool_repository_id IS NOT NULL)" - t.index ["repository_storage", "created_at"], name: "idx_project_repository_check_partial", where: "(last_repository_check_at IS NULL)" - t.index ["repository_storage"], name: "index_projects_on_repository_storage" - t.index ["runners_token"], name: "index_projects_on_runners_token" - t.index ["star_count"], name: "index_projects_on_star_count" - t.index ["visibility_level"], name: "index_projects_on_visibility_level" - end - - create_table "prometheus_metrics", id: :serial, force: :cascade do |t| - t.integer "project_id" - t.string "title", null: false - t.string "query", null: false - t.string "y_label" - t.string "unit" - t.string "legend" - t.integer "group", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.boolean "common", default: false, null: false - t.string "identifier" - t.index ["common"], name: "index_prometheus_metrics_on_common" - t.index ["group"], name: "index_prometheus_metrics_on_group" - t.index ["identifier"], name: "index_prometheus_metrics_on_identifier", unique: true - t.index ["project_id"], name: "index_prometheus_metrics_on_project_id" - end - - create_table "protected_branch_merge_access_levels", id: :serial, force: :cascade do |t| - t.integer "protected_branch_id", null: false - t.integer "access_level", default: 40, null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["protected_branch_id"], name: "index_protected_branch_merge_access" - end - - create_table "protected_branch_push_access_levels", id: :serial, force: :cascade do |t| - t.integer "protected_branch_id", null: false - t.integer "access_level", default: 40, null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["protected_branch_id"], name: "index_protected_branch_push_access" - end - - create_table "protected_branches", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.string "name", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.index ["project_id"], name: "index_protected_branches_on_project_id" - end - - create_table "protected_tag_create_access_levels", id: :serial, force: :cascade do |t| - t.integer "protected_tag_id", null: false - t.integer "access_level", default: 40 - t.integer "user_id" - t.integer "group_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["group_id"], name: "index_protected_tag_create_access_levels_on_group_id" - t.index ["protected_tag_id"], name: "index_protected_tag_create_access" - t.index ["user_id"], name: "index_protected_tag_create_access_levels_on_user_id" - end - - create_table "protected_tags", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.string "name", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["project_id", "name"], name: "index_protected_tags_on_project_id_and_name", unique: true - t.index ["project_id"], name: "index_protected_tags_on_project_id" - end - - create_table "push_event_payloads", id: false, force: :cascade do |t| - t.bigint "commit_count", null: false - t.integer "event_id", null: false - t.integer "action", limit: 2, null: false - t.integer "ref_type", limit: 2, null: false - t.binary "commit_from" - t.binary "commit_to" - t.text "ref" - t.string "commit_title", limit: 70 - t.index ["event_id"], name: "index_push_event_payloads_on_event_id", unique: true - end - - create_table "redirect_routes", id: :serial, force: :cascade do |t| - t.integer "source_id", null: false - t.string "source_type", null: false - t.string "path", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index "lower((path)::text) varchar_pattern_ops", name: "index_redirect_routes_on_path_unique_text_pattern_ops", unique: true - t.index ["path"], name: "index_redirect_routes_on_path", unique: true - t.index ["source_type", "source_id"], name: "index_redirect_routes_on_source_type_and_source_id" - end - - create_table "release_links", force: :cascade do |t| - t.integer "release_id", null: false - t.string "url", null: false - t.string "name", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.index ["release_id", "name"], name: "index_release_links_on_release_id_and_name", unique: true - t.index ["release_id", "url"], name: "index_release_links_on_release_id_and_url", unique: true - end - - create_table "releases", id: :serial, force: :cascade do |t| - t.string "tag" - t.text "description" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.text "description_html" - t.integer "cached_markdown_version" - t.integer "author_id" - t.string "name" - t.string "sha" - t.index ["author_id"], name: "index_releases_on_author_id" - t.index ["project_id", "tag"], name: "index_releases_on_project_id_and_tag" - t.index ["project_id"], name: "index_releases_on_project_id" - end - - create_table "remote_mirrors", id: :serial, force: :cascade do |t| - t.integer "project_id" - t.string "url" - t.boolean "enabled", default: false - t.string "update_status" - t.datetime "last_update_at" - t.datetime "last_successful_update_at" - t.datetime "last_update_started_at" - t.string "last_error" - t.boolean "only_protected_branches", default: false, null: false - t.string "remote_name" - t.text "encrypted_credentials" - t.string "encrypted_credentials_iv" - t.string "encrypted_credentials_salt" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["last_successful_update_at"], name: "index_remote_mirrors_on_last_successful_update_at" - t.index ["project_id"], name: "index_remote_mirrors_on_project_id" - end - - create_table "repository_languages", id: false, force: :cascade do |t| - t.integer "project_id", null: false - t.integer "programming_language_id", null: false - t.float "share", null: false - t.index ["project_id", "programming_language_id"], name: "index_repository_languages_on_project_and_languages_id", unique: true - end - - create_table "resource_label_events", force: :cascade do |t| - t.integer "action", null: false - t.integer "issue_id" - t.integer "merge_request_id" - t.integer "label_id" - t.integer "user_id" - t.datetime_with_timezone "created_at", null: false - t.integer "cached_markdown_version" - t.text "reference" - t.text "reference_html" - t.index ["issue_id"], name: "index_resource_label_events_on_issue_id" - t.index ["label_id"], name: "index_resource_label_events_on_label_id" - t.index ["merge_request_id"], name: "index_resource_label_events_on_merge_request_id" - t.index ["user_id"], name: "index_resource_label_events_on_user_id" - end - - create_table "routes", id: :serial, force: :cascade do |t| - t.integer "source_id", null: false - t.string "source_type", null: false - t.string "path", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.string "name" - t.index ["path"], name: "index_routes_on_path", unique: true - t.index ["path"], name: "index_routes_on_path_text_pattern_ops", opclass: :varchar_pattern_ops - t.index ["source_type", "source_id"], name: "index_routes_on_source_type_and_source_id", unique: true - end - - create_table "sent_notifications", id: :serial, force: :cascade do |t| - t.integer "project_id" - t.string "noteable_type" - t.integer "noteable_id" - t.integer "recipient_id" - t.string "commit_id" - t.string "reply_key", null: false - t.string "line_code" - t.string "note_type" - t.text "position" - t.string "in_reply_to_discussion_id" - t.index ["reply_key"], name: "index_sent_notifications_on_reply_key", unique: true - end - - create_table "services", id: :serial, force: :cascade do |t| - t.string "type" - t.string "title" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.boolean "active", default: false, null: false - t.text "properties" - t.boolean "template", default: false - t.boolean "push_events", default: true - t.boolean "issues_events", default: true - t.boolean "merge_requests_events", default: true - t.boolean "tag_push_events", default: true - t.boolean "note_events", default: true, null: false - t.string "category", default: "common", null: false - t.boolean "default", default: false - t.boolean "wiki_page_events", default: true - t.boolean "pipeline_events", default: false, null: false - t.boolean "confidential_issues_events", default: true, null: false - t.boolean "commit_events", default: true, null: false - t.boolean "job_events", default: false, null: false - t.boolean "confidential_note_events", default: true - t.index ["project_id"], name: "index_services_on_project_id" - t.index ["template"], name: "index_services_on_template" - end - - create_table "shards", id: :serial, force: :cascade do |t| - t.string "name", null: false - t.index ["name"], name: "index_shards_on_name", unique: true - end - - create_table "snippets", id: :serial, force: :cascade do |t| - t.string "title" - t.text "content" - t.integer "author_id", null: false - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "file_name" - t.string "type" - t.integer "visibility_level", default: 0, null: false - t.text "title_html" - t.text "content_html" - t.integer "cached_markdown_version" - t.text "description" - t.text "description_html" - t.index ["author_id"], name: "index_snippets_on_author_id" - t.index ["file_name"], name: "index_snippets_on_file_name_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["project_id"], name: "index_snippets_on_project_id" - t.index ["title"], name: "index_snippets_on_title_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["updated_at"], name: "index_snippets_on_updated_at" - t.index ["visibility_level"], name: "index_snippets_on_visibility_level" - end - - create_table "spam_logs", id: :serial, force: :cascade do |t| - t.integer "user_id" - t.string "source_ip" - t.string "user_agent" - t.boolean "via_api" - t.string "noteable_type" - t.string "title" - t.text "description" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.boolean "submitted_as_ham", default: false, null: false - t.boolean "recaptcha_verified", default: false, null: false - end - - create_table "subscriptions", id: :serial, force: :cascade do |t| - t.integer "user_id" - t.string "subscribable_type" - t.integer "subscribable_id" - t.boolean "subscribed" - t.datetime "created_at" - t.datetime "updated_at" - t.integer "project_id" - t.index ["project_id"], name: "index_subscriptions_on_project_id" - t.index ["subscribable_id", "subscribable_type", "user_id", "project_id"], name: "index_subscriptions_on_subscribable_and_user_id_and_project_id", unique: true - end - - create_table "suggestions", force: :cascade do |t| - t.integer "note_id", null: false - t.integer "relative_order", limit: 2, null: false - t.boolean "applied", default: false, null: false - t.string "commit_id" - t.text "from_content", null: false - t.text "to_content", null: false - t.index ["note_id", "relative_order"], name: "index_suggestions_on_note_id_and_relative_order", unique: true - t.index ["note_id"], name: "index_suggestions_on_note_id" - end - - create_table "system_note_metadata", id: :serial, force: :cascade do |t| - t.integer "note_id", null: false - t.integer "commit_count" - t.string "action" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["note_id"], name: "index_system_note_metadata_on_note_id", unique: true - end - - create_table "taggings", id: :serial, force: :cascade do |t| - t.integer "tag_id" - t.integer "taggable_id" - t.string "taggable_type" - t.integer "tagger_id" - t.string "tagger_type" - t.string "context" - t.datetime "created_at" - t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true - t.index ["tag_id"], name: "index_taggings_on_tag_id" - t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context" - t.index ["taggable_id", "taggable_type"], name: "index_taggings_on_taggable_id_and_taggable_type" - end - - create_table "tags", id: :serial, force: :cascade do |t| - t.string "name" - t.integer "taggings_count", default: 0 - t.index ["name"], name: "index_tags_on_name", unique: true - end - - create_table "term_agreements", id: :serial, force: :cascade do |t| - t.integer "term_id", null: false - t.integer "user_id", null: false - t.boolean "accepted", default: false, null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.index ["term_id"], name: "index_term_agreements_on_term_id" - t.index ["user_id", "term_id"], name: "term_agreements_unique_index", unique: true - t.index ["user_id"], name: "index_term_agreements_on_user_id" - end - - create_table "timelogs", id: :serial, force: :cascade do |t| - t.integer "time_spent", null: false - t.integer "user_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "issue_id" - t.integer "merge_request_id" - t.datetime_with_timezone "spent_at" - t.index ["issue_id"], name: "index_timelogs_on_issue_id" - t.index ["merge_request_id"], name: "index_timelogs_on_merge_request_id" - t.index ["user_id"], name: "index_timelogs_on_user_id" - end - - create_table "todos", id: :serial, force: :cascade do |t| - t.integer "user_id", null: false - t.integer "project_id" - t.string "target_type", null: false - t.integer "target_id" - t.integer "author_id", null: false - t.integer "action", null: false - t.string "state", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.integer "note_id" - t.string "commit_id" - t.integer "group_id" - t.index ["author_id"], name: "index_todos_on_author_id" - t.index ["commit_id"], name: "index_todos_on_commit_id" - t.index ["group_id"], name: "index_todos_on_group_id" - t.index ["note_id"], name: "index_todos_on_note_id" - t.index ["project_id"], name: "index_todos_on_project_id" - t.index ["target_type", "target_id"], name: "index_todos_on_target_type_and_target_id" - t.index ["user_id", "id"], name: "index_todos_on_user_id_and_id_done", where: "((state)::text = 'done'::text)" - t.index ["user_id", "id"], name: "index_todos_on_user_id_and_id_pending", where: "((state)::text = 'pending'::text)" - t.index ["user_id"], name: "index_todos_on_user_id" - end - - create_table "trending_projects", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.index ["project_id"], name: "index_trending_projects_on_project_id", unique: true - end - - create_table "u2f_registrations", id: :serial, force: :cascade do |t| - t.text "certificate" - t.string "key_handle" - t.string "public_key" - t.integer "counter" - t.integer "user_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "name" - t.index ["key_handle"], name: "index_u2f_registrations_on_key_handle" - t.index ["user_id"], name: "index_u2f_registrations_on_user_id" - end - - create_table "uploads", id: :serial, force: :cascade do |t| - t.bigint "size", null: false - t.string "path", limit: 511, null: false - t.string "checksum", limit: 64 - t.string "model_type" - t.integer "model_id" - t.string "uploader", null: false - t.datetime "created_at", null: false - t.integer "store" - t.string "mount_point" - t.string "secret" - t.index ["checksum"], name: "index_uploads_on_checksum" - t.index ["model_id", "model_type"], name: "index_uploads_on_model_id_and_model_type" - t.index ["store"], name: "index_uploads_on_store" - t.index ["uploader", "path"], name: "index_uploads_on_uploader_and_path" - end - - create_table "user_agent_details", id: :serial, force: :cascade do |t| - t.string "user_agent", null: false - t.string "ip_address", null: false - t.integer "subject_id", null: false - t.string "subject_type", null: false - t.boolean "submitted", default: false, null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["subject_id", "subject_type"], name: "index_user_agent_details_on_subject_id_and_subject_type" - end - - create_table "user_callouts", id: :serial, force: :cascade do |t| - t.integer "feature_name", null: false - t.integer "user_id", null: false - t.index ["user_id", "feature_name"], name: "index_user_callouts_on_user_id_and_feature_name", unique: true - t.index ["user_id"], name: "index_user_callouts_on_user_id" - end - - create_table "user_custom_attributes", id: :serial, force: :cascade do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "user_id", null: false - t.string "key", null: false - t.string "value", null: false - t.index ["key", "value"], name: "index_user_custom_attributes_on_key_and_value" - t.index ["user_id", "key"], name: "index_user_custom_attributes_on_user_id_and_key", unique: true - end - - create_table "user_interacted_projects", id: false, force: :cascade do |t| - t.integer "user_id", null: false - t.integer "project_id", null: false - t.index ["project_id", "user_id"], name: "index_user_interacted_projects_on_project_id_and_user_id", unique: true - t.index ["user_id"], name: "index_user_interacted_projects_on_user_id" - end - - create_table "user_preferences", id: :serial, force: :cascade do |t| - t.integer "user_id", null: false - t.integer "issue_notes_filter", limit: 2, default: 0, null: false - t.integer "merge_request_notes_filter", limit: 2, default: 0, null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "first_day_of_week" - t.index ["user_id"], name: "index_user_preferences_on_user_id", unique: true - end - - create_table "user_statuses", primary_key: "user_id", id: :serial, force: :cascade do |t| - t.integer "cached_markdown_version" - t.string "emoji", default: "speech_balloon", null: false - t.string "message", limit: 100 - t.string "message_html" - t.index ["user_id"], name: "index_user_statuses_on_user_id" - end - - create_table "user_synced_attributes_metadata", id: :serial, force: :cascade do |t| - t.boolean "name_synced", default: false - t.boolean "email_synced", default: false - t.boolean "location_synced", default: false - t.integer "user_id", null: false - t.string "provider" - t.index ["user_id"], name: "index_user_synced_attributes_metadata_on_user_id", unique: true - end - - create_table "users", id: :serial, force: :cascade do |t| - t.string "email", default: "", null: false - t.string "encrypted_password", default: "", null: false - t.string "reset_password_token" - t.datetime "reset_password_sent_at" - t.datetime "remember_created_at" - t.integer "sign_in_count", default: 0 - t.datetime "current_sign_in_at" - t.datetime "last_sign_in_at" - t.string "current_sign_in_ip" - t.string "last_sign_in_ip" - t.datetime "created_at" - t.datetime "updated_at" - t.string "name" - t.boolean "admin", default: false, null: false - t.integer "projects_limit", null: false - t.string "skype", default: "", null: false - t.string "linkedin", default: "", null: false - t.string "twitter", default: "", null: false - t.string "bio" - t.integer "failed_attempts", default: 0 - t.datetime "locked_at" - t.string "username" - t.boolean "can_create_group", default: true, null: false - t.boolean "can_create_team", default: true, null: false - t.string "state" - t.integer "color_scheme_id", default: 1, null: false - t.datetime "password_expires_at" - t.integer "created_by_id" - t.datetime "last_credential_check_at" - t.string "avatar" - t.string "confirmation_token" - t.datetime "confirmed_at" - t.datetime "confirmation_sent_at" - t.string "unconfirmed_email" - t.boolean "hide_no_ssh_key", default: false - t.string "website_url", default: "", null: false - t.string "notification_email" - t.boolean "hide_no_password", default: false - t.boolean "password_automatically_set", default: false - t.string "location" - t.string "encrypted_otp_secret" - t.string "encrypted_otp_secret_iv" - t.string "encrypted_otp_secret_salt" - t.boolean "otp_required_for_login", default: false, null: false - t.text "otp_backup_codes" - t.string "public_email", default: "", null: false - t.integer "dashboard", default: 0 - t.integer "project_view", default: 0 - t.integer "consumed_timestep" - t.integer "layout", default: 0 - t.boolean "hide_project_limit", default: false - t.string "unlock_token" - t.datetime "otp_grace_period_started_at" - t.boolean "external", default: false - t.string "incoming_email_token" - t.string "organization" - t.boolean "require_two_factor_authentication_from_group", default: false, null: false - t.integer "two_factor_grace_period", default: 48, null: false - t.boolean "ghost" - t.date "last_activity_on" - t.boolean "notified_of_own_activity" - t.string "preferred_language" - t.integer "theme_id", limit: 2 - t.boolean "include_private_contributions" - t.string "feed_token" - t.integer "accepted_term_id" - t.boolean "private_profile" - t.string "commit_email" - t.index "lower((name)::text)", name: "index_on_users_name_lower" - t.index ["accepted_term_id"], name: "index_users_on_accepted_term_id" - t.index ["admin"], name: "index_users_on_admin" - t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true - t.index ["created_at"], name: "index_users_on_created_at" - t.index ["email"], name: "index_users_on_email", unique: true - t.index ["email"], name: "index_users_on_email_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["feed_token"], name: "index_users_on_feed_token" - t.index ["ghost"], name: "index_users_on_ghost" - t.index ["incoming_email_token"], name: "index_users_on_incoming_email_token" - t.index ["name"], name: "index_users_on_name" - t.index ["name"], name: "index_users_on_name_trigram", opclass: :gin_trgm_ops, using: :gin - t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true - t.index ["state"], name: "index_users_on_state" - t.index ["username"], name: "index_users_on_username" - t.index ["username"], name: "index_users_on_username_trigram", opclass: :gin_trgm_ops, using: :gin - end - - create_table "users_star_projects", id: :serial, force: :cascade do |t| - t.integer "project_id", null: false - t.integer "user_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.index ["project_id"], name: "index_users_star_projects_on_project_id" - t.index ["user_id", "project_id"], name: "index_users_star_projects_on_user_id_and_project_id", unique: true - end - - create_table "web_hook_logs", id: :serial, force: :cascade do |t| - t.integer "web_hook_id", null: false - t.string "trigger" - t.string "url" - t.text "request_headers" - t.text "request_data" - t.text "response_headers" - t.text "response_body" - t.string "response_status" - t.float "execution_duration" - t.string "internal_error_message" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["created_at", "web_hook_id"], name: "index_web_hook_logs_on_created_at_and_web_hook_id" - t.index ["web_hook_id"], name: "index_web_hook_logs_on_web_hook_id" - end - - create_table "web_hooks", id: :serial, force: :cascade do |t| - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "type", default: "ProjectHook" - t.integer "service_id" - t.boolean "push_events", default: true, null: false - t.boolean "issues_events", default: false, null: false - t.boolean "merge_requests_events", default: false, null: false - t.boolean "tag_push_events", default: false - t.boolean "note_events", default: false, null: false - t.boolean "enable_ssl_verification", default: true - t.boolean "wiki_page_events", default: false, null: false - t.boolean "pipeline_events", default: false, null: false - t.boolean "confidential_issues_events", default: false, null: false - t.boolean "repository_update_events", default: false, null: false - t.boolean "job_events", default: false, null: false - t.boolean "confidential_note_events" - t.text "push_events_branch_filter" - t.string "encrypted_token" - t.string "encrypted_token_iv" - t.string "encrypted_url" - t.string "encrypted_url_iv" - t.index ["project_id"], name: "index_web_hooks_on_project_id" - t.index ["type"], name: "index_web_hooks_on_type" - end - - add_foreign_key "application_settings", "users", column: "usage_stats_set_by_user_id", name: "fk_964370041d", on_delete: :nullify - add_foreign_key "badges", "namespaces", column: "group_id", on_delete: :cascade - add_foreign_key "badges", "projects", on_delete: :cascade - add_foreign_key "board_group_recent_visits", "boards", on_delete: :cascade - add_foreign_key "board_group_recent_visits", "namespaces", column: "group_id", on_delete: :cascade - add_foreign_key "board_group_recent_visits", "users", on_delete: :cascade - add_foreign_key "board_project_recent_visits", "boards", on_delete: :cascade - add_foreign_key "board_project_recent_visits", "projects", on_delete: :cascade - add_foreign_key "board_project_recent_visits", "users", on_delete: :cascade - add_foreign_key "boards", "namespaces", column: "group_id", on_delete: :cascade - add_foreign_key "boards", "projects", name: "fk_f15266b5f9", on_delete: :cascade - add_foreign_key "chat_teams", "namespaces", on_delete: :cascade - add_foreign_key "ci_build_trace_chunks", "ci_builds", column: "build_id", on_delete: :cascade - add_foreign_key "ci_build_trace_section_names", "projects", on_delete: :cascade - add_foreign_key "ci_build_trace_sections", "ci_build_trace_section_names", column: "section_name_id", name: "fk_264e112c66", on_delete: :cascade - add_foreign_key "ci_build_trace_sections", "ci_builds", column: "build_id", name: "fk_4ebe41f502", on_delete: :cascade - add_foreign_key "ci_build_trace_sections", "projects", on_delete: :cascade - add_foreign_key "ci_builds", "ci_pipelines", column: "auto_canceled_by_id", name: "fk_a2141b1522", on_delete: :nullify - add_foreign_key "ci_builds", "ci_pipelines", column: "commit_id", name: "fk_d3130c9a7f", on_delete: :cascade - add_foreign_key "ci_builds", "ci_stages", column: "stage_id", name: "fk_3a9eaa254d", on_delete: :cascade - add_foreign_key "ci_builds", "projects", name: "fk_befce0568a", on_delete: :cascade - add_foreign_key "ci_builds_metadata", "ci_builds", column: "build_id", on_delete: :cascade - add_foreign_key "ci_builds_metadata", "projects", on_delete: :cascade - add_foreign_key "ci_builds_runner_session", "ci_builds", column: "build_id", on_delete: :cascade - add_foreign_key "ci_group_variables", "namespaces", column: "group_id", name: "fk_33ae4d58d8", on_delete: :cascade - add_foreign_key "ci_job_artifacts", "ci_builds", column: "job_id", on_delete: :cascade - add_foreign_key "ci_job_artifacts", "projects", on_delete: :cascade - add_foreign_key "ci_pipeline_chat_data", "chat_names", on_delete: :cascade - add_foreign_key "ci_pipeline_chat_data", "ci_pipelines", column: "pipeline_id", on_delete: :cascade - add_foreign_key "ci_pipeline_schedule_variables", "ci_pipeline_schedules", column: "pipeline_schedule_id", name: "fk_41c35fda51", on_delete: :cascade - add_foreign_key "ci_pipeline_schedules", "projects", name: "fk_8ead60fcc4", on_delete: :cascade - add_foreign_key "ci_pipeline_schedules", "users", column: "owner_id", name: "fk_9ea99f58d2", on_delete: :nullify - add_foreign_key "ci_pipeline_variables", "ci_pipelines", column: "pipeline_id", name: "fk_f29c5f4380", on_delete: :cascade - add_foreign_key "ci_pipelines", "ci_pipeline_schedules", column: "pipeline_schedule_id", name: "fk_3d34ab2e06", on_delete: :nullify - add_foreign_key "ci_pipelines", "ci_pipelines", column: "auto_canceled_by_id", name: "fk_262d4c2d19", on_delete: :nullify - add_foreign_key "ci_pipelines", "merge_requests", name: "fk_a23be95014", on_delete: :cascade - add_foreign_key "ci_pipelines", "projects", name: "fk_86635dbd80", on_delete: :cascade - add_foreign_key "ci_runner_namespaces", "ci_runners", column: "runner_id", on_delete: :cascade - add_foreign_key "ci_runner_namespaces", "namespaces", on_delete: :cascade - add_foreign_key "ci_runner_projects", "projects", name: "fk_4478a6f1e4", on_delete: :cascade - add_foreign_key "ci_stages", "ci_pipelines", column: "pipeline_id", name: "fk_fb57e6cc56", on_delete: :cascade - add_foreign_key "ci_stages", "projects", name: "fk_2360681d1d", on_delete: :cascade - add_foreign_key "ci_trigger_requests", "ci_triggers", column: "trigger_id", name: "fk_b8ec8b7245", on_delete: :cascade - add_foreign_key "ci_triggers", "projects", name: "fk_e3e63f966e", on_delete: :cascade - add_foreign_key "ci_triggers", "users", column: "owner_id", name: "fk_e8e10d1964", on_delete: :cascade - add_foreign_key "ci_variables", "projects", name: "fk_ada5eb64b3", on_delete: :cascade - add_foreign_key "cluster_groups", "clusters", on_delete: :cascade - add_foreign_key "cluster_groups", "namespaces", column: "group_id", on_delete: :cascade - add_foreign_key "cluster_platforms_kubernetes", "clusters", on_delete: :cascade - add_foreign_key "cluster_projects", "clusters", on_delete: :cascade - add_foreign_key "cluster_projects", "projects", on_delete: :cascade - add_foreign_key "cluster_providers_gcp", "clusters", on_delete: :cascade - add_foreign_key "clusters", "users", on_delete: :nullify - add_foreign_key "clusters_applications_cert_managers", "clusters", on_delete: :cascade - add_foreign_key "clusters_applications_helm", "clusters", on_delete: :cascade - add_foreign_key "clusters_applications_ingress", "clusters", on_delete: :cascade - add_foreign_key "clusters_applications_jupyter", "clusters", on_delete: :cascade - add_foreign_key "clusters_applications_jupyter", "oauth_applications", on_delete: :nullify - add_foreign_key "clusters_applications_knative", "clusters", on_delete: :cascade - add_foreign_key "clusters_applications_prometheus", "clusters", on_delete: :cascade - add_foreign_key "clusters_applications_runners", "ci_runners", column: "runner_id", name: "fk_02de2ded36", on_delete: :nullify - add_foreign_key "clusters_applications_runners", "clusters", on_delete: :cascade - add_foreign_key "clusters_kubernetes_namespaces", "cluster_projects", on_delete: :nullify - add_foreign_key "clusters_kubernetes_namespaces", "clusters", on_delete: :cascade - add_foreign_key "clusters_kubernetes_namespaces", "projects", on_delete: :nullify - add_foreign_key "container_repositories", "projects" - add_foreign_key "deploy_keys_projects", "projects", name: "fk_58a901ca7e", on_delete: :cascade - add_foreign_key "deployments", "projects", name: "fk_b9a3851b82", on_delete: :cascade - add_foreign_key "environments", "projects", name: "fk_d1c8c1da6a", on_delete: :cascade - add_foreign_key "events", "projects", on_delete: :cascade - add_foreign_key "events", "users", column: "author_id", name: "fk_edfd187b6f", on_delete: :cascade - add_foreign_key "fork_network_members", "fork_networks", on_delete: :cascade - add_foreign_key "fork_network_members", "projects", column: "forked_from_project_id", name: "fk_b01280dae4", on_delete: :nullify - add_foreign_key "fork_network_members", "projects", on_delete: :cascade - add_foreign_key "fork_networks", "projects", column: "root_project_id", name: "fk_e7b436b2b5", on_delete: :nullify - add_foreign_key "forked_project_links", "projects", column: "forked_to_project_id", name: "fk_434510edb0", on_delete: :cascade - add_foreign_key "gpg_key_subkeys", "gpg_keys", on_delete: :cascade - add_foreign_key "gpg_keys", "users", on_delete: :cascade - add_foreign_key "gpg_signatures", "gpg_key_subkeys", on_delete: :nullify - add_foreign_key "gpg_signatures", "gpg_keys", on_delete: :nullify - add_foreign_key "gpg_signatures", "projects", on_delete: :cascade - add_foreign_key "group_custom_attributes", "namespaces", column: "group_id", on_delete: :cascade - add_foreign_key "group_group_links", "namespaces", column: "shared_group_id", on_delete: :cascade - add_foreign_key "group_group_links", "namespaces", column: "shared_with_group_id", on_delete: :cascade - add_foreign_key "import_export_uploads", "projects", on_delete: :cascade - add_foreign_key "internal_ids", "namespaces", name: "fk_162941d509", on_delete: :cascade - add_foreign_key "internal_ids", "projects", on_delete: :cascade - add_foreign_key "issue_assignees", "issues", name: "fk_b7d881734a", on_delete: :cascade - add_foreign_key "issue_assignees", "users", name: "fk_5e0c8d9154", on_delete: :cascade - add_foreign_key "issue_metrics", "issues", on_delete: :cascade - add_foreign_key "issues", "issues", column: "moved_to_id", name: "fk_a194299be1", on_delete: :nullify - add_foreign_key "issues", "milestones", name: "fk_96b1dd429c", on_delete: :nullify - add_foreign_key "issues", "projects", name: "fk_899c8f3231", on_delete: :cascade - add_foreign_key "issues", "users", column: "author_id", name: "fk_05f1e72feb", on_delete: :nullify - add_foreign_key "issues", "users", column: "closed_by_id", name: "fk_c63cbf6c25", on_delete: :nullify - add_foreign_key "issues", "users", column: "updated_by_id", name: "fk_ffed080f01", on_delete: :nullify - add_foreign_key "label_priorities", "labels", on_delete: :cascade - add_foreign_key "label_priorities", "projects", on_delete: :cascade - add_foreign_key "labels", "namespaces", column: "group_id", on_delete: :cascade - add_foreign_key "labels", "projects", name: "fk_7de4989a69", on_delete: :cascade - add_foreign_key "lfs_file_locks", "projects", on_delete: :cascade - add_foreign_key "lfs_file_locks", "users", on_delete: :cascade - add_foreign_key "lists", "boards", name: "fk_0d3f677137", on_delete: :cascade - add_foreign_key "lists", "labels", name: "fk_7a5553d60f", on_delete: :cascade - add_foreign_key "members", "users", name: "fk_2e88fb7ce9", on_delete: :cascade - add_foreign_key "merge_request_diff_commits", "merge_request_diffs", on_delete: :cascade - add_foreign_key "merge_request_diff_files", "merge_request_diffs", on_delete: :cascade - add_foreign_key "merge_request_diffs", "merge_requests", name: "fk_8483f3258f", on_delete: :cascade - add_foreign_key "merge_request_metrics", "ci_pipelines", column: "pipeline_id", on_delete: :cascade - add_foreign_key "merge_request_metrics", "merge_requests", on_delete: :cascade - add_foreign_key "merge_request_metrics", "users", column: "latest_closed_by_id", name: "fk_ae440388cc", on_delete: :nullify - add_foreign_key "merge_request_metrics", "users", column: "merged_by_id", name: "fk_7f28d925f3", on_delete: :nullify - add_foreign_key "merge_requests", "ci_pipelines", column: "head_pipeline_id", name: "fk_fd82eae0b9", on_delete: :nullify - add_foreign_key "merge_requests", "merge_request_diffs", column: "latest_merge_request_diff_id", name: "fk_06067f5644", on_delete: :nullify - add_foreign_key "merge_requests", "milestones", name: "fk_6a5165a692", on_delete: :nullify - add_foreign_key "merge_requests", "projects", column: "source_project_id", name: "fk_3308fe130c", on_delete: :nullify - add_foreign_key "merge_requests", "projects", column: "target_project_id", name: "fk_a6963e8447", on_delete: :cascade - add_foreign_key "merge_requests", "users", column: "assignee_id", name: "fk_6149611a04", on_delete: :nullify - add_foreign_key "merge_requests", "users", column: "author_id", name: "fk_e719a85f8a", on_delete: :nullify - add_foreign_key "merge_requests", "users", column: "merge_user_id", name: "fk_ad525e1f87", on_delete: :nullify - add_foreign_key "merge_requests", "users", column: "updated_by_id", name: "fk_641731faff", on_delete: :nullify - add_foreign_key "merge_requests_closing_issues", "issues", on_delete: :cascade - add_foreign_key "merge_requests_closing_issues", "merge_requests", on_delete: :cascade - add_foreign_key "milestones", "namespaces", column: "group_id", name: "fk_95650a40d4", on_delete: :cascade - add_foreign_key "milestones", "projects", name: "fk_9bd0a0c791", on_delete: :cascade - add_foreign_key "note_diff_files", "notes", column: "diff_note_id", on_delete: :cascade - add_foreign_key "notes", "projects", name: "fk_99e097b079", on_delete: :cascade - add_foreign_key "notification_settings", "users", name: "fk_0c95e91db7", on_delete: :cascade - add_foreign_key "oauth_openid_requests", "oauth_access_grants", column: "access_grant_id", name: "fk_oauth_openid_requests_oauth_access_grants_access_grant_id" - add_foreign_key "pages_domains", "projects", name: "fk_ea2f6dfc6f", on_delete: :cascade - add_foreign_key "personal_access_tokens", "users" - add_foreign_key "pool_repositories", "projects", column: "source_project_id", on_delete: :nullify - add_foreign_key "pool_repositories", "shards", on_delete: :restrict - add_foreign_key "project_authorizations", "projects", on_delete: :cascade - add_foreign_key "project_authorizations", "users", on_delete: :cascade - add_foreign_key "project_auto_devops", "projects", on_delete: :cascade - add_foreign_key "project_ci_cd_settings", "projects", name: "fk_24c15d2f2e", on_delete: :cascade - add_foreign_key "project_custom_attributes", "projects", on_delete: :cascade - add_foreign_key "project_daily_statistics", "projects", on_delete: :cascade - add_foreign_key "project_deploy_tokens", "deploy_tokens", on_delete: :cascade - add_foreign_key "project_deploy_tokens", "projects", on_delete: :cascade - add_foreign_key "project_error_tracking_settings", "projects", on_delete: :cascade - add_foreign_key "project_features", "projects", name: "fk_18513d9b92", on_delete: :cascade - add_foreign_key "project_group_links", "projects", name: "fk_daa8cee94c", on_delete: :cascade - add_foreign_key "project_import_data", "projects", name: "fk_ffb9ee3a10", on_delete: :cascade - add_foreign_key "project_mirror_data", "projects", on_delete: :cascade - add_foreign_key "project_repositories", "projects", on_delete: :cascade - add_foreign_key "project_repositories", "shards", on_delete: :restrict - add_foreign_key "project_statistics", "projects", on_delete: :cascade - add_foreign_key "projects", "pool_repositories", name: "fk_6e5c14658a", on_delete: :nullify - add_foreign_key "prometheus_metrics", "projects", on_delete: :cascade - add_foreign_key "protected_branch_merge_access_levels", "protected_branches", name: "fk_8a3072ccb3", on_delete: :cascade - add_foreign_key "protected_branch_push_access_levels", "protected_branches", name: "fk_9ffc86a3d9", on_delete: :cascade - add_foreign_key "protected_branches", "projects", name: "fk_7a9c6d93e7", on_delete: :cascade - add_foreign_key "protected_tag_create_access_levels", "namespaces", column: "group_id" - add_foreign_key "protected_tag_create_access_levels", "protected_tags", name: "fk_f7dfda8c51", on_delete: :cascade - add_foreign_key "protected_tag_create_access_levels", "users" - add_foreign_key "protected_tags", "projects", name: "fk_8e4af87648", on_delete: :cascade - add_foreign_key "push_event_payloads", "events", name: "fk_36c74129da", on_delete: :cascade - add_foreign_key "release_links", "releases", on_delete: :cascade - add_foreign_key "releases", "projects", name: "fk_47fe2a0596", on_delete: :cascade - add_foreign_key "releases", "users", column: "author_id", name: "fk_8e4456f90f", on_delete: :nullify - add_foreign_key "remote_mirrors", "projects", on_delete: :cascade - add_foreign_key "repository_languages", "projects", on_delete: :cascade - add_foreign_key "resource_label_events", "issues", on_delete: :cascade - add_foreign_key "resource_label_events", "labels", on_delete: :nullify - add_foreign_key "resource_label_events", "merge_requests", on_delete: :cascade - add_foreign_key "resource_label_events", "users", on_delete: :nullify - add_foreign_key "services", "projects", name: "fk_71cce407f9", on_delete: :cascade - add_foreign_key "snippets", "projects", name: "fk_be41fd4bb7", on_delete: :cascade - add_foreign_key "subscriptions", "projects", on_delete: :cascade - add_foreign_key "suggestions", "notes", on_delete: :cascade - add_foreign_key "system_note_metadata", "notes", name: "fk_d83a918cb1", on_delete: :cascade - add_foreign_key "term_agreements", "application_setting_terms", column: "term_id" - add_foreign_key "term_agreements", "users", on_delete: :cascade - add_foreign_key "timelogs", "issues", name: "fk_timelogs_issues_issue_id", on_delete: :cascade - add_foreign_key "timelogs", "merge_requests", name: "fk_timelogs_merge_requests_merge_request_id", on_delete: :cascade - add_foreign_key "todos", "namespaces", column: "group_id", name: "fk_a27c483435", on_delete: :cascade - add_foreign_key "todos", "notes", name: "fk_91d1f47b13", on_delete: :cascade - add_foreign_key "todos", "projects", name: "fk_45054f9c45", on_delete: :cascade - add_foreign_key "todos", "users", column: "author_id", name: "fk_ccf0373936", on_delete: :cascade - add_foreign_key "todos", "users", name: "fk_d94154aa95", on_delete: :cascade - add_foreign_key "trending_projects", "projects", on_delete: :cascade - add_foreign_key "u2f_registrations", "users" - add_foreign_key "user_callouts", "users", on_delete: :cascade - add_foreign_key "user_custom_attributes", "users", on_delete: :cascade - add_foreign_key "user_interacted_projects", "projects", on_delete: :cascade - add_foreign_key "user_interacted_projects", "users", on_delete: :cascade - add_foreign_key "user_preferences", "users", on_delete: :cascade - add_foreign_key "user_statuses", "users", on_delete: :cascade - add_foreign_key "user_synced_attributes_metadata", "users", on_delete: :cascade - add_foreign_key "users", "application_setting_terms", column: "accepted_term_id", name: "fk_789cd90b35", on_delete: :cascade - add_foreign_key "users_star_projects", "projects", name: "fk_22cd27ddfc", on_delete: :cascade - add_foreign_key "web_hook_logs", "web_hooks", on_delete: :cascade - add_foreign_key "web_hooks", "projects", name: "fk_0c8ca6d9d1", on_delete: :cascade + execute(IO.read("db/init_structure.sql")) end def down raise ActiveRecord::IrreversibleMigration, "The initial migration is not revertable" end end - -# rubocop:enable Metrics/AbcSize -# rubocop:enable Migration/AddConcurrentForeignKey -# rubocop:enable Style/WordArray -# rubocop:enable Migration/PreventStrings -# rubocop:enable Migration/AddLimitToTextColumns -# rubocop:enable Migration/Datetime diff --git a/db/migrate/20190103140724_make_legacy_false_default.rb b/db/migrate/20190103140724_make_legacy_false_default.rb deleted file mode 100644 index 154035f76cd..00000000000 --- a/db/migrate/20190103140724_make_legacy_false_default.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class MakeLegacyFalseDefault < ActiveRecord::Migration[5.0] - DOWNTIME = false - - def change - change_column_default :cluster_providers_gcp, :legacy_abac, from: true, to: false - end -end diff --git a/db/migrate/20190104182041_cleanup_legacy_artifact_migration.rb b/db/migrate/20190104182041_cleanup_legacy_artifact_migration.rb deleted file mode 100644 index 11659846a06..00000000000 --- a/db/migrate/20190104182041_cleanup_legacy_artifact_migration.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -class CleanupLegacyArtifactMigration < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - class Build < ActiveRecord::Base - include EachBatch - - self.table_name = 'ci_builds' - self.inheritance_column = :_type_disabled - - scope :with_legacy_artifacts, -> { where("artifacts_file <> ''") } - end - - def up - Gitlab::BackgroundMigration.steal('MigrateLegacyArtifacts') - - CleanupLegacyArtifactMigration::Build - .with_legacy_artifacts - .each_batch(of: 100) do |batch| - range = batch.pluck('MIN(id)', 'MAX(id)').first - - Gitlab::BackgroundMigration::MigrateLegacyArtifacts.new.perform(*range) - end - end - - def down - # no-op - end -end diff --git a/db/migrate/20190107151020_add_services_type_index.rb b/db/migrate/20190107151020_add_services_type_index.rb deleted file mode 100644 index 26b5bd58750..00000000000 --- a/db/migrate/20190107151020_add_services_type_index.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddServicesTypeIndex < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :services, :type unless index_exists?(:services, :type) - end - - def down - remove_concurrent_index :services, :type if index_exists?(:services, :type) - end -end diff --git a/db/migrate/20190108192941_remove_partial_index_from_ci_builds_artifacts_file.rb b/db/migrate/20190108192941_remove_partial_index_from_ci_builds_artifacts_file.rb deleted file mode 100644 index 86de78b831b..00000000000 --- a/db/migrate/20190108192941_remove_partial_index_from_ci_builds_artifacts_file.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class RemovePartialIndexFromCiBuildsArtifactsFile < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'partial_index_ci_builds_on_id_with_legacy_artifacts' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name(:ci_builds, INDEX_NAME) - end - - def down - add_concurrent_index(:ci_builds, :id, where: "artifacts_file <> ''", name: INDEX_NAME) - end -end diff --git a/db/migrate/20190109153125_add_merge_request_external_diffs.rb b/db/migrate/20190109153125_add_merge_request_external_diffs.rb deleted file mode 100644 index d787e78142a..00000000000 --- a/db/migrate/20190109153125_add_merge_request_external_diffs.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddMergeRequestExternalDiffs < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def change - # Allow the merge request diff to store details about an external file - add_column :merge_request_diffs, :external_diff, :string # rubocop:disable Migration/PreventStrings - add_column :merge_request_diffs, :external_diff_store, :integer - add_column :merge_request_diffs, :stored_externally, :boolean - - # The diff for each file is mapped to a range in the external file - add_column :merge_request_diff_files, :external_diff_offset, :integer - add_column :merge_request_diff_files, :external_diff_size, :integer - - # If the diff is in object storage, it will be null in the database - change_column_null :merge_request_diff_files, :diff, true - end -end diff --git a/db/migrate/20190114172110_add_domain_to_cluster.rb b/db/migrate/20190114172110_add_domain_to_cluster.rb deleted file mode 100644 index ebe588d8b77..00000000000 --- a/db/migrate/20190114172110_add_domain_to_cluster.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddDomainToCluster < ActiveRecord::Migration[5.0] - DOWNTIME = false - - def change - add_column :clusters, :domain, :string # rubocop:disable Migration/PreventStrings - end -end diff --git a/db/migrate/20190115054216_add_error_notification_sent_to_remote_mirrors.rb b/db/migrate/20190115054216_add_error_notification_sent_to_remote_mirrors.rb deleted file mode 100644 index d8f979a1848..00000000000 --- a/db/migrate/20190115054216_add_error_notification_sent_to_remote_mirrors.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddErrorNotificationSentToRemoteMirrors < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :remote_mirrors, :error_notification_sent, :boolean - end -end diff --git a/db/migrate/20190115092821_add_columns_project_error_tracking_settings.rb b/db/migrate/20190115092821_add_columns_project_error_tracking_settings.rb deleted file mode 100644 index ee6d63b558f..00000000000 --- a/db/migrate/20190115092821_add_columns_project_error_tracking_settings.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddColumnsProjectErrorTrackingSettings < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :project_error_tracking_settings, :project_name, :string - add_column :project_error_tracking_settings, :organization_name, :string - - change_column_default :project_error_tracking_settings, :enabled, from: true, to: false - - change_column_null :project_error_tracking_settings, :api_url, true - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190116234221_add_sorting_fields_to_user_preference.rb b/db/migrate/20190116234221_add_sorting_fields_to_user_preference.rb deleted file mode 100644 index 5d33f6f4339..00000000000 --- a/db/migrate/20190116234221_add_sorting_fields_to_user_preference.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddSortingFieldsToUserPreference < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def up - add_column :user_preferences, :issues_sort, :string - add_column :user_preferences, :merge_requests_sort, :string - end - # rubocop:enable Migration/PreventStrings - - def down - remove_column :user_preferences, :issues_sort - remove_column :user_preferences, :merge_requests_sort - end -end diff --git a/db/migrate/20190130091630_add_local_cached_markdown_version.rb b/db/migrate/20190130091630_add_local_cached_markdown_version.rb deleted file mode 100644 index 00570e6458c..00000000000 --- a/db/migrate/20190130091630_add_local_cached_markdown_version.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddLocalCachedMarkdownVersion < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :application_settings, :local_markdown_version, :integer, default: 0, null: false - end -end diff --git a/db/migrate/20190206193120_add_index_to_tags.rb b/db/migrate/20190206193120_add_index_to_tags.rb deleted file mode 100644 index d6c0270cb4f..00000000000 --- a/db/migrate/20190206193120_add_index_to_tags.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToTags < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_tags_on_name_trigram' - - disable_ddl_transaction! - - def up - add_concurrent_index :tags, :name, name: INDEX_NAME, using: :gin, opclass: { name: :gin_trgm_ops } - end - - def down - remove_concurrent_index_by_name(:tags, INDEX_NAME) - end -end diff --git a/db/migrate/20190211131150_add_state_id_to_issuables.rb b/db/migrate/20190211131150_add_state_id_to_issuables.rb deleted file mode 100644 index c1173eb4249..00000000000 --- a/db/migrate/20190211131150_add_state_id_to_issuables.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddStateIdToIssuables < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - add_column :issues, :state_id, :integer, limit: 2 - add_column :merge_requests, :state_id, :integer, limit: 2 - end - - def down - remove_column :issues, :state_id - remove_column :merge_requests, :state_id - end -end diff --git a/db/migrate/20190215154930_add_merge_pipelines_enabled_to_ci_cd_settings.rb b/db/migrate/20190215154930_add_merge_pipelines_enabled_to_ci_cd_settings.rb deleted file mode 100644 index 2a2a216da7d..00000000000 --- a/db/migrate/20190215154930_add_merge_pipelines_enabled_to_ci_cd_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddMergePipelinesEnabledToCiCdSettings < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :project_ci_cd_settings, :merge_pipelines_enabled, :boolean - end -end diff --git a/db/migrate/20190218134158_add_masked_to_ci_variables.rb b/db/migrate/20190218134158_add_masked_to_ci_variables.rb deleted file mode 100644 index 60dcc0d7af5..00000000000 --- a/db/migrate/20190218134158_add_masked_to_ci_variables.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddMaskedToCiVariables < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :ci_variables, :masked, :boolean, default: false, allow_null: false # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :ci_variables, :masked - end -end diff --git a/db/migrate/20190218134209_add_masked_to_ci_group_variables.rb b/db/migrate/20190218134209_add_masked_to_ci_group_variables.rb deleted file mode 100644 index c25881410d0..00000000000 --- a/db/migrate/20190218134209_add_masked_to_ci_group_variables.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddMaskedToCiGroupVariables < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :ci_group_variables, :masked, :boolean, default: false, allow_null: false # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :ci_group_variables, :masked - end -end diff --git a/db/migrate/20190219201635_add_asset_proxy_settings.rb b/db/migrate/20190219201635_add_asset_proxy_settings.rb deleted file mode 100644 index 173b2916c4d..00000000000 --- a/db/migrate/20190219201635_add_asset_proxy_settings.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddAssetProxySettings < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - # rubocop:disable Migration/AddLimitToTextColumns - def change - add_column :application_settings, :asset_proxy_enabled, :boolean, default: false, null: false - add_column :application_settings, :asset_proxy_url, :string - add_column :application_settings, :asset_proxy_whitelist, :text - add_column :application_settings, :encrypted_asset_proxy_secret_key, :text - add_column :application_settings, :encrypted_asset_proxy_secret_key_iv, :string - end - # rubocop:enable Migration/AddLimitToTextColumns - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190220142344_add_email_header_and_footer_enabled_flag_to_appearances_table.rb b/db/migrate/20190220142344_add_email_header_and_footer_enabled_flag_to_appearances_table.rb deleted file mode 100644 index 33fb6b8ef0d..00000000000 --- a/db/migrate/20190220142344_add_email_header_and_footer_enabled_flag_to_appearances_table.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddEmailHeaderAndFooterEnabledFlagToAppearancesTable < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - def up - add_column_with_default(:appearances, :email_header_and_footer_enabled, :boolean, default: false) # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column(:appearances, :email_header_and_footer_enabled) - end -end diff --git a/db/migrate/20190220150130_add_extra_shas_to_ci_pipelines.rb b/db/migrate/20190220150130_add_extra_shas_to_ci_pipelines.rb deleted file mode 100644 index 45c7c0949c6..00000000000 --- a/db/migrate/20190220150130_add_extra_shas_to_ci_pipelines.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class AddExtraShasToCiPipelines < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :ci_pipelines, :source_sha, :binary - add_column :ci_pipelines, :target_sha, :binary - end -end diff --git a/db/migrate/20190222051615_add_indexes_for_merge_request_diffs_query.rb b/db/migrate/20190222051615_add_indexes_for_merge_request_diffs_query.rb deleted file mode 100644 index bf7f7b44dec..00000000000 --- a/db/migrate/20190222051615_add_indexes_for_merge_request_diffs_query.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -class AddIndexesForMergeRequestDiffsQuery < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - INDEX_SPECS = [ - [ - :merge_request_metrics, - :latest_closed_at, - { where: 'latest_closed_at IS NOT NULL' } - ], - [ - :merge_request_metrics, - [:merge_request_id, :merged_at], - { where: 'merged_at IS NOT NULL' } - ], - [ - :merge_request_diffs, - [:merge_request_id, :id], - { - name: 'index_merge_request_diffs_on_merge_request_id_and_id_partial', - where: 'NOT stored_externally OR stored_externally IS NULL' - } - ] - ].freeze - - disable_ddl_transaction! - - def up - INDEX_SPECS.each do |spec| - add_concurrent_index(*spec) - end - end - - def down - INDEX_SPECS.reverse_each do |spec| - remove_concurrent_index(*spec) - end - end -end diff --git a/db/migrate/20190225152525_add_auto_dev_ops_enabled_to_namespaces.rb b/db/migrate/20190225152525_add_auto_dev_ops_enabled_to_namespaces.rb deleted file mode 100644 index e4757b6bada..00000000000 --- a/db/migrate/20190225152525_add_auto_dev_ops_enabled_to_namespaces.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddAutoDevOpsEnabledToNamespaces < ActiveRecord::Migration[5.0] - DOWNTIME = false - - def change - add_column :namespaces, :auto_devops_enabled, :boolean # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20190225160301_add_runner_tokens_indexes.rb b/db/migrate/20190225160301_add_runner_tokens_indexes.rb deleted file mode 100644 index 3230c2809de..00000000000 --- a/db/migrate/20190225160301_add_runner_tokens_indexes.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class AddRunnerTokensIndexes < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - # It seems that `ci_runners.token_encrypted` and `projects.runners_token_encrypted` - # are non-unique - - def up - add_concurrent_index :ci_runners, :token_encrypted - add_concurrent_index :projects, :runners_token_encrypted - add_concurrent_index :namespaces, :runners_token_encrypted, unique: true - end - - def down - remove_concurrent_index :ci_runners, :token_encrypted - remove_concurrent_index :projects, :runners_token_encrypted - remove_concurrent_index :namespaces, :runners_token_encrypted, unique: true - end -end diff --git a/db/migrate/20190228192410_add_multi_line_attributes_to_suggestion.rb b/db/migrate/20190228192410_add_multi_line_attributes_to_suggestion.rb deleted file mode 100644 index 4daabb6baa8..00000000000 --- a/db/migrate/20190228192410_add_multi_line_attributes_to_suggestion.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddMultiLineAttributesToSuggestion < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :suggestions, :lines_above, :integer, default: 0, allow_null: false # rubocop:disable Migration/AddColumnWithDefault - add_column_with_default :suggestions, :lines_below, :integer, default: 0, allow_null: false # rubocop:disable Migration/AddColumnWithDefault - add_column_with_default :suggestions, :outdated, :boolean, default: false, allow_null: false # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_columns :suggestions, :outdated, :lines_above, :lines_below - end -end diff --git a/db/migrate/20190301182457_add_external_hostname_to_ingress_and_knative.rb b/db/migrate/20190301182457_add_external_hostname_to_ingress_and_knative.rb deleted file mode 100644 index 4cb6053fbe1..00000000000 --- a/db/migrate/20190301182457_add_external_hostname_to_ingress_and_knative.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class AddExternalHostnameToIngressAndKnative < ActiveRecord::Migration[5.0] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :clusters_applications_ingress, :external_hostname, :string - add_column :clusters_applications_knative, :external_hostname, :string - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190312071108_add_detected_repository_languages_to_projects.rb b/db/migrate/20190312071108_add_detected_repository_languages_to_projects.rb deleted file mode 100644 index 82e7ec851c9..00000000000 --- a/db/migrate/20190312071108_add_detected_repository_languages_to_projects.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddDetectedRepositoryLanguagesToProjects < ActiveRecord::Migration[5.0] - DOWNTIME = false - - def change - add_column :projects, :detected_repository_languages, :boolean # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20190312113229_add_remove_at_to_pages_domains.rb b/db/migrate/20190312113229_add_remove_at_to_pages_domains.rb deleted file mode 100644 index aa7d2841cd2..00000000000 --- a/db/migrate/20190312113229_add_remove_at_to_pages_domains.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddRemoveAtToPagesDomains < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - def change - add_column :pages_domains, :remove_at, :datetime_with_timezone - end -end diff --git a/db/migrate/20190312113634_add_remove_at_index_to_pages_domains.rb b/db/migrate/20190312113634_add_remove_at_index_to_pages_domains.rb deleted file mode 100644 index b5ccebd9cfa..00000000000 --- a/db/migrate/20190312113634_add_remove_at_index_to_pages_domains.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddRemoveAtIndexToPagesDomains < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :pages_domains, :remove_at - end - - def down - remove_concurrent_index :pages_domains, :remove_at - end -end diff --git a/db/migrate/20190315191339_create_merge_request_assignees_table.rb b/db/migrate/20190315191339_create_merge_request_assignees_table.rb deleted file mode 100644 index 6fc4463f281..00000000000 --- a/db/migrate/20190315191339_create_merge_request_assignees_table.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class CreateMergeRequestAssigneesTable < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - INDEX_NAME = 'index_merge_request_assignees_on_merge_request_id_and_user_id' - - def up - create_table :merge_request_assignees do |t| - t.references :user, foreign_key: { on_delete: :cascade }, index: true, null: false - t.references :merge_request, foreign_key: { on_delete: :cascade }, null: false - end - - add_index :merge_request_assignees, [:merge_request_id, :user_id], unique: true, name: INDEX_NAME - end - - def down - drop_table :merge_request_assignees - end -end diff --git a/db/migrate/20190320174702_add_lets_encrypt_notification_email_to_application_settings.rb b/db/migrate/20190320174702_add_lets_encrypt_notification_email_to_application_settings.rb deleted file mode 100644 index e0ec10ca204..00000000000 --- a/db/migrate/20190320174702_add_lets_encrypt_notification_email_to_application_settings.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddLetsEncryptNotificationEmailToApplicationSettings < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :application_settings, :lets_encrypt_notification_email, :string - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190322164830_add_auto_ssl_enabled_to_pages_domain.rb b/db/migrate/20190322164830_add_auto_ssl_enabled_to_pages_domain.rb deleted file mode 100644 index 41552b0e2e3..00000000000 --- a/db/migrate/20190322164830_add_auto_ssl_enabled_to_pages_domain.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddAutoSslEnabledToPagesDomain < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :pages_domains, :auto_ssl_enabled, :boolean, default: false # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :pages_domains, :auto_ssl_enabled - end -end diff --git a/db/migrate/20190325080727_truncate_user_fullname.rb b/db/migrate/20190325080727_truncate_user_fullname.rb deleted file mode 100644 index 29255d173d8..00000000000 --- a/db/migrate/20190325080727_truncate_user_fullname.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# rubocop:disable Migration/UpdateLargeTable -class TruncateUserFullname < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - truncated_name = Arel.sql('SUBSTRING(name from 1 for 128)') - where_clause = Arel.sql("LENGTH(name) > 128") - - update_column_in_batches(:users, :name, truncated_name) do |table, query| - query.where(where_clause) - end - end - - def down - # noop - end -end diff --git a/db/migrate/20190325105715_add_fields_to_user_preferences.rb b/db/migrate/20190325105715_add_fields_to_user_preferences.rb deleted file mode 100644 index 78ccbd65c84..00000000000 --- a/db/migrate/20190325105715_add_fields_to_user_preferences.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddFieldsToUserPreferences < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - def up - add_column(:user_preferences, :timezone, :string) # rubocop:disable Migration/PreventStrings - add_column(:user_preferences, :time_display_relative, :boolean) - add_column(:user_preferences, :time_format_in_24h, :boolean) - end - - def down - remove_column(:user_preferences, :timezone) - remove_column(:user_preferences, :time_display_relative) - remove_column(:user_preferences, :time_format_in_24h) - end -end diff --git a/db/migrate/20190325165127_add_managed_to_cluster.rb b/db/migrate/20190325165127_add_managed_to_cluster.rb deleted file mode 100644 index 14ed4db143e..00000000000 --- a/db/migrate/20190325165127_add_managed_to_cluster.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddManagedToCluster < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - def up - add_column_with_default(:clusters, :managed, :boolean, default: true) # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column(:clusters, :managed) - end -end diff --git a/db/migrate/20190326164045_import_common_metrics_knative.rb b/db/migrate/20190326164045_import_common_metrics_knative.rb deleted file mode 100644 index 6b331755774..00000000000 --- a/db/migrate/20190326164045_import_common_metrics_knative.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class ImportCommonMetricsKnative < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute - end - - def down - # no-op - end -end diff --git a/db/migrate/20190327163904_add_notification_email_to_notification_settings.rb b/db/migrate/20190327163904_add_notification_email_to_notification_settings.rb deleted file mode 100644 index d8a7e96f902..00000000000 --- a/db/migrate/20190327163904_add_notification_email_to_notification_settings.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddNotificationEmailToNotificationSettings < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :notification_settings, :notification_email, :string - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190329085614_add_lets_encrypt_terms_of_service_accepted_to_application_settings.rb b/db/migrate/20190329085614_add_lets_encrypt_terms_of_service_accepted_to_application_settings.rb deleted file mode 100644 index 36641e24e45..00000000000 --- a/db/migrate/20190329085614_add_lets_encrypt_terms_of_service_accepted_to_application_settings.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddLetsEncryptTermsOfServiceAcceptedToApplicationSettings < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default(:application_settings, :lets_encrypt_terms_of_service_accepted, :boolean, default: false) # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :application_settings, :lets_encrypt_terms_of_service_accepted - end -end diff --git a/db/migrate/20190402150158_backport_enterprise_schema.rb b/db/migrate/20190402150158_backport_enterprise_schema.rb deleted file mode 100644 index ba5f700a877..00000000000 --- a/db/migrate/20190402150158_backport_enterprise_schema.rb +++ /dev/null @@ -1,2195 +0,0 @@ -# frozen_string_literal: true - -# rubocop: disable Metrics/AbcSize -# rubocop: disable Migration/Datetime -# rubocop: disable Migration/PreventStrings -# rubocop: disable Migration/AddLimitToTextColumns -class BackportEnterpriseSchema < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - APPLICATION_SETTINGS_COLUMNS = [ - { type: :boolean, name: :elasticsearch_indexing, default: false, null: false }, - { type: :boolean, name: :elasticsearch_search, default: false, null: false }, - { type: :integer, name: :shared_runners_minutes, default: 0, null: false }, - { type: :bigint, name: :repository_size_limit, default: 0, null: true }, - { type: :string, name: :elasticsearch_url, default: "http://localhost:9200" }, - { type: :boolean, name: :elasticsearch_aws, default: false, null: false }, - { type: :string, name: :elasticsearch_aws_region, default: "us-east-1", null: true }, - { type: :string, name: :elasticsearch_aws_access_key, default: nil, null: true }, - { type: :string, name: :elasticsearch_aws_secret_access_key, default: nil, null: true }, - { type: :integer, name: :geo_status_timeout, default: 10, null: true }, - { type: :boolean, name: :elasticsearch_experimental_indexer, default: nil, null: true }, - { type: :boolean, name: :check_namespace_plan, default: false, null: false }, - { type: :integer, name: :mirror_max_delay, default: 300, null: false }, - { type: :integer, name: :mirror_max_capacity, default: 100, null: false }, - { type: :integer, name: :mirror_capacity_threshold, default: 50, null: false }, - { type: :boolean, name: :slack_app_enabled, default: false }, - { type: :string, name: :slack_app_id }, - { type: :string, name: :slack_app_secret }, - { type: :string, name: :slack_app_verification_token }, - { type: :boolean, name: :allow_group_owners_to_manage_ldap, default: true, null: false }, - { type: :integer, name: :default_project_creation, default: 2, null: false }, - { type: :string, name: :email_additional_text }, - { type: :integer, name: :file_template_project_id }, - { type: :boolean, name: :pseudonymizer_enabled, default: false, null: false }, - { type: :boolean, name: :snowplow_enabled, default: false, null: false }, - { type: :string, name: :snowplow_collector_uri }, - { type: :string, name: :snowplow_site_id }, - { type: :string, name: :snowplow_cookie_domain }, - { type: :integer, name: :custom_project_templates_group_id }, - { type: :boolean, name: :elasticsearch_limit_indexing, default: false, null: false }, - { type: :string, name: :geo_node_allowed_ips, default: '0.0.0.0/0, ::/0' } - ].freeze - - NAMESPACE_COLUMNS = [ - { type: :integer, name: :custom_project_templates_group_id }, - { type: :integer, name: :file_template_project_id }, - { type: :string, name: :ldap_sync_error }, - { type: :datetime, name: :ldap_sync_last_successful_update_at }, - { type: :datetime, name: :ldap_sync_last_sync_at }, - { type: :datetime, name: :ldap_sync_last_update_at }, - { type: :integer, name: :plan_id }, - { type: :integer, name: :project_creation_level }, - { type: :bigint, name: :repository_size_limit }, - { type: :string, name: :saml_discovery_token }, - { type: :integer, name: :shared_runners_minutes_limit }, - { type: :datetime_with_timezone, name: :trial_ends_on }, - { type: :integer, name: :extra_shared_runners_minutes_limit } - ].freeze - - PROJECT_MIRROR_DATA_COLUMNS = [ - { type: :datetime_with_timezone, name: :last_successful_update_at }, - { type: :datetime_with_timezone, name: :last_update_at }, - { type: :datetime, name: :last_update_scheduled_at }, - { type: :datetime, name: :last_update_started_at }, - { type: :datetime, name: :next_execution_timestamp } - ].freeze - - PROJECTS_COLUMNS = [ - { type: :boolean, name: :disable_overriding_approvers_per_merge_request }, - { type: :string, name: :external_webhook_token }, - { type: :text, name: :issues_template }, - { type: :boolean, name: :merge_requests_author_approval }, - { type: :boolean, name: :merge_requests_disable_committers_approval }, - { type: :boolean, name: :merge_requests_require_code_owner_approval }, - { type: :text, name: :merge_requests_template }, - { type: :datetime, name: :mirror_last_successful_update_at }, - { type: :datetime, name: :mirror_last_update_at }, - { type: :boolean, name: :mirror_overwrites_diverged_branches }, - { type: :integer, name: :mirror_user_id }, - { type: :boolean, name: :only_mirror_protected_branches }, - { type: :boolean, name: :packages_enabled }, - { type: :boolean, name: :pull_mirror_available_overridden }, - { type: :bigint, name: :repository_size_limit }, - { type: :boolean, name: :require_password_to_approve } - ].freeze - - USERS_COLUMNS = [ - { type: :datetime, name: :admin_email_unsubscribed_at }, - { type: :boolean, name: :email_opted_in }, - { type: :datetime, name: :email_opted_in_at }, - { type: :string, name: :email_opted_in_ip }, - { type: :integer, name: :email_opted_in_source_id }, - { type: :integer, name: :group_view }, - { type: :integer, name: :managing_group_id }, - { type: :text, name: :note }, - { type: :integer, name: :roadmap_layout, limit: 2 }, - { type: :boolean, name: :support_bot }, - { type: :integer, name: :bot_type, limit: 2 } - ].freeze - - class ApplicationSetting < ActiveRecord::Base - self.table_name = 'application_settings' - end - - class ProtectedBranchMergeAccessLevels < ActiveRecord::Base - self.table_name = 'protected_branch_merge_access_levels' - end - - class ProtectedBranchPushAccessLevels < ActiveRecord::Base - self.table_name = 'protected_branch_push_access_levels' - end - - class Project < ActiveRecord::Base - self.table_name = 'projects' - end - - def up - check_schema! - - create_missing_tables - - update_appearances - update_application_settings - update_boards_table - update_clusters_applications_prometheus - update_identities - update_issues - update_lists - update_members - update_merge_requests - update_notes - update_ci_builds - update_environments - update_namespaces - update_notification_settings - update_project_mirror_data - update_project_statistics - update_projects - update_protected_branch_merge_access_levels - update_protected_branch_push_access_levels - update_resource_label_events - update_user_preferences - update_users - update_web_hooks - update_geo_nodes - - add_missing_foreign_keys - end - - def down - # This migration can not be reverted in a production environment, as doing - # so would lead to data loss for existing EE installations. - return if !Rails.env.test? && !Rails.env.development? - - remove_foreign_keys - remove_tables - - revert_appearances - revert_application_settings - revert_boards_table - revert_clusters_applications_prometheus - revert_identities - revert_issues - revert_lists - revert_members - revert_merge_requests - revert_notes - revert_ci_builds - revert_environments - revert_namespaces - revert_notification_settings - revert_project_mirror_data - revert_project_statistics - revert_projects - revert_protected_branch_merge_access_levels - revert_protected_branch_push_access_levels - revert_resource_label_events - revert_user_preferences - revert_users - revert_web_hooks - end - - def add_column_if_not_exists(table, name, *args) - add_column(table, name, *args) unless column_exists?(table, name) - end - - def remove_column_if_exists(table, column) - remove_column(table, column) if column_exists?(table, column) - end - - def drop_table_if_exists(table) - # rubocop:disable Migration/DropTable - drop_table(table) if table_exists?(table) - # rubocop:enable Migration/DropTable - end - - def add_column_with_default_if_not_exists(table, name, type, **args) - unless column_exists?(table, name) - add_column_with_default(table, name, type, **args) # rubocop:disable Migration/AddColumnWithDefault - end - end - - def add_missing_columns(table, columns) - columns.each do |column| - next if table.column_exists?(column[:name]) - - # We can't use (public_)send here as this doesn't work with - # `datetime_with_timezone` for some reason. - table.column( - column[:name], - column[:type], - default: column[:default], - null: column.fetch(:null, true), - limit: column[:limit] - ) - end - end - - def remove_columns(table, columns) - columns.each do |column| - remove_column_if_exists(table, column[:name]) - end - end - - def create_table_if_not_exists(name, **args, &block) - return if table_exists?(name) - - create_table(name, **args, &block) - end - - def add_concurrent_foreign_key(source, target, column:, on_delete: nil, name: nil) - # We don't want redundant VALIDATE CONSTRAINT statements to run for existing - # foreign keys, as this can take a long time on large installations such as - # GitLab.com. - return if foreign_key_exists?(source, target, column: column) - - super - end - - def update_appearances - add_column_if_not_exists(:appearances, :updated_by, :integer) - end - - def revert_appearances - remove_column_if_exists(:namespaces, :updated_by) - end - - def update_application_settings - # In the CE schema this column allows NULL values even though there is a - # default value. In EE this column is not allowed to be NULL. This means - # that if we want to add a NOT NULL clause below, we must ensure no existing - # data would violate this clause. - ApplicationSetting - .where(password_authentication_enabled_for_git: nil) - .update_all(password_authentication_enabled_for_git: true) - - change_column_null( - :application_settings, - :password_authentication_enabled_for_git, - false - ) - - # This table will only have a single row, and all operations here will be - # very fast. As such we merge all of this into a single ALTER TABLE - # statement. - change_table(:application_settings) do |t| - t.text(:help_text) unless t.column_exists?(:help_text) - - add_missing_columns(t, APPLICATION_SETTINGS_COLUMNS) - end - - add_concurrent_index( - :application_settings, - :custom_project_templates_group_id - ) - - add_concurrent_index( - :application_settings, - :file_template_project_id - ) - end - - def revert_application_settings - change_column_null( - :application_settings, - :password_authentication_enabled_for_git, - true - ) - - remove_concurrent_index( - :application_settings, - :custom_project_templates_group_id - ) - - remove_concurrent_index( - :application_settings, - :file_template_project_id - ) - - remove_columns(:application_settings, APPLICATION_SETTINGS_COLUMNS) - end - - def update_boards_table - add_column_if_not_exists(:boards, :milestone_id, :integer) - add_column_if_not_exists(:boards, :weight, :integer) - - add_column_with_default_if_not_exists( - :boards, - :name, - :string, - default: 'Development' - ) - - add_concurrent_index(:boards, :milestone_id) - end - - def revert_boards_table - remove_concurrent_index(:boards, :milestone_id) - remove_column_if_exists(:boards, :name) - remove_column_if_exists(:boards, :weight) - remove_column_if_exists(:boards, :milestone_id) - end - - def update_clusters_applications_prometheus - add_column_if_not_exists( - :clusters_applications_prometheus, - :encrypted_alert_manager_token, - :string - ) - - add_column_if_not_exists( - :clusters_applications_prometheus, - :encrypted_alert_manager_token_iv, - :string - ) - - add_column_if_not_exists( - :clusters_applications_prometheus, - :last_update_started_at, - :datetime_with_timezone - ) - end - - def revert_clusters_applications_prometheus - remove_column_if_exists( - :clusters_applications_prometheus, - :encrypted_alert_manager_token - ) - - remove_column_if_exists( - :clusters_applications_prometheus, - :encrypted_alert_manager_token_iv - ) - - remove_column_if_exists( - :clusters_applications_prometheus, - :last_update_started_at - ) - end - - def update_identities - add_column_if_not_exists(:identities, :saml_provider_id, :integer) - add_column_if_not_exists(:identities, :secondary_extern_uid, :string) - - add_concurrent_index( - :identities, - :saml_provider_id, - where: 'saml_provider_id IS NOT NULL' - ) - end - - def revert_identities - remove_column_if_exists(:identities, :saml_provider_id) - remove_column_if_exists(:identities, :secondary_extern_uid) - end - - def update_issues - add_column_if_not_exists(:issues, :service_desk_reply_to, :string) - add_column_if_not_exists(:issues, :weight, :integer) - end - - def revert_issues - remove_column_if_exists(:issues, :service_desk_reply_to) - remove_column_if_exists(:issues, :weight) - end - - def update_lists - add_column_if_not_exists(:lists, :milestone_id, :integer) - add_column_if_not_exists(:lists, :user_id, :integer) - - add_concurrent_index(:lists, :milestone_id) - add_concurrent_index(:lists, :user_id) - end - - def revert_lists - remove_column_if_exists(:lists, :milestone_id) - remove_column_if_exists(:lists, :user_id) - end - - def update_members - add_column_with_default_if_not_exists( - :members, - :ldap, - :boolean, - default: false - ) - - add_column_with_default_if_not_exists( - :members, - :override, - :boolean, - default: false - ) - end - - def revert_members - remove_column_if_exists(:members, :ldap) - remove_column_if_exists(:members, :override) - end - - def update_merge_requests - add_column_if_not_exists(:merge_requests, :approvals_before_merge, :integer) - end - - def revert_merge_requests - remove_column_if_exists(:merge_requests, :approvals_before_merge) - end - - def update_notes - add_column_if_not_exists(:notes, :review_id, :bigint) - add_concurrent_index(:notes, :review_id) - end - - def revert_notes - remove_column_if_exists(:notes, :review_id) - end - - def update_ci_builds - add_concurrent_index( - :ci_builds, - [:name], - name: 'index_ci_builds_on_name_for_security_products_values', - where: " - ( - (name)::text = ANY ( - ARRAY[ - ('container_scanning'::character varying)::text, - ('dast'::character varying)::text, - ('dependency_scanning'::character varying)::text, - ('license_management'::character varying)::text, - ('sast'::character varying)::text - ] - ) - )" - ) - end - - def revert_ci_builds - remove_concurrent_index_by_name( - :ci_builds, - 'index_ci_builds_on_name_for_security_products_values' - ) - end - - def update_environments - return if index_exists?(:environments, :name, name: 'index_environments_on_name_varchar_pattern_ops') - - execute('CREATE INDEX CONCURRENTLY index_environments_on_name_varchar_pattern_ops ON environments (name varchar_pattern_ops);') - end - - def revert_environments - remove_concurrent_index_by_name( - :environments, - 'index_environments_on_name_varchar_pattern_ops' - ) - end - - def update_namespaces - change_table(:namespaces) do |t| - add_missing_columns(t, NAMESPACE_COLUMNS) - end - - add_column_with_default_if_not_exists( - :namespaces, - :ldap_sync_status, - :string, - default: 'ready' - ) - - add_column_with_default_if_not_exists( - :namespaces, - :membership_lock, - :boolean, - default: false, - allow_null: true - ) - - # When `add_concurrent_index` runs, it for some reason incorrectly - # determines this index does not exist when it does. To work around this, we - # check the existence by name ourselves. - unless index_exists_by_name?(:namespaces, 'index_namespaces_on_custom_project_templates_group_id_and_type') - add_concurrent_index( - :namespaces, - %i[custom_project_templates_group_id type], - where: "(custom_project_templates_group_id IS NOT NULL)" - ) - end - - add_concurrent_index(:namespaces, :file_template_project_id) - add_concurrent_index(:namespaces, :ldap_sync_last_successful_update_at) - add_concurrent_index(:namespaces, :ldap_sync_last_update_at) - add_concurrent_index(:namespaces, :plan_id) - add_concurrent_index( - :namespaces, - :trial_ends_on, - where: "(trial_ends_on IS NOT NULL)" - ) - - unless index_exists_by_name?(:namespaces, 'index_namespaces_on_shared_and_extra_runners_minutes_limit') - add_concurrent_index( - :namespaces, - %i[shared_runners_minutes_limit extra_shared_runners_minutes_limit], - name: 'index_namespaces_on_shared_and_extra_runners_minutes_limit' - ) - end - end - - def revert_namespaces - remove_columns(:namespaces, NAMESPACE_COLUMNS) - remove_column_if_exists(:namespaces, :ldap_sync_status) - remove_column_if_exists(:namespaces, :membership_lock) - - remove_concurrent_index_by_name( - :namespaces, - 'index_namespaces_on_shared_and_extra_runners_minutes_limit' - ) - end - - def update_notification_settings - add_column_if_not_exists(:notification_settings, :new_epic, :boolean) - end - - def revert_notification_settings - remove_column_if_exists(:notification_settings, :new_epic) - end - - def update_project_mirror_data - change_table(:project_mirror_data) do |t| - add_missing_columns(t, PROJECT_MIRROR_DATA_COLUMNS) - end - - add_column_with_default_if_not_exists( - :project_mirror_data, - :retry_count, - :integer, - default: 0 - ) - - add_concurrent_index(:project_mirror_data, :last_successful_update_at) - - add_concurrent_index( - :project_mirror_data, - %i[next_execution_timestamp retry_count], - name: 'index_mirror_data_on_next_execution_and_retry_count' - ) - end - - def revert_project_mirror_data - remove_columns(:project_mirror_data, PROJECT_MIRROR_DATA_COLUMNS) - - remove_concurrent_index_by_name( - :project_mirror_data, - 'index_mirror_data_on_next_execution_and_retry_count' - ) - - remove_column_if_exists(:project_statistics, :retry_count) - end - - def update_project_statistics - add_column_with_default_if_not_exists( - :project_statistics, - :shared_runners_seconds, - :bigint, - default: 0 - ) - - add_column_if_not_exists( - :project_statistics, - :shared_runners_seconds_last_reset, - :datetime - ) - end - - def revert_project_statistics - remove_column_if_exists(:project_statistics, :shared_runners_seconds) - - remove_column_if_exists( - :project_statistics, - :shared_runners_seconds_last_reset - ) - end - - def update_projects - change_table(:projects) do |t| - add_missing_columns(t, PROJECTS_COLUMNS) - end - - change_column_null(:projects, :merge_requests_rebase_enabled, true) - - add_column_with_default_if_not_exists( - :projects, - :mirror, - :boolean, - default: false - ) - - add_column_with_default_if_not_exists( - :projects, - :mirror_trigger_builds, - :boolean, - default: false - ) - - add_column_with_default_if_not_exists( - :projects, - :reset_approvals_on_push, - :boolean, - default: true, - allow_null: true - ) - - add_column_with_default_if_not_exists( - :projects, - :service_desk_enabled, - :boolean, - default: true, - allow_null: true - ) - - add_column_with_default_if_not_exists( - :projects, - :approvals_before_merge, - :integer, - default: 0 - ) - - add_concurrent_index( - :projects, - %i[archived pending_delete merge_requests_require_code_owner_approval], - name: 'projects_requiring_code_owner_approval', - where: '((pending_delete = false) AND (archived = false) AND (merge_requests_require_code_owner_approval = true))' - ) - - add_concurrent_index( - :projects, - %i[id repository_storage last_repository_updated_at], - name: 'idx_projects_on_repository_storage_last_repository_updated_at' - ) - - add_concurrent_index( - :projects, - :id, - name: 'index_projects_on_mirror_and_mirror_trigger_builds_both_true', - where: '((mirror IS TRUE) AND (mirror_trigger_builds IS TRUE))' - ) - - add_concurrent_index(:projects, :mirror_last_successful_update_at) - end - - def revert_projects - remove_columns(:projects, PROJECTS_COLUMNS) - - Project - .where(merge_requests_rebase_enabled: nil) - .update_all(merge_requests_rebase_enabled: false) - - change_column_null(:projects, :merge_requests_rebase_enabled, false) - - remove_column_if_exists(:projects, :mirror) - remove_column_if_exists(:projects, :mirror_trigger_builds) - remove_column_if_exists(:projects, :reset_approvals_on_push) - remove_column_if_exists(:projects, :service_desk_enabled) - remove_column_if_exists(:projects, :approvals_before_merge) - - remove_concurrent_index_by_name( - :projects, - 'projects_requiring_code_owner_approval' - ) - - remove_concurrent_index_by_name( - :projects, - 'idx_projects_on_repository_storage_last_repository_updated_at' - ) - - remove_concurrent_index_by_name( - :projects, - 'index_projects_on_mirror_and_mirror_trigger_builds_both_true' - ) - end - - def update_protected_branch_merge_access_levels - change_column_null(:protected_branch_merge_access_levels, :access_level, true) - - add_column_if_not_exists( - :protected_branch_merge_access_levels, - :group_id, - :integer - ) - - add_column_if_not_exists( - :protected_branch_merge_access_levels, - :user_id, - :integer - ) - - add_concurrent_index(:protected_branch_merge_access_levels, :group_id) - add_concurrent_index(:protected_branch_merge_access_levels, :user_id) - end - - def revert_protected_branch_merge_access_levels - ProtectedBranchMergeAccessLevels - .where(access_level: nil) - .update_all(access_level: false) - - change_column_null( - :protected_branch_merge_access_levels, - :access_level, - false - ) - - remove_column_if_exists(:protected_branch_merge_access_levels, :group_id) - remove_column_if_exists(:protected_branch_merge_access_levels, :user_id) - end - - def update_protected_branch_push_access_levels - change_column_null( - :protected_branch_push_access_levels, - :access_level, - true - ) - - add_column_if_not_exists( - :protected_branch_push_access_levels, - :group_id, - :integer - ) - - add_column_if_not_exists( - :protected_branch_push_access_levels, - :user_id, - :integer - ) - - add_concurrent_index(:protected_branch_push_access_levels, :group_id) - add_concurrent_index(:protected_branch_push_access_levels, :user_id) - end - - def revert_protected_branch_push_access_levels - ProtectedBranchPushAccessLevels - .where(access_level: nil) - .update_all(access_level: false) - - change_column_null( - :protected_branch_push_access_levels, - :access_level, - false - ) - - remove_column_if_exists(:protected_branch_push_access_levels, :group_id) - remove_column_if_exists(:protected_branch_push_access_levels, :user_id) - end - - def update_resource_label_events - add_column_if_not_exists(:resource_label_events, :epic_id, :integer) - add_concurrent_index(:resource_label_events, :epic_id) - end - - def revert_resource_label_events - remove_column_if_exists(:resource_label_events, :epic_id) - end - - def update_user_preferences - add_column_with_default_if_not_exists( - :user_preferences, - :epic_notes_filter, - :integer, - default: 0, - limit: 2 - ) - - add_column_if_not_exists(:user_preferences, :epics_sort, :string) - add_column_if_not_exists(:user_preferences, :roadmap_epics_state, :integer) - add_column_if_not_exists(:user_preferences, :roadmaps_sort, :string) - end - - def revert_user_preferences - remove_column_if_exists(:user_preferences, :epic_notes_filter) - remove_column_if_exists(:user_preferences, :epics_sort) - remove_column_if_exists(:user_preferences, :roadmap_epics_state) - remove_column_if_exists(:user_preferences, :roadmaps_sort) - end - - def update_users - add_column_with_default_if_not_exists( - :users, - :auditor, - :boolean, - default: false - ) - - change_table(:users) do |t| - add_missing_columns(t, USERS_COLUMNS) - end - - add_concurrent_index(:users, :group_view) - add_concurrent_index(:users, :managing_group_id) - add_concurrent_index(:users, :support_bot) - add_concurrent_index(:users, :bot_type) - - add_concurrent_index( - :users, - :state, - name: 'index_users_on_state_and_internal_attrs', - where: '((ghost <> true) AND (support_bot <> true))' - ) - - internal_index = 'index_users_on_state_and_internal' - - remove_concurrent_index(:users, :state, name: internal_index) - - add_concurrent_index( - :users, - :state, - name: internal_index, - where: '((ghost <> true) AND (bot_type IS NULL))' - ) - end - - def revert_users - remove_column_if_exists(:users, :auditor) - remove_columns(:users, USERS_COLUMNS) - - remove_concurrent_index_by_name( - :users, - 'index_users_on_state_and_internal_attrs' - ) - - internal_index = 'index_users_on_state_and_internal' - - remove_concurrent_index(:users, :state, name: internal_index) - add_concurrent_index(:users, :state, name: internal_index) - end - - def update_web_hooks - add_column_if_not_exists(:web_hooks, :group_id, :integer) - end - - def revert_web_hooks - remove_column_if_exists(:web_hooks, :group_id) - end - - def update_geo_nodes - add_column_if_not_exists(:geo_nodes, :internal_url, :string) - end - - def revert_geo_nodes - remove_column_if_exists(:geo_nodes, :internal_url) - end - - # Some users may have upgraded to EE at some point but downgraded to - # CE v11.11.3. As a result, their EE tables may not be in the right - # state. Here we check for these such cases and attempt to guide the - # user into recovering from this state by upgrading to v11.11.3 EE - # before installing v12.0.0 CE. - def check_schema! - # The following cases will fail later when this migration attempts - # to add a foreign key for non-existent columns. - columns_to_check = [ - [:epics, :parent_id], # Added in GitLab 11.7 - [:geo_event_log, :cache_invalidation_event_id], # Added in GitLab 11.4 - [:vulnerability_feedback, :merge_request_id] # Added in GitLab 11.9 - ].freeze - - columns_to_check.each do |table, column| - check_ee_columns!(table, column) - end - end - - def check_ee_columns!(table, column) - return unless table_exists?(table) - return if column_exists?(table, column) - - raise_ee_migration_error!(table, column) - end - - def raise_ee_migration_error!(table, column) - message = "Your database is missing the '#{column}' column from the '#{table}' table that is present for GitLab EE." - - message += - if ::Gitlab.ee? - "\nUpgrade your GitLab instance to 11.11.3 EE first!" - else - <<~MSG - - Even though it looks like you're running a CE installation, it appears - you may have installed GitLab EE at some point. To migrate to GitLab 12.0: - - 1. Install GitLab 11.11.3 EE - 2. Install GitLab 12.0.x CE - MSG - end - - raise StandardError, message - end - - def create_missing_tables - create_table_if_not_exists "approval_merge_request_rule_sources", id: :bigserial do |t| - t.bigint "approval_merge_request_rule_id", null: false - t.bigint "approval_project_rule_id", null: false - t.index %w[approval_merge_request_rule_id], name: "index_approval_merge_request_rule_sources_1", unique: true, using: :btree - t.index %w[approval_project_rule_id], name: "index_approval_merge_request_rule_sources_2", using: :btree - end - - create_table_if_not_exists "approval_merge_request_rules", id: :bigserial do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "merge_request_id", null: false - t.integer "approvals_required", limit: 2, default: 0, null: false - t.boolean "code_owner", default: false, null: false - t.string "name", null: false - t.index %w[merge_request_id code_owner name], name: "approval_rule_name_index_for_code_owners", unique: true, where: "(code_owner = true)", using: :btree - t.index %w[merge_request_id code_owner], name: "index_approval_merge_request_rules_1", using: :btree - end - - create_table_if_not_exists "approval_merge_request_rules_approved_approvers", id: :bigserial do |t| - t.bigint "approval_merge_request_rule_id", null: false - t.integer "user_id", null: false - t.index %w[approval_merge_request_rule_id user_id], name: "index_approval_merge_request_rules_approved_approvers_1", unique: true, using: :btree - t.index %w[user_id], name: "index_approval_merge_request_rules_approved_approvers_2", using: :btree - end - - create_table_if_not_exists "approval_merge_request_rules_groups", id: :bigserial do |t| - t.bigint "approval_merge_request_rule_id", null: false - t.integer "group_id", null: false - t.index %w[approval_merge_request_rule_id group_id], name: "index_approval_merge_request_rules_groups_1", unique: true, using: :btree - t.index %w[group_id], name: "index_approval_merge_request_rules_groups_2", using: :btree - end - - create_table_if_not_exists "approval_merge_request_rules_users", id: :bigserial do |t| - t.bigint "approval_merge_request_rule_id", null: false - t.integer "user_id", null: false - t.index %w[approval_merge_request_rule_id user_id], name: "index_approval_merge_request_rules_users_1", unique: true, using: :btree - t.index %w[user_id], name: "index_approval_merge_request_rules_users_2", using: :btree - end - - create_table_if_not_exists "approval_project_rules", id: :bigserial do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "project_id", null: false - t.integer "approvals_required", limit: 2, default: 0, null: false - t.string "name", null: false - t.index %w[project_id], name: "index_approval_project_rules_on_project_id", using: :btree - end - - create_table_if_not_exists "approval_project_rules_groups", id: :bigserial do |t| - t.bigint "approval_project_rule_id", null: false - t.integer "group_id", null: false - t.index %w[approval_project_rule_id group_id], name: "index_approval_project_rules_groups_1", unique: true, using: :btree - t.index %w[group_id], name: "index_approval_project_rules_groups_2", using: :btree - end - - create_table_if_not_exists "approval_project_rules_users", id: :bigserial do |t| - t.bigint "approval_project_rule_id", null: false - t.integer "user_id", null: false - t.index %w[approval_project_rule_id user_id], name: "index_approval_project_rules_users_1", unique: true, using: :btree - t.index %w[user_id], name: "index_approval_project_rules_users_2", using: :btree - end - - create_table_if_not_exists "approvals" do |t| - t.integer "merge_request_id", null: false - t.integer "user_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.index %w[merge_request_id], name: "index_approvals_on_merge_request_id", using: :btree - end - - create_table_if_not_exists "approver_groups" do |t| - t.integer "target_id", null: false - t.string "target_type", null: false - t.integer "group_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.index %w[group_id], name: "index_approver_groups_on_group_id", using: :btree - t.index %w[target_id target_type], name: "index_approver_groups_on_target_id_and_target_type", using: :btree - end - - create_table_if_not_exists "approvers" do |t| - t.integer "target_id", null: false - t.string "target_type" - t.integer "user_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.index %w[target_id target_type], name: "index_approvers_on_target_id_and_target_type", using: :btree - t.index %w[user_id], name: "index_approvers_on_user_id", using: :btree - end - - create_table_if_not_exists "board_assignees" do |t| - t.integer "board_id", null: false - t.integer "assignee_id", null: false - t.index %w[assignee_id], name: "index_board_assignees_on_assignee_id", using: :btree - t.index %w[board_id assignee_id], name: "index_board_assignees_on_board_id_and_assignee_id", unique: true, using: :btree - end - - create_table_if_not_exists "board_labels" do |t| - t.integer "board_id", null: false - t.integer "label_id", null: false - t.index %w[board_id label_id], name: "index_board_labels_on_board_id_and_label_id", unique: true, using: :btree - t.index %w[label_id], name: "index_board_labels_on_label_id", using: :btree - end - - create_table_if_not_exists "ci_sources_pipelines" do |t| - t.integer "project_id" - t.integer "pipeline_id" - t.integer "source_project_id" - t.integer "source_job_id" - t.integer "source_pipeline_id" - t.index ["pipeline_id"], name: "index_ci_sources_pipelines_on_pipeline_id", using: :btree - t.index ["project_id"], name: "index_ci_sources_pipelines_on_project_id", using: :btree - t.index ["source_job_id"], name: "index_ci_sources_pipelines_on_source_job_id", using: :btree - t.index ["source_pipeline_id"], name: "index_ci_sources_pipelines_on_source_pipeline_id", using: :btree - t.index ["source_project_id"], name: "index_ci_sources_pipelines_on_source_project_id", using: :btree - end - - create_table_if_not_exists "design_management_designs", id: :bigserial, force: :cascade do |t| - t.integer "project_id", null: false - t.integer "issue_id", null: false - t.string "filename", null: false - t.index %w[issue_id filename], name: "index_design_management_designs_on_issue_id_and_filename", unique: true, using: :btree - t.index ["project_id"], name: "index_design_management_designs_on_project_id", using: :btree - end - - create_table_if_not_exists "design_management_designs_versions", id: false, force: :cascade do |t| - t.bigint "design_id", null: false - t.bigint "version_id", null: false - t.index %w[design_id version_id], name: "design_management_designs_versions_uniqueness", unique: true, using: :btree - t.index ["design_id"], name: "index_design_management_designs_versions_on_design_id", using: :btree - t.index ["version_id"], name: "index_design_management_designs_versions_on_version_id", using: :btree - end - - create_table_if_not_exists "design_management_versions", id: :bigserial, force: :cascade do |t| - t.binary "sha", null: false - t.index ["sha"], name: "index_design_management_versions_on_sha", unique: true, using: :btree - end - - create_table_if_not_exists "draft_notes", id: :bigserial do |t| - t.integer "merge_request_id", null: false - t.integer "author_id", null: false - t.boolean "resolve_discussion", default: false, null: false - t.string "discussion_id" - t.text "note", null: false - t.text "position" - t.text "original_position" - t.text "change_position" - t.index ["author_id"], name: "index_draft_notes_on_author_id", using: :btree - t.index ["discussion_id"], name: "index_draft_notes_on_discussion_id", using: :btree - t.index ["merge_request_id"], name: "index_draft_notes_on_merge_request_id", using: :btree - end - - create_table_if_not_exists "elasticsearch_indexed_namespaces", id: false do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "namespace_id" - t.index ["namespace_id"], name: "index_elasticsearch_indexed_namespaces_on_namespace_id", unique: true, using: :btree - end - - create_table_if_not_exists "elasticsearch_indexed_projects", id: false do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "project_id" - t.index ["project_id"], name: "index_elasticsearch_indexed_projects_on_project_id", unique: true, using: :btree - end - - create_table_if_not_exists "epic_issues" do |t| - t.integer "epic_id", null: false - t.integer "issue_id", null: false - t.integer "relative_position", default: 1073741823, null: false - t.index ["epic_id"], name: "index_epic_issues_on_epic_id", using: :btree - t.index ["issue_id"], name: "index_epic_issues_on_issue_id", unique: true, using: :btree - end - - create_table_if_not_exists "epic_metrics" do |t| - t.integer "epic_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["epic_id"], name: "index_epic_metrics", using: :btree - end - - create_table_if_not_exists "epics" do |t| - t.integer "milestone_id" - t.integer "group_id", null: false - t.integer "author_id", null: false - t.integer "assignee_id" - t.integer "iid", null: false - t.integer "cached_markdown_version" - t.integer "updated_by_id" - t.integer "last_edited_by_id" - t.integer "lock_version" - t.date "start_date" - t.date "end_date" - t.datetime "last_edited_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "title", null: false - t.string "title_html", null: false - t.text "description" - t.text "description_html" - t.integer "start_date_sourcing_milestone_id" - t.integer "due_date_sourcing_milestone_id" - t.date "start_date_fixed" - t.date "due_date_fixed" - t.boolean "start_date_is_fixed" - t.boolean "due_date_is_fixed" - t.integer "state", limit: 2, default: 1, null: false - t.integer "closed_by_id" - t.datetime "closed_at" - t.integer "parent_id" - t.integer "relative_position" - t.index ["assignee_id"], name: "index_epics_on_assignee_id", using: :btree - t.index ["author_id"], name: "index_epics_on_author_id", using: :btree - t.index ["closed_by_id"], name: "index_epics_on_closed_by_id", using: :btree - t.index ["end_date"], name: "index_epics_on_end_date", using: :btree - t.index ["group_id"], name: "index_epics_on_group_id", using: :btree - t.index ["iid"], name: "index_epics_on_iid", using: :btree - t.index ["milestone_id"], name: "index_milestone", using: :btree - t.index ["parent_id"], name: "index_epics_on_parent_id", using: :btree - t.index ["start_date"], name: "index_epics_on_start_date", using: :btree - end - - create_table_if_not_exists "geo_cache_invalidation_events", id: :bigserial do |t| - t.string "key", null: false - end - - create_table_if_not_exists "geo_event_log", id: :bigserial do |t| - t.datetime "created_at", null: false - t.bigint "repository_updated_event_id" - t.bigint "repository_deleted_event_id" - t.bigint "repository_renamed_event_id" - t.bigint "repositories_changed_event_id" - t.bigint "repository_created_event_id" - t.bigint "hashed_storage_migrated_event_id" - t.bigint "lfs_object_deleted_event_id" - t.bigint "hashed_storage_attachments_event_id" - t.bigint "upload_deleted_event_id" - t.bigint "job_artifact_deleted_event_id" - t.bigint "reset_checksum_event_id" - t.bigint "cache_invalidation_event_id" - t.index ["cache_invalidation_event_id"], name: "index_geo_event_log_on_cache_invalidation_event_id", where: "(cache_invalidation_event_id IS NOT NULL)", using: :btree - t.index ["hashed_storage_attachments_event_id"], name: "index_geo_event_log_on_hashed_storage_attachments_event_id", where: "(hashed_storage_attachments_event_id IS NOT NULL)", using: :btree - t.index ["hashed_storage_migrated_event_id"], name: "index_geo_event_log_on_hashed_storage_migrated_event_id", where: "(hashed_storage_migrated_event_id IS NOT NULL)", using: :btree - t.index ["job_artifact_deleted_event_id"], name: "index_geo_event_log_on_job_artifact_deleted_event_id", where: "(job_artifact_deleted_event_id IS NOT NULL)", using: :btree - t.index ["lfs_object_deleted_event_id"], name: "index_geo_event_log_on_lfs_object_deleted_event_id", where: "(lfs_object_deleted_event_id IS NOT NULL)", using: :btree - t.index ["repositories_changed_event_id"], name: "index_geo_event_log_on_repositories_changed_event_id", where: "(repositories_changed_event_id IS NOT NULL)", using: :btree - t.index ["repository_created_event_id"], name: "index_geo_event_log_on_repository_created_event_id", where: "(repository_created_event_id IS NOT NULL)", using: :btree - t.index ["repository_deleted_event_id"], name: "index_geo_event_log_on_repository_deleted_event_id", where: "(repository_deleted_event_id IS NOT NULL)", using: :btree - t.index ["repository_renamed_event_id"], name: "index_geo_event_log_on_repository_renamed_event_id", where: "(repository_renamed_event_id IS NOT NULL)", using: :btree - t.index ["repository_updated_event_id"], name: "index_geo_event_log_on_repository_updated_event_id", where: "(repository_updated_event_id IS NOT NULL)", using: :btree - t.index ["reset_checksum_event_id"], name: "index_geo_event_log_on_reset_checksum_event_id", where: "(reset_checksum_event_id IS NOT NULL)", using: :btree - t.index ["upload_deleted_event_id"], name: "index_geo_event_log_on_upload_deleted_event_id", where: "(upload_deleted_event_id IS NOT NULL)", using: :btree - end - - create_table_if_not_exists "geo_hashed_storage_attachments_events", id: :bigserial do |t| - t.integer "project_id", null: false - t.text "old_attachments_path", null: false - t.text "new_attachments_path", null: false - t.index ["project_id"], name: "index_geo_hashed_storage_attachments_events_on_project_id", using: :btree - end - - create_table_if_not_exists "geo_hashed_storage_migrated_events", id: :bigserial do |t| - t.integer "project_id", null: false - t.text "repository_storage_name", null: false - t.text "old_disk_path", null: false - t.text "new_disk_path", null: false - t.text "old_wiki_disk_path", null: false - t.text "new_wiki_disk_path", null: false - t.integer "old_storage_version", limit: 2 - t.integer "new_storage_version", limit: 2, null: false - t.index ["project_id"], name: "index_geo_hashed_storage_migrated_events_on_project_id", using: :btree - end - - create_table_if_not_exists "geo_job_artifact_deleted_events", id: :bigserial do |t| - t.integer "job_artifact_id", null: false - t.string "file_path", null: false - t.index ["job_artifact_id"], name: "index_geo_job_artifact_deleted_events_on_job_artifact_id", using: :btree - end - - create_table_if_not_exists "geo_lfs_object_deleted_events", id: :bigserial do |t| - t.integer "lfs_object_id", null: false - t.string "oid", null: false - t.string "file_path", null: false - t.index ["lfs_object_id"], name: "index_geo_lfs_object_deleted_events_on_lfs_object_id", using: :btree - end - - create_table_if_not_exists "geo_node_namespace_links" do |t| - t.integer "geo_node_id", null: false - t.integer "namespace_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index %w[geo_node_id namespace_id], name: "index_geo_node_namespace_links_on_geo_node_id_and_namespace_id", unique: true, using: :btree - t.index ["geo_node_id"], name: "index_geo_node_namespace_links_on_geo_node_id", using: :btree - t.index ["namespace_id"], name: "index_geo_node_namespace_links_on_namespace_id", using: :btree - end - - create_table_if_not_exists "geo_node_statuses" do |t| - t.integer "geo_node_id", null: false - t.integer "db_replication_lag_seconds" - t.integer "repositories_synced_count" - t.integer "repositories_failed_count" - t.integer "lfs_objects_count" - t.integer "lfs_objects_synced_count" - t.integer "lfs_objects_failed_count" - t.integer "attachments_count" - t.integer "attachments_synced_count" - t.integer "attachments_failed_count" - t.integer "last_event_id" - t.datetime "last_event_date" - t.integer "cursor_last_event_id" - t.datetime "cursor_last_event_date" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.datetime "last_successful_status_check_at" - t.string "status_message" - t.integer "replication_slots_count" - t.integer "replication_slots_used_count" - t.bigint "replication_slots_max_retained_wal_bytes" - t.integer "wikis_synced_count" - t.integer "wikis_failed_count" - t.integer "job_artifacts_count" - t.integer "job_artifacts_synced_count" - t.integer "job_artifacts_failed_count" - t.string "version" - t.string "revision" - t.integer "repositories_verified_count" - t.integer "repositories_verification_failed_count" - t.integer "wikis_verified_count" - t.integer "wikis_verification_failed_count" - t.integer "lfs_objects_synced_missing_on_primary_count" - t.integer "job_artifacts_synced_missing_on_primary_count" - t.integer "attachments_synced_missing_on_primary_count" - t.integer "repositories_checksummed_count" - t.integer "repositories_checksum_failed_count" - t.integer "repositories_checksum_mismatch_count" - t.integer "wikis_checksummed_count" - t.integer "wikis_checksum_failed_count" - t.integer "wikis_checksum_mismatch_count" - t.binary "storage_configuration_digest" - t.integer "repositories_retrying_verification_count" - t.integer "wikis_retrying_verification_count" - t.integer "projects_count" - t.index ["geo_node_id"], name: "index_geo_node_statuses_on_geo_node_id", unique: true, using: :btree - end - - create_table_if_not_exists "geo_nodes" do |t| - t.boolean "primary" - t.integer "oauth_application_id" - t.boolean "enabled", default: true, null: false - t.string "access_key" - t.string "encrypted_secret_access_key" - t.string "encrypted_secret_access_key_iv" - t.string "clone_url_prefix" - t.integer "files_max_capacity", default: 10, null: false - t.integer "repos_max_capacity", default: 25, null: false - t.string "url", null: false - t.string "selective_sync_type" - t.text "selective_sync_shards" - t.integer "verification_max_capacity", default: 100, null: false - t.integer "minimum_reverification_interval", default: 7, null: false - t.string "alternate_url" - t.index ["access_key"], name: "index_geo_nodes_on_access_key", using: :btree - t.index ["primary"], name: "index_geo_nodes_on_primary", using: :btree - t.index ["url"], name: "index_geo_nodes_on_url", unique: true, using: :btree - end - - create_table_if_not_exists "geo_repositories_changed_events", id: :bigserial do |t| - t.integer "geo_node_id", null: false - t.index ["geo_node_id"], name: "index_geo_repositories_changed_events_on_geo_node_id", using: :btree - end - - create_table_if_not_exists "geo_repository_created_events", id: :bigserial do |t| - t.integer "project_id", null: false - t.text "repository_storage_name", null: false - t.text "repo_path", null: false - t.text "wiki_path" - t.text "project_name", null: false - t.index ["project_id"], name: "index_geo_repository_created_events_on_project_id", using: :btree - end - - create_table_if_not_exists "geo_repository_deleted_events", id: :bigserial do |t| - t.integer "project_id", null: false - t.text "repository_storage_name", null: false - t.text "deleted_path", null: false - t.text "deleted_wiki_path" - t.text "deleted_project_name", null: false - t.index ["project_id"], name: "index_geo_repository_deleted_events_on_project_id", using: :btree - end - - create_table_if_not_exists "geo_repository_renamed_events", id: :bigserial do |t| - t.integer "project_id", null: false - t.text "repository_storage_name", null: false - t.text "old_path_with_namespace", null: false - t.text "new_path_with_namespace", null: false - t.text "old_wiki_path_with_namespace", null: false - t.text "new_wiki_path_with_namespace", null: false - t.text "old_path", null: false - t.text "new_path", null: false - t.index ["project_id"], name: "index_geo_repository_renamed_events_on_project_id", using: :btree - end - - create_table_if_not_exists "geo_repository_updated_events", id: :bigserial do |t| - t.integer "branches_affected", null: false - t.integer "tags_affected", null: false - t.integer "project_id", null: false - t.integer "source", limit: 2, null: false - t.boolean "new_branch", default: false, null: false - t.boolean "remove_branch", default: false, null: false - t.text "ref" - t.index ["project_id"], name: "index_geo_repository_updated_events_on_project_id", using: :btree - t.index ["source"], name: "index_geo_repository_updated_events_on_source", using: :btree - end - - create_table_if_not_exists "geo_reset_checksum_events", id: :bigserial do |t| - t.integer "project_id", null: false - t.index ["project_id"], name: "index_geo_reset_checksum_events_on_project_id", using: :btree - end - - create_table_if_not_exists "geo_upload_deleted_events", id: :bigserial do |t| - t.integer "upload_id", null: false - t.string "file_path", null: false - t.integer "model_id", null: false - t.string "model_type", null: false - t.string "uploader", null: false - t.index ["upload_id"], name: "index_geo_upload_deleted_events_on_upload_id", using: :btree - end - - create_table_if_not_exists "gitlab_subscriptions", id: :bigserial do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.date "start_date" - t.date "end_date" - t.date "trial_ends_on" - t.integer "namespace_id" - t.integer "hosted_plan_id" - t.integer "max_seats_used", default: 0 - t.integer "seats", default: 0 - t.boolean "trial", default: false - t.index ["hosted_plan_id"], name: "index_gitlab_subscriptions_on_hosted_plan_id", using: :btree - t.index ["namespace_id"], name: "index_gitlab_subscriptions_on_namespace_id", unique: true, using: :btree - end - - create_table_if_not_exists "historical_data" do |t| - t.date "date", null: false - t.integer "active_user_count" - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table_if_not_exists "index_statuses" do |t| - t.integer "project_id", null: false - t.datetime "indexed_at" - t.text "note" - t.string "last_commit" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["project_id"], name: "index_index_statuses_on_project_id", unique: true, using: :btree - end - - create_table_if_not_exists "insights" do |t| - t.integer "namespace_id", null: false - t.integer "project_id", null: false - t.index ["namespace_id"], name: "index_insights_on_namespace_id", using: :btree - t.index ["project_id"], name: "index_insights_on_project_id", using: :btree - end - - create_table_if_not_exists "issue_links" do |t| - t.integer "source_id", null: false - t.integer "target_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.index %w[source_id target_id], name: "index_issue_links_on_source_id_and_target_id", unique: true, using: :btree - t.index ["source_id"], name: "index_issue_links_on_source_id", using: :btree - t.index ["target_id"], name: "index_issue_links_on_target_id", using: :btree - end - - create_table_if_not_exists "jira_connect_installations", id: :bigserial do |t| - t.string "client_key" - t.string "encrypted_shared_secret" - t.string "encrypted_shared_secret_iv" - t.string "base_url" - t.index ["client_key"], name: "index_jira_connect_installations_on_client_key", unique: true, using: :btree - end - - create_table_if_not_exists "jira_connect_subscriptions", id: :bigserial do |t| - t.datetime_with_timezone "created_at", null: false - t.bigint "jira_connect_installation_id", null: false - t.integer "namespace_id", null: false - t.datetime_with_timezone "updated_at", null: false - t.index %w[jira_connect_installation_id namespace_id], name: "idx_jira_connect_subscriptions_on_installation_id_namespace_id", unique: true, using: :btree - t.index ["jira_connect_installation_id"], name: "idx_jira_connect_subscriptions_on_installation_id", using: :btree - t.index ["namespace_id"], name: "index_jira_connect_subscriptions_on_namespace_id", using: :btree - end - - create_table_if_not_exists "ldap_group_links" do |t| - t.string "cn" - t.integer "group_access", null: false - t.integer "group_id", null: false - t.datetime "created_at" - t.datetime "updated_at" - t.string "provider" - t.string "filter" - end - - create_table_if_not_exists "licenses" do |t| - t.text "data", null: false - t.datetime "created_at" - t.datetime "updated_at" - end - - create_table_if_not_exists "namespace_statistics" do |t| - t.integer "namespace_id", null: false - t.integer "shared_runners_seconds", default: 0, null: false - t.datetime "shared_runners_seconds_last_reset" - t.index ["namespace_id"], name: "index_namespace_statistics_on_namespace_id", unique: true, using: :btree - end - - create_table_if_not_exists "operations_feature_flag_scopes", id: :bigserial do |t| - t.bigint "feature_flag_id", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.boolean "active", null: false - t.string "environment_scope", default: "*", null: false - t.index %w[feature_flag_id environment_scope], name: "index_feature_flag_scopes_on_flag_id_and_environment_scope", unique: true, using: :btree - end - - create_table_if_not_exists "operations_feature_flags", id: :bigserial do |t| - t.integer "project_id", null: false - t.boolean "active", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.string "name", null: false - t.text "description" - t.index %w[project_id name], name: "index_operations_feature_flags_on_project_id_and_name", unique: true, using: :btree - end - - create_table_if_not_exists "operations_feature_flags_clients", id: :bigserial do |t| - t.integer "project_id", null: false - t.string "token", null: false - t.index %w[project_id token], name: "index_operations_feature_flags_clients_on_project_id_and_token", unique: true, using: :btree - end - - create_table_if_not_exists "packages_maven_metadata", id: :bigserial do |t| - t.bigint "package_id", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.string "app_group", null: false - t.string "app_name", null: false - t.string "app_version" - t.string "path", limit: 512, null: false - t.index %w[package_id path], name: "index_packages_maven_metadata_on_package_id_and_path", using: :btree - end - - create_table_if_not_exists "packages_package_files", id: :bigserial do |t| - t.bigint "package_id", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.bigint "size" - t.integer "file_type" - t.integer "file_store" - t.binary "file_md5" - t.binary "file_sha1" - t.string "file_name", null: false - t.text "file", null: false - t.index %w[package_id file_name], name: "index_packages_package_files_on_package_id_and_file_name", using: :btree - end - - create_table_if_not_exists "packages_packages", id: :bigserial do |t| - t.integer "project_id", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.string "name", null: false - t.string "version" - t.integer "package_type", limit: 2, null: false - t.index ["project_id"], name: "index_packages_packages_on_project_id", using: :btree - end - - create_table_if_not_exists "path_locks" do |t| - t.string "path", null: false - t.integer "project_id" - t.integer "user_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["path"], name: "index_path_locks_on_path", using: :btree - t.index ["project_id"], name: "index_path_locks_on_project_id", using: :btree - t.index ["user_id"], name: "index_path_locks_on_user_id", using: :btree - end - - create_table_if_not_exists "plans" do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "name" - t.string "title" - t.integer "active_pipelines_limit" - t.integer "pipeline_size_limit" - t.index ["name"], name: "index_plans_on_name", using: :btree - end - - create_table_if_not_exists "project_alerting_settings", primary_key: "project_id", id: :integer do |t| - t.string "encrypted_token", null: false - t.string "encrypted_token_iv", null: false - end - - create_table_if_not_exists "project_feature_usages", primary_key: "project_id", id: :integer do |t| - t.datetime "jira_dvcs_cloud_last_sync_at" - t.datetime "jira_dvcs_server_last_sync_at" - t.index %w[jira_dvcs_cloud_last_sync_at project_id], name: "idx_proj_feat_usg_on_jira_dvcs_cloud_last_sync_at_and_proj_id", where: "(jira_dvcs_cloud_last_sync_at IS NOT NULL)", using: :btree - t.index %w[jira_dvcs_server_last_sync_at project_id], name: "idx_proj_feat_usg_on_jira_dvcs_server_last_sync_at_and_proj_id", where: "(jira_dvcs_server_last_sync_at IS NOT NULL)", using: :btree - t.index ["project_id"], name: "index_project_feature_usages_on_project_id", using: :btree - end - - create_table_if_not_exists "project_incident_management_settings", primary_key: "project_id", id: :integer do |t| - t.boolean "create_issue", default: false, null: false - t.boolean "send_email", default: true, null: false - t.text "issue_template_key" - end - - create_table_if_not_exists "project_repository_states" do |t| - t.integer "project_id", null: false - t.binary "repository_verification_checksum" - t.binary "wiki_verification_checksum" - t.string "last_repository_verification_failure" - t.string "last_wiki_verification_failure" - t.datetime_with_timezone "repository_retry_at" - t.datetime_with_timezone "wiki_retry_at" - t.integer "repository_retry_count" - t.integer "wiki_retry_count" - t.datetime_with_timezone "last_repository_verification_ran_at" - t.datetime_with_timezone "last_wiki_verification_ran_at" - t.index ["last_repository_verification_failure"], name: "idx_repository_states_on_repository_failure_partial", where: "(last_repository_verification_failure IS NOT NULL)", using: :btree - t.index ["last_wiki_verification_failure"], name: "idx_repository_states_on_wiki_failure_partial", where: "(last_wiki_verification_failure IS NOT NULL)", using: :btree - t.index %w[project_id last_repository_verification_ran_at], name: "idx_repository_states_on_last_repository_verification_ran_at", where: "((repository_verification_checksum IS NOT NULL) AND (last_repository_verification_failure IS NULL))", using: :btree - t.index %w[project_id last_wiki_verification_ran_at], name: "idx_repository_states_on_last_wiki_verification_ran_at", where: "((wiki_verification_checksum IS NOT NULL) AND (last_wiki_verification_failure IS NULL))", using: :btree - t.index ["project_id"], name: "idx_repository_states_outdated_checksums", where: "(((repository_verification_checksum IS NULL) AND (last_repository_verification_failure IS NULL)) OR ((wiki_verification_checksum IS NULL) AND (last_wiki_verification_failure IS NULL)))", using: :btree - t.index ["project_id"], name: "index_project_repository_states_on_project_id", unique: true, using: :btree - end - - create_table_if_not_exists "project_tracing_settings", id: :bigserial do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "project_id", null: false - t.string "external_url", null: false - t.index ["project_id"], name: "index_project_tracing_settings_on_project_id", unique: true, using: :btree - end - - create_table_if_not_exists "prometheus_alert_events", id: :bigserial do |t| - t.integer "project_id", null: false - t.integer "prometheus_alert_id", null: false - t.datetime_with_timezone "started_at", null: false - t.datetime_with_timezone "ended_at" - t.integer "status", limit: 2 - t.string "payload_key" - t.index %w[project_id status], name: "index_prometheus_alert_events_on_project_id_and_status", using: :btree - t.index %w[prometheus_alert_id payload_key], name: "index_prometheus_alert_event_scoped_payload_key", unique: true, using: :btree - end - - create_table_if_not_exists "prometheus_alerts" do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.float "threshold", null: false - t.integer "operator", null: false - t.integer "environment_id", null: false - t.integer "project_id", null: false - t.integer "prometheus_metric_id", null: false - t.index ["environment_id"], name: "index_prometheus_alerts_on_environment_id", using: :btree - t.index %w[project_id prometheus_metric_id environment_id], name: "index_prometheus_alerts_metric_environment", unique: true, using: :btree - t.index ["prometheus_metric_id"], name: "index_prometheus_alerts_on_prometheus_metric_id", using: :btree - end - - create_table_if_not_exists "protected_branch_unprotect_access_levels" do |t| - t.integer "protected_branch_id", null: false - t.integer "access_level", default: 40 - t.integer "user_id" - t.integer "group_id" - t.index ["group_id"], name: "index_protected_branch_unprotect_access_levels_on_group_id", using: :btree - t.index ["protected_branch_id"], name: "index_protected_branch_unprotect_access", using: :btree - t.index ["user_id"], name: "index_protected_branch_unprotect_access_levels_on_user_id", using: :btree - end - - create_table_if_not_exists "protected_environment_deploy_access_levels" do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "access_level", default: 40 - t.integer "protected_environment_id", null: false - t.integer "user_id" - t.integer "group_id" - t.index ["group_id"], name: "index_protected_environment_deploy_access_levels_on_group_id", using: :btree - t.index ["protected_environment_id"], name: "index_protected_environment_deploy_access", using: :btree - t.index ["user_id"], name: "index_protected_environment_deploy_access_levels_on_user_id", using: :btree - end - - create_table_if_not_exists "protected_environments" do |t| - t.integer "project_id", null: false - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.string "name", null: false - t.index %w[project_id name], name: "index_protected_environments_on_project_id_and_name", unique: true, using: :btree - t.index ["project_id"], name: "index_protected_environments_on_project_id", using: :btree - end - - create_table_if_not_exists "push_rules" do |t| - t.string "force_push_regex" - t.string "delete_branch_regex" - t.string "commit_message_regex" - t.boolean "deny_delete_tag" - t.integer "project_id" - t.datetime "created_at" - t.datetime "updated_at" - t.string "author_email_regex" - t.boolean "member_check", default: false, null: false - t.string "file_name_regex" - t.boolean "is_sample", default: false - t.integer "max_file_size", default: 0, null: false - t.boolean "prevent_secrets", default: false, null: false - t.string "branch_name_regex" - t.boolean "reject_unsigned_commits" - t.boolean "commit_committer_check" - t.boolean "regexp_uses_re2", default: true - t.string "commit_message_negative_regex" - t.index ["is_sample"], name: "index_push_rules_on_is_sample", where: "is_sample", using: :btree - t.index ["project_id"], name: "index_push_rules_on_project_id", using: :btree - end - - create_table_if_not_exists "reviews", id: :bigserial do |t| - t.integer "author_id" - t.integer "merge_request_id", null: false - t.integer "project_id", null: false - t.datetime_with_timezone "created_at", null: false - t.index ["author_id"], name: "index_reviews_on_author_id", using: :btree - t.index ["merge_request_id"], name: "index_reviews_on_merge_request_id", using: :btree - t.index ["project_id"], name: "index_reviews_on_project_id", using: :btree - end - - create_table_if_not_exists "saml_providers" do |t| - t.integer "group_id", null: false - t.boolean "enabled", null: false - t.string "certificate_fingerprint", null: false - t.string "sso_url", null: false - t.boolean "enforced_sso", default: false, null: false - t.boolean "enforced_group_managed_accounts", default: false, null: false - t.index ["group_id"], name: "index_saml_providers_on_group_id", using: :btree - end - - create_table_if_not_exists "scim_oauth_access_tokens" do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "group_id", null: false - t.string "token_encrypted", null: false - t.index %w[group_id token_encrypted], name: "index_scim_oauth_access_tokens_on_group_id_and_token_encrypted", unique: true, using: :btree - end - - create_table_if_not_exists "slack_integrations" do |t| - t.integer "service_id", null: false - t.string "team_id", null: false - t.string "team_name", null: false - t.string "alias", null: false - t.string "user_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["service_id"], name: "index_slack_integrations_on_service_id", using: :btree - t.index %w[team_id alias], name: "index_slack_integrations_on_team_id_and_alias", unique: true, using: :btree - end - - create_table_if_not_exists "smartcard_identities", id: :bigserial do |t| - t.integer "user_id", null: false - t.string "subject", null: false - t.string "issuer", null: false - t.index %w[subject issuer], name: "index_smartcard_identities_on_subject_and_issuer", unique: true, using: :btree - t.index ["user_id"], name: "index_smartcard_identities_on_user_id", using: :btree - end - - create_table_if_not_exists "software_license_policies" do |t| - t.integer "project_id", null: false - t.integer "software_license_id", null: false - t.integer "approval_status", default: 0, null: false - t.index %w[project_id software_license_id], name: "index_software_license_policies_unique_per_project", unique: true, using: :btree - t.index ["software_license_id"], name: "index_software_license_policies_on_software_license_id", using: :btree - end - - create_table_if_not_exists "software_licenses" do |t| - t.string "name", null: false - t.index ["name"], name: "index_software_licenses_on_name", using: :btree - end - - create_table_if_not_exists "users_ops_dashboard_projects", id: :bigserial do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "user_id", null: false - t.integer "project_id", null: false - t.index ["project_id"], name: "index_users_ops_dashboard_projects_on_project_id", using: :btree - t.index %w[user_id project_id], name: "index_users_ops_dashboard_projects_on_user_id_and_project_id", unique: true, using: :btree - end - - create_table_if_not_exists "vulnerability_feedback" do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "feedback_type", limit: 2, null: false - t.integer "category", limit: 2, null: false - t.integer "project_id", null: false - t.integer "author_id", null: false - t.integer "pipeline_id" - t.integer "issue_id" - t.string "project_fingerprint", limit: 40, null: false - t.integer "merge_request_id" - t.index ["author_id"], name: "index_vulnerability_feedback_on_author_id", using: :btree - t.index ["issue_id"], name: "index_vulnerability_feedback_on_issue_id", using: :btree - t.index ["merge_request_id"], name: "index_vulnerability_feedback_on_merge_request_id", using: :btree - t.index ["pipeline_id"], name: "index_vulnerability_feedback_on_pipeline_id", using: :btree - t.index %w[project_id category feedback_type project_fingerprint], name: "vulnerability_feedback_unique_idx", unique: true, using: :btree - end - - create_table_if_not_exists "vulnerability_identifiers", id: :bigserial do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "project_id", null: false - t.binary "fingerprint", null: false - t.string "external_type", null: false - t.string "external_id", null: false - t.string "name", null: false - t.text "url" - t.index %w[project_id fingerprint], name: "index_vulnerability_identifiers_on_project_id_and_fingerprint", unique: true, using: :btree - end - - create_table_if_not_exists "vulnerability_occurrence_identifiers", id: :bigserial do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.bigint "occurrence_id", null: false - t.bigint "identifier_id", null: false - t.index ["identifier_id"], name: "index_vulnerability_occurrence_identifiers_on_identifier_id", using: :btree - t.index %w[occurrence_id identifier_id], name: "index_vulnerability_occurrence_identifiers_on_unique_keys", unique: true, using: :btree - end - - create_table_if_not_exists "vulnerability_occurrence_pipelines", id: :bigserial do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.bigint "occurrence_id", null: false - t.integer "pipeline_id", null: false - t.index %w[occurrence_id pipeline_id], name: "vulnerability_occurrence_pipelines_on_unique_keys", unique: true, using: :btree - t.index ["pipeline_id"], name: "index_vulnerability_occurrence_pipelines_on_pipeline_id", using: :btree - end - - create_table_if_not_exists "vulnerability_occurrences", id: :bigserial do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "severity", limit: 2, null: false - t.integer "confidence", limit: 2, null: false - t.integer "report_type", limit: 2, null: false - t.integer "project_id", null: false - t.bigint "scanner_id", null: false - t.bigint "primary_identifier_id", null: false - t.binary "project_fingerprint", null: false - t.binary "location_fingerprint", null: false - t.string "uuid", limit: 36, null: false - t.string "name", null: false - t.string "metadata_version", null: false - t.text "raw_metadata", null: false - t.index ["primary_identifier_id"], name: "index_vulnerability_occurrences_on_primary_identifier_id", using: :btree - t.index %w[project_id primary_identifier_id location_fingerprint scanner_id], name: "index_vulnerability_occurrences_on_unique_keys", unique: true, using: :btree - t.index ["scanner_id"], name: "index_vulnerability_occurrences_on_scanner_id", using: :btree - t.index ["uuid"], name: "index_vulnerability_occurrences_on_uuid", unique: true, using: :btree - end - - create_table_if_not_exists "vulnerability_scanners", id: :bigserial do |t| - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.integer "project_id", null: false - t.string "external_id", null: false - t.string "name", null: false - t.index %w[project_id external_id], name: "index_vulnerability_scanners_on_project_id_and_external_id", unique: true, using: :btree - end - - create_table_if_not_exists "dependency_proxy_blobs", id: :serial do |t| - t.datetime_with_timezone "created_at", null: false - t.text "file", null: false - t.string "file_name", null: false - t.integer "file_store" - t.integer "group_id", null: false - t.bigint "size" - t.datetime_with_timezone "updated_at", null: false - t.index %w[group_id file_name], name: "index_dependency_proxy_blobs_on_group_id_and_file_name", using: :btree - end - - create_table_if_not_exists "dependency_proxy_group_settings", id: :serial do |t| - t.datetime_with_timezone "created_at", null: false - t.boolean "enabled", default: false, null: false - t.integer "group_id", null: false - t.datetime_with_timezone "updated_at", null: false - t.index ["group_id"], name: "index_dependency_proxy_group_settings_on_group_id", using: :btree - end - end - - def remove_tables - drop_table_if_exists "approval_merge_request_rule_sources" - drop_table_if_exists "approval_merge_request_rules" - drop_table_if_exists "approval_merge_request_rules_approved_approvers" - drop_table_if_exists "approval_merge_request_rules_groups" - drop_table_if_exists "approval_merge_request_rules_users" - drop_table_if_exists "approval_project_rules" - drop_table_if_exists "approval_project_rules_groups" - drop_table_if_exists "approval_project_rules_users" - drop_table_if_exists "approvals" - drop_table_if_exists "approver_groups" - drop_table_if_exists "approvers" - drop_table_if_exists "board_assignees" - drop_table_if_exists "board_labels" - drop_table_if_exists "ci_sources_pipelines" - drop_table_if_exists "design_management_designs_versions" - drop_table_if_exists "design_management_versions" - drop_table_if_exists "design_management_designs" - drop_table_if_exists "draft_notes" - drop_table_if_exists "elasticsearch_indexed_namespaces" - drop_table_if_exists "elasticsearch_indexed_projects" - drop_table_if_exists "epic_issues" - drop_table_if_exists "epic_metrics" - drop_table_if_exists "epics" - drop_table_if_exists "geo_cache_invalidation_events" - drop_table_if_exists "geo_event_log" - drop_table_if_exists "geo_hashed_storage_attachments_events" - drop_table_if_exists "geo_hashed_storage_migrated_events" - drop_table_if_exists "geo_job_artifact_deleted_events" - drop_table_if_exists "geo_lfs_object_deleted_events" - drop_table_if_exists "geo_node_namespace_links" - drop_table_if_exists "geo_node_statuses" - drop_table_if_exists "geo_nodes" - drop_table_if_exists "geo_repositories_changed_events" - drop_table_if_exists "geo_repository_created_events" - drop_table_if_exists "geo_repository_deleted_events" - drop_table_if_exists "geo_repository_renamed_events" - drop_table_if_exists "geo_repository_updated_events" - drop_table_if_exists "geo_reset_checksum_events" - drop_table_if_exists "geo_upload_deleted_events" - drop_table_if_exists "gitlab_subscriptions" - drop_table_if_exists "historical_data" - drop_table_if_exists "index_statuses" - drop_table_if_exists "insights" - drop_table_if_exists "issue_links" - drop_table_if_exists "jira_connect_subscriptions" - drop_table_if_exists "jira_connect_installations" - drop_table_if_exists "ldap_group_links" - drop_table_if_exists "licenses" - drop_table_if_exists "namespace_statistics" - drop_table_if_exists "operations_feature_flag_scopes" - drop_table_if_exists "operations_feature_flags" - drop_table_if_exists "operations_feature_flags_clients" - drop_table_if_exists "packages_maven_metadata" - drop_table_if_exists "packages_package_files" - drop_table_if_exists "packages_packages" - drop_table_if_exists "path_locks" - drop_table_if_exists "plans" - drop_table_if_exists "project_alerting_settings" - drop_table_if_exists "project_feature_usages" - drop_table_if_exists "project_incident_management_settings" - drop_table_if_exists "project_repository_states" - drop_table_if_exists "project_tracing_settings" - drop_table_if_exists "prometheus_alert_events" - drop_table_if_exists "prometheus_alerts" - drop_table_if_exists "protected_branch_unprotect_access_levels" - drop_table_if_exists "protected_environment_deploy_access_levels" - drop_table_if_exists "protected_environments" - drop_table_if_exists "push_rules" - drop_table_if_exists "reviews" - drop_table_if_exists "saml_providers" - drop_table_if_exists "scim_oauth_access_tokens" - drop_table_if_exists "slack_integrations" - drop_table_if_exists "smartcard_identities" - drop_table_if_exists "software_license_policies" - drop_table_if_exists "software_licenses" - drop_table_if_exists "users_ops_dashboard_projects" - drop_table_if_exists "vulnerability_feedback" - drop_table_if_exists "vulnerability_identifiers" - drop_table_if_exists "vulnerability_occurrence_identifiers" - drop_table_if_exists "vulnerability_occurrence_pipelines" - drop_table_if_exists "vulnerability_occurrences" - drop_table_if_exists "vulnerability_scanners" - drop_table_if_exists "dependency_proxy_blobs" - drop_table_if_exists "dependency_proxy_group_settings" - end - - def add_missing_foreign_keys - add_concurrent_foreign_key("application_settings", "namespaces", column: "custom_project_templates_group_id", name: "fk_rails_b53e481273", on_delete: :nullify) - add_concurrent_foreign_key("application_settings", "projects", column: "file_template_project_id", name: "fk_ec757bd087", on_delete: :nullify) - add_concurrent_foreign_key("approval_merge_request_rule_sources", "approval_merge_request_rules", column: "approval_merge_request_rule_id", name: "fk_rails_e605a04f76", on_delete: :cascade) - add_concurrent_foreign_key("approval_merge_request_rule_sources", "approval_project_rules", column: "approval_project_rule_id", name: "fk_rails_64e8ed3c7e", on_delete: :cascade) - add_concurrent_foreign_key("approval_merge_request_rules", "merge_requests", column: "merge_request_id", name: "fk_rails_004ce82224", on_delete: :cascade) - add_concurrent_foreign_key("approval_merge_request_rules_approved_approvers", "approval_merge_request_rules", column: "approval_merge_request_rule_id", name: "fk_rails_6577725edb", on_delete: :cascade) - add_concurrent_foreign_key("approval_merge_request_rules_approved_approvers", "users", column: "user_id", name: "fk_rails_8dc94cff4d", on_delete: :cascade) - add_concurrent_foreign_key("approval_merge_request_rules_groups", "approval_merge_request_rules", column: "approval_merge_request_rule_id", name: "fk_rails_5b2ecf6139", on_delete: :cascade) - add_concurrent_foreign_key("approval_merge_request_rules_groups", "namespaces", column: "group_id", name: "fk_rails_2020a7124a", on_delete: :cascade) - add_concurrent_foreign_key("approval_merge_request_rules_users", "approval_merge_request_rules", column: "approval_merge_request_rule_id", name: "fk_rails_80e6801803", on_delete: :cascade) - add_concurrent_foreign_key("approval_merge_request_rules_users", "users", column: "user_id", name: "fk_rails_bc8972fa55", on_delete: :cascade) - add_concurrent_foreign_key("approval_project_rules", "projects", column: "project_id", name: "fk_rails_5fb4dd100b", on_delete: :cascade) - add_concurrent_foreign_key("approval_project_rules_groups", "approval_project_rules", column: "approval_project_rule_id", name: "fk_rails_9071e863d1", on_delete: :cascade) - add_concurrent_foreign_key("approval_project_rules_groups", "namespaces", column: "group_id", name: "fk_rails_396841e79e", on_delete: :cascade) - add_concurrent_foreign_key("approval_project_rules_users", "approval_project_rules", column: "approval_project_rule_id", name: "fk_rails_b9e9394efb", on_delete: :cascade) - add_concurrent_foreign_key("approval_project_rules_users", "users", column: "user_id", name: "fk_rails_f365da8250", on_delete: :cascade) - add_concurrent_foreign_key("approvals", "merge_requests", column: "merge_request_id", name: "fk_310d714958", on_delete: :cascade) - add_concurrent_foreign_key("approver_groups", "namespaces", column: "group_id", name: "fk_rails_1cdcbd7723", on_delete: :cascade) - add_concurrent_foreign_key("board_assignees", "boards", column: "board_id", name: "fk_rails_3f6f926bd5", on_delete: :cascade) - add_concurrent_foreign_key("board_assignees", "users", column: "assignee_id", name: "fk_rails_1c0ff59e82", on_delete: :cascade) - add_concurrent_foreign_key("board_labels", "boards", column: "board_id", name: "fk_rails_9374a16edd", on_delete: :cascade) - add_concurrent_foreign_key("board_labels", "labels", column: "label_id", name: "fk_rails_362b0600a3", on_delete: :cascade) - add_concurrent_foreign_key("ci_sources_pipelines", "ci_builds", column: "source_job_id", name: "fk_be5624bf37", on_delete: :cascade) - add_concurrent_foreign_key("ci_sources_pipelines", "ci_pipelines", column: "pipeline_id", name: "fk_e1bad85861", on_delete: :cascade) - add_concurrent_foreign_key("ci_sources_pipelines", "ci_pipelines", column: "source_pipeline_id", name: "fk_d4e29af7d7", on_delete: :cascade) - add_concurrent_foreign_key("ci_sources_pipelines", "projects", column: "source_project_id", name: "fk_acd9737679", on_delete: :cascade) - add_concurrent_foreign_key("ci_sources_pipelines", "projects", column: "project_id", name: "fk_1e53c97c0a", on_delete: :cascade) - add_concurrent_foreign_key("design_management_designs", "issues", column: "issue_id", name: "fk_rails_bfe283ec3c", on_delete: :cascade) - add_concurrent_foreign_key("design_management_designs", "projects", column: "project_id", name: "fk_rails_4bb1073360", on_delete: :cascade) - add_concurrent_foreign_key("design_management_designs_versions", "design_management_designs", column: "design_id", on_delete: :cascade) - add_concurrent_foreign_key("design_management_designs_versions", "design_management_versions", column: "version_id", on_delete: :cascade) - add_concurrent_foreign_key("draft_notes", "merge_requests", column: "merge_request_id", name: "fk_rails_e753681674", on_delete: :cascade) - add_concurrent_foreign_key("draft_notes", "users", column: "author_id", name: "fk_rails_2a8dac9901", on_delete: :cascade) - add_concurrent_foreign_key("elasticsearch_indexed_namespaces", "namespaces", column: "namespace_id", name: "fk_rails_bdcf044f37", on_delete: :cascade) - add_concurrent_foreign_key("elasticsearch_indexed_projects", "projects", column: "project_id", name: "fk_rails_bd13bbdc3d", on_delete: :cascade) - add_concurrent_foreign_key("epic_issues", "epics", column: "epic_id", name: "fk_rails_5d942936b4", on_delete: :cascade) - add_concurrent_foreign_key("epic_issues", "issues", column: "issue_id", name: "fk_rails_4209981af6", on_delete: :cascade) - add_concurrent_foreign_key("epic_metrics", "epics", column: "epic_id", name: "fk_rails_d071904753", on_delete: :cascade) - add_concurrent_foreign_key("epics", "epics", column: "parent_id", name: "fk_25b99c1be3", on_delete: :cascade) - add_concurrent_foreign_key("epics", "milestones", column: "milestone_id", name: "fk_rails_1bf671ebb7", on_delete: :nullify) - add_concurrent_foreign_key("epics", "namespaces", column: "group_id", name: "fk_f081aa4489", on_delete: :cascade) - add_concurrent_foreign_key("epics", "users", column: "assignee_id", name: "fk_dccd3f98fc", on_delete: :nullify) - add_concurrent_foreign_key("epics", "users", column: "author_id", name: "fk_3654b61b03", on_delete: :cascade) - add_concurrent_foreign_key("epics", "users", column: "closed_by_id", name: "fk_aa5798e761", on_delete: :nullify) - add_concurrent_foreign_key("geo_event_log", "geo_cache_invalidation_events", column: "cache_invalidation_event_id", name: "fk_42c3b54bed", on_delete: :cascade) - add_concurrent_foreign_key("geo_event_log", "geo_hashed_storage_migrated_events", column: "hashed_storage_migrated_event_id", name: "fk_27548c6db3", on_delete: :cascade) - add_concurrent_foreign_key("geo_event_log", "geo_job_artifact_deleted_events", column: "job_artifact_deleted_event_id", name: "fk_176d3fbb5d", on_delete: :cascade) - add_concurrent_foreign_key("geo_event_log", "geo_lfs_object_deleted_events", column: "lfs_object_deleted_event_id", name: "fk_d5af95fcd9", on_delete: :cascade) - add_concurrent_foreign_key("geo_event_log", "geo_repositories_changed_events", column: "repositories_changed_event_id", name: "fk_4a99ebfd60", on_delete: :cascade) - add_concurrent_foreign_key("geo_event_log", "geo_repository_created_events", column: "repository_created_event_id", name: "fk_9b9afb1916", on_delete: :cascade) - add_concurrent_foreign_key("geo_event_log", "geo_repository_deleted_events", column: "repository_deleted_event_id", name: "fk_c4b1c1f66e", on_delete: :cascade) - add_concurrent_foreign_key("geo_event_log", "geo_repository_renamed_events", column: "repository_renamed_event_id", name: "fk_86c84214ec", on_delete: :cascade) - add_concurrent_foreign_key("geo_event_log", "geo_repository_updated_events", column: "repository_updated_event_id", name: "fk_78a6492f68", on_delete: :cascade) - add_concurrent_foreign_key("geo_event_log", "geo_reset_checksum_events", column: "reset_checksum_event_id", name: "fk_cff7185ad2", on_delete: :cascade) - add_concurrent_foreign_key("geo_event_log", "geo_upload_deleted_events", column: "upload_deleted_event_id", name: "fk_c1f241c70d", on_delete: :cascade) - add_concurrent_foreign_key("geo_hashed_storage_attachments_events", "projects", column: "project_id", name: "fk_rails_d496b088e9", on_delete: :cascade) - add_concurrent_foreign_key("geo_hashed_storage_migrated_events", "projects", column: "project_id", name: "fk_rails_687ed7d7c5", on_delete: :cascade) - add_concurrent_foreign_key("geo_node_namespace_links", "geo_nodes", column: "geo_node_id", name: "fk_rails_546bf08d3e", on_delete: :cascade) - add_concurrent_foreign_key("geo_node_namespace_links", "namespaces", column: "namespace_id", name: "fk_rails_41ff5fb854", on_delete: :cascade) - add_concurrent_foreign_key("geo_node_statuses", "geo_nodes", column: "geo_node_id", name: "fk_rails_0ecc699c2a", on_delete: :cascade) - add_concurrent_foreign_key("geo_repositories_changed_events", "geo_nodes", column: "geo_node_id", name: "fk_rails_75ec0fefcc", on_delete: :cascade) - add_concurrent_foreign_key("geo_repository_created_events", "projects", column: "project_id", name: "fk_rails_1f49e46a61", on_delete: :cascade) - add_concurrent_foreign_key("geo_repository_renamed_events", "projects", column: "project_id", name: "fk_rails_4e6524febb", on_delete: :cascade) - add_concurrent_foreign_key("geo_repository_updated_events", "projects", column: "project_id", name: "fk_rails_2b70854c08", on_delete: :cascade) - add_concurrent_foreign_key("geo_reset_checksum_events", "projects", column: "project_id", name: "fk_rails_910a06f12b", on_delete: :cascade) - add_concurrent_foreign_key("gitlab_subscriptions", "namespaces", column: "namespace_id", name: "fk_e2595d00a1", on_delete: :cascade) - add_concurrent_foreign_key("gitlab_subscriptions", "plans", column: "hosted_plan_id", name: "fk_bd0c4019c3", on_delete: :cascade) - add_concurrent_foreign_key("identities", "saml_providers", column: "saml_provider_id", name: "fk_aade90f0fc", on_delete: :cascade) - add_concurrent_foreign_key("index_statuses", "projects", column: "project_id", name: "fk_74b2492545", on_delete: :cascade) - add_concurrent_foreign_key("insights", "namespaces", column: "namespace_id", name: "fk_rails_5c4391f60a", on_delete: nil) - add_concurrent_foreign_key("insights", "projects", column: "project_id", name: "fk_rails_f36fda3932", on_delete: nil) - add_concurrent_foreign_key("issue_links", "issues", column: "source_id", name: "fk_c900194ff2", on_delete: :cascade) - add_concurrent_foreign_key("issue_links", "issues", column: "target_id", name: "fk_e71bb44f1f", on_delete: :cascade) - add_concurrent_foreign_key("lists", "milestones", column: "milestone_id", name: "fk_rails_baed5f39b7", on_delete: :cascade) - add_concurrent_foreign_key("lists", "users", column: "user_id", name: "fk_d6cf4279f7", on_delete: :cascade) - add_concurrent_foreign_key("namespace_statistics", "namespaces", column: "namespace_id", name: "fk_rails_0062050394", on_delete: :cascade) - add_concurrent_foreign_key("namespaces", "namespaces", column: "custom_project_templates_group_id", name: "fk_e7a0b20a6b", on_delete: :nullify) - add_concurrent_foreign_key("namespaces", "plans", column: "plan_id", name: "fk_fdd12e5b80", on_delete: :nullify) - add_concurrent_foreign_key("namespaces", "projects", column: "file_template_project_id", name: "fk_319256d87a", on_delete: :nullify) - add_concurrent_foreign_key("notes", "reviews", column: "review_id", name: "fk_2e82291620", on_delete: :nullify) - add_concurrent_foreign_key("operations_feature_flag_scopes", "operations_feature_flags", column: "feature_flag_id", name: "fk_rails_a50a04d0a4", on_delete: :cascade) - add_concurrent_foreign_key("operations_feature_flags", "projects", column: "project_id", name: "fk_rails_648e241be7", on_delete: :cascade) - add_concurrent_foreign_key("operations_feature_flags_clients", "projects", column: "project_id", name: "fk_rails_6650ed902c", on_delete: :cascade) - add_concurrent_foreign_key("packages_maven_metadata", "packages_packages", column: "package_id", name: "fk_be88aed360", on_delete: :cascade) - add_concurrent_foreign_key("packages_package_files", "packages_packages", column: "package_id", name: "fk_86f0f182f8", on_delete: :cascade) - add_concurrent_foreign_key("packages_packages", "projects", column: "project_id", name: "fk_rails_e1ac527425", on_delete: :cascade) - add_concurrent_foreign_key("path_locks", "projects", column: "project_id", name: "fk_5265c98f24", on_delete: :cascade) - add_concurrent_foreign_key("path_locks", "users", column: "user_id", name: "fk_rails_762cdcf942", on_delete: nil) - add_concurrent_foreign_key("project_alerting_settings", "projects", column: "project_id", name: "fk_rails_27a84b407d", on_delete: :cascade) - add_concurrent_foreign_key("project_feature_usages", "projects", column: "project_id", name: "fk_rails_c22a50024b", on_delete: :cascade) - add_concurrent_foreign_key("project_incident_management_settings", "projects", column: "project_id", name: "fk_rails_9c2ea1b7dd", on_delete: :cascade) - add_concurrent_foreign_key("project_repository_states", "projects", column: "project_id", name: "fk_rails_0f2298ca8a", on_delete: :cascade) - add_concurrent_foreign_key("project_tracing_settings", "projects", column: "project_id", name: "fk_rails_fe56f57fc6", on_delete: :cascade) - add_concurrent_foreign_key("prometheus_alert_events", "projects", column: "project_id", name: "fk_rails_4675865839", on_delete: :cascade) - add_concurrent_foreign_key("prometheus_alert_events", "prometheus_alerts", column: "prometheus_alert_id", name: "fk_rails_106f901176", on_delete: :cascade) - add_concurrent_foreign_key("prometheus_alerts", "environments", column: "environment_id", name: "fk_rails_6d9b283465", on_delete: :cascade) - add_concurrent_foreign_key("prometheus_alerts", "projects", column: "project_id", name: "fk_rails_f0e8db86aa", on_delete: :cascade) - add_concurrent_foreign_key("prometheus_alerts", "prometheus_metrics", column: "prometheus_metric_id", name: "fk_rails_e6351447ec", on_delete: :cascade) - add_concurrent_foreign_key("protected_branch_merge_access_levels", "namespaces", column: "group_id", name: "fk_98f3d044fe", on_delete: :cascade) - add_concurrent_foreign_key("protected_branch_merge_access_levels", "users", column: "user_id", name: "fk_rails_5ffb4f3590", on_delete: nil) - add_concurrent_foreign_key("protected_branch_push_access_levels", "namespaces", column: "group_id", name: "fk_7111b68cdb", on_delete: :cascade) - add_concurrent_foreign_key("protected_branch_push_access_levels", "users", column: "user_id", name: "fk_rails_8dcb712d65", on_delete: nil) - add_concurrent_foreign_key("protected_branch_unprotect_access_levels", "namespaces", column: "group_id", name: "fk_rails_5be1abfc25", on_delete: :cascade) - add_concurrent_foreign_key("protected_branch_unprotect_access_levels", "protected_branches", column: "protected_branch_id", name: "fk_rails_e9eb8dc025", on_delete: :cascade) - add_concurrent_foreign_key("protected_branch_unprotect_access_levels", "users", column: "user_id", name: "fk_rails_2d2aba21ef", on_delete: :cascade) - add_concurrent_foreign_key("protected_environment_deploy_access_levels", "namespaces", column: "group_id", name: "fk_rails_45cc02a931", on_delete: :cascade) - add_concurrent_foreign_key("protected_environment_deploy_access_levels", "protected_environments", column: "protected_environment_id", name: "fk_rails_898a13b650", on_delete: :cascade) - add_concurrent_foreign_key("protected_environment_deploy_access_levels", "users", column: "user_id", name: "fk_rails_5b9f6970fe", on_delete: :cascade) - add_concurrent_foreign_key("protected_environments", "projects", column: "project_id", name: "fk_rails_a354313d11", on_delete: :cascade) - add_concurrent_foreign_key("push_rules", "projects", column: "project_id", name: "fk_83b29894de", on_delete: :cascade) - add_concurrent_foreign_key("resource_label_events", "epics", column: "epic_id", name: "fk_rails_75efb0a653", on_delete: :cascade) - add_concurrent_foreign_key("reviews", "merge_requests", column: "merge_request_id", name: "fk_rails_5ca11d8c31", on_delete: :cascade) - add_concurrent_foreign_key("reviews", "projects", column: "project_id", name: "fk_rails_64798be025", on_delete: :cascade) - add_concurrent_foreign_key("reviews", "users", column: "author_id", name: "fk_rails_29e6f859c4", on_delete: :nullify) - add_concurrent_foreign_key("saml_providers", "namespaces", column: "group_id", name: "fk_rails_306d459be7", on_delete: :cascade) - add_concurrent_foreign_key("scim_oauth_access_tokens", "namespaces", column: "group_id", name: "fk_rails_c84404fb6c", on_delete: :cascade) - add_concurrent_foreign_key("slack_integrations", "services", column: "service_id", name: "fk_rails_73db19721a", on_delete: :cascade) - add_concurrent_foreign_key("smartcard_identities", "users", column: "user_id", name: "fk_rails_4689f889a9", on_delete: :cascade) - add_concurrent_foreign_key("software_license_policies", "projects", column: "project_id", name: "fk_rails_87b2247ce5", on_delete: :cascade) - add_concurrent_foreign_key("software_license_policies", "software_licenses", column: "software_license_id", name: "fk_rails_7a7a2a92de", on_delete: :cascade) - add_concurrent_foreign_key("users", "namespaces", column: "managing_group_id", name: "fk_a4b8fefe3e", on_delete: :nullify) - add_concurrent_foreign_key("users_ops_dashboard_projects", "projects", column: "project_id", name: "fk_rails_9b4ebf005b", on_delete: :cascade) - add_concurrent_foreign_key("users_ops_dashboard_projects", "users", column: "user_id", name: "fk_rails_220a0562db", on_delete: :cascade) - add_concurrent_foreign_key("vulnerability_feedback", "ci_pipelines", column: "pipeline_id", name: "fk_rails_20976e6fd9", on_delete: :nullify) - add_concurrent_foreign_key("vulnerability_feedback", "issues", column: "issue_id", name: "fk_rails_8c77e5891a", on_delete: :nullify) - add_concurrent_foreign_key("vulnerability_feedback", "merge_requests", column: "merge_request_id", name: "fk_563ff1912e", on_delete: :nullify) - add_concurrent_foreign_key("vulnerability_feedback", "projects", column: "project_id", name: "fk_rails_debd54e456", on_delete: :cascade) - add_concurrent_foreign_key("vulnerability_feedback", "users", column: "author_id", name: "fk_rails_472f69b043", on_delete: :cascade) - add_concurrent_foreign_key("vulnerability_identifiers", "projects", column: "project_id", name: "fk_rails_a67a16c885", on_delete: :cascade) - add_concurrent_foreign_key("vulnerability_occurrence_identifiers", "vulnerability_identifiers", column: "identifier_id", name: "fk_rails_be2e49e1d0", on_delete: :cascade) - add_concurrent_foreign_key("vulnerability_occurrence_identifiers", "vulnerability_occurrences", column: "occurrence_id", name: "fk_rails_e4ef6d027c", on_delete: :cascade) - add_concurrent_foreign_key("vulnerability_occurrence_pipelines", "ci_pipelines", column: "pipeline_id", name: "fk_rails_6421e35d7d", on_delete: :cascade) - add_concurrent_foreign_key("vulnerability_occurrence_pipelines", "vulnerability_occurrences", column: "occurrence_id", name: "fk_rails_dc3ae04693", on_delete: :cascade) - add_concurrent_foreign_key("vulnerability_occurrences", "projects", column: "project_id", name: "fk_rails_90fed4faba", on_delete: :cascade) - add_concurrent_foreign_key("vulnerability_occurrences", "vulnerability_identifiers", column: "primary_identifier_id", name: "fk_rails_c8661a61eb", on_delete: :cascade) - add_concurrent_foreign_key("vulnerability_occurrences", "vulnerability_scanners", column: "scanner_id", name: "fk_rails_bf5b788ca7", on_delete: :cascade) - add_concurrent_foreign_key("vulnerability_scanners", "projects", column: "project_id", name: "fk_rails_5c9d42a221", on_delete: :cascade) - add_concurrent_foreign_key("dependency_proxy_blobs", "namespaces", column: "group_id", on_delete: :cascade) - add_concurrent_foreign_key("dependency_proxy_group_settings", "namespaces", column: "group_id", on_delete: :cascade) - add_concurrent_foreign_key("jira_connect_subscriptions", "jira_connect_installations", column: "jira_connect_installation_id", on_delete: :cascade) - add_concurrent_foreign_key("jira_connect_subscriptions", "namespaces", column: "namespace_id", on_delete: :cascade) - - remove_foreign_key_without_error("protected_tag_create_access_levels", column: :group_id) - add_concurrent_foreign_key("protected_tag_create_access_levels", "namespaces", column: :group_id, name: "fk_b4eb82fe3c", on_delete: :cascade) - end - - def remove_foreign_keys - remove_foreign_key_without_error("application_settings", column: "custom_project_templates_group_id") - remove_foreign_key_without_error("application_settings", column: "file_template_project_id") - remove_foreign_key_without_error("approval_merge_request_rule_sources", column: "approval_merge_request_rule_id") - remove_foreign_key_without_error("approval_merge_request_rule_sources", column: "approval_project_rule_id") - remove_foreign_key_without_error("approval_merge_request_rules", column: "merge_request_id") - remove_foreign_key_without_error("approval_merge_request_rules_approved_approvers", column: "approval_merge_request_rule_id") - remove_foreign_key_without_error("approval_merge_request_rules_approved_approvers", column: "user_id") - remove_foreign_key_without_error("approval_merge_request_rules_groups", column: "approval_merge_request_rule_id") - remove_foreign_key_without_error("approval_merge_request_rules_groups", column: "group_id") - remove_foreign_key_without_error("approval_merge_request_rules_users", column: "approval_merge_request_rule_id") - remove_foreign_key_without_error("approval_merge_request_rules_users", column: "user_id") - remove_foreign_key_without_error("approval_project_rules", column: "project_id") - remove_foreign_key_without_error("approval_project_rules_groups", column: "approval_project_rule_id") - remove_foreign_key_without_error("approval_project_rules_groups", column: "group_id") - remove_foreign_key_without_error("approval_project_rules_users", column: "approval_project_rule_id") - remove_foreign_key_without_error("approval_project_rules_users", column: "user_id") - remove_foreign_key_without_error("approvals", column: "merge_request_id") - remove_foreign_key_without_error("approver_groups", column: "group_id") - remove_foreign_key_without_error("board_assignees", column: "board_id") - remove_foreign_key_without_error("board_assignees", column: "assignee_id") - remove_foreign_key_without_error("board_labels", column: "board_id") - remove_foreign_key_without_error("board_labels", column: "label_id") - remove_foreign_key_without_error("ci_sources_pipelines", column: "source_job_id") - remove_foreign_key_without_error("ci_sources_pipelines", column: "pipeline_id") - remove_foreign_key_without_error("ci_sources_pipelines", column: "source_pipeline_id") - remove_foreign_key_without_error("ci_sources_pipelines", column: "source_project_id") - remove_foreign_key_without_error("ci_sources_pipelines", column: "project_id") - remove_foreign_key_without_error("design_management_designs", column: "issue_id") - remove_foreign_key_without_error("design_management_designs", column: "project_id") - remove_foreign_key_without_error("design_management_versions", column: "design_management_design_id") - remove_foreign_key_without_error("draft_notes", column: "merge_request_id") - remove_foreign_key_without_error("draft_notes", column: "author_id") - remove_foreign_key_without_error("elasticsearch_indexed_namespaces", column: "namespace_id") - remove_foreign_key_without_error("elasticsearch_indexed_projects", column: "project_id") - remove_foreign_key_without_error("epic_issues", column: "epic_id") - remove_foreign_key_without_error("epic_issues", column: "issue_id") - remove_foreign_key_without_error("epic_metrics", column: "epic_id") - remove_foreign_key_without_error("epics", column: "parent_id") - remove_foreign_key_without_error("epics", column: "milestone_id") - remove_foreign_key_without_error("epics", column: "group_id") - remove_foreign_key_without_error("epics", column: "assignee_id") - remove_foreign_key_without_error("epics", column: "author_id") - remove_foreign_key_without_error("epics", column: "closed_by_id") - remove_foreign_key_without_error("geo_event_log", column: "cache_invalidation_event_id") - remove_foreign_key_without_error("geo_event_log", column: "hashed_storage_migrated_event_id") - remove_foreign_key_without_error("geo_event_log", column: "job_artifact_deleted_event_id") - remove_foreign_key_without_error("geo_event_log", column: "lfs_object_deleted_event_id") - remove_foreign_key_without_error("geo_event_log", column: "repositories_changed_event_id") - remove_foreign_key_without_error("geo_event_log", column: "repository_created_event_id") - remove_foreign_key_without_error("geo_event_log", column: "repository_deleted_event_id") - remove_foreign_key_without_error("geo_event_log", column: "repository_renamed_event_id") - remove_foreign_key_without_error("geo_event_log", column: "repository_updated_event_id") - remove_foreign_key_without_error("geo_event_log", column: "reset_checksum_event_id") - remove_foreign_key_without_error("geo_event_log", column: "upload_deleted_event_id") - remove_foreign_key_without_error("geo_hashed_storage_attachments_events", column: "project_id") - remove_foreign_key_without_error("geo_hashed_storage_migrated_events", column: "project_id") - remove_foreign_key_without_error("geo_node_namespace_links", column: "geo_node_id") - remove_foreign_key_without_error("geo_node_namespace_links", column: "namespace_id") - remove_foreign_key_without_error("geo_node_statuses", column: "geo_node_id") - remove_foreign_key_without_error("geo_repositories_changed_events", column: "geo_node_id") - remove_foreign_key_without_error("geo_repository_created_events", column: "project_id") - remove_foreign_key_without_error("geo_repository_renamed_events", column: "project_id") - remove_foreign_key_without_error("geo_repository_updated_events", column: "project_id") - remove_foreign_key_without_error("geo_reset_checksum_events", column: "project_id") - remove_foreign_key_without_error("gitlab_subscriptions", column: "namespace_id") - remove_foreign_key_without_error("gitlab_subscriptions", column: "hosted_plan_id") - remove_foreign_key_without_error("identities", column: "saml_provider_id") - remove_foreign_key_without_error("index_statuses", column: "project_id") - remove_foreign_key_without_error("insights", column: "namespace_id", on_delete: nil) - remove_foreign_key_without_error("insights", column: "project_id", on_delete: nil) - remove_foreign_key_without_error("issue_links", column: "source_id") - remove_foreign_key_without_error("issue_links", column: "target_id") - remove_foreign_key_without_error("lists", column: "milestone_id") - remove_foreign_key_without_error("lists", column: "user_id") - remove_foreign_key_without_error("namespace_statistics", column: "namespace_id") - remove_foreign_key_without_error("namespaces", column: "custom_project_templates_group_id") - remove_foreign_key_without_error("namespaces", column: "plan_id") - remove_foreign_key_without_error("namespaces", column: "file_template_project_id") - remove_foreign_key_without_error("notes", column: "review_id") - remove_foreign_key_without_error("operations_feature_flag_scopes", column: "feature_flag_id") - remove_foreign_key_without_error("operations_feature_flags", column: "project_id") - remove_foreign_key_without_error("operations_feature_flags_clients", column: "project_id") - remove_foreign_key_without_error("packages_maven_metadata", column: "package_id") - remove_foreign_key_without_error("packages_package_files", column: "package_id") - remove_foreign_key_without_error("packages_packages", column: "project_id") - remove_foreign_key_without_error("path_locks", column: "project_id") - remove_foreign_key_without_error("path_locks", column: "user_id", on_delete: nil) - remove_foreign_key_without_error("project_alerting_settings", column: "project_id") - remove_foreign_key_without_error("project_feature_usages", column: "project_id") - remove_foreign_key_without_error("project_incident_management_settings", column: "project_id") - remove_foreign_key_without_error("project_repository_states", column: "project_id") - remove_foreign_key_without_error("project_tracing_settings", column: "project_id") - remove_foreign_key_without_error("prometheus_alert_events", column: "project_id") - remove_foreign_key_without_error("prometheus_alert_events", column: "prometheus_alert_id") - remove_foreign_key_without_error("prometheus_alerts", column: "environment_id") - remove_foreign_key_without_error("prometheus_alerts", column: "project_id") - remove_foreign_key_without_error("prometheus_alerts", column: "prometheus_metric_id") - remove_foreign_key_without_error("protected_branch_merge_access_levels", column: "group_id") - remove_foreign_key_without_error("protected_branch_merge_access_levels", column: "user_id", on_delete: nil) - remove_foreign_key_without_error("protected_branch_push_access_levels", column: "group_id") - remove_foreign_key_without_error("protected_branch_push_access_levels", column: "user_id", on_delete: nil) - remove_foreign_key_without_error("protected_branch_unprotect_access_levels", column: "group_id") - remove_foreign_key_without_error("protected_branch_unprotect_access_levels", column: "protected_branch_id") - remove_foreign_key_without_error("protected_branch_unprotect_access_levels", column: "user_id") - remove_foreign_key_without_error("protected_environment_deploy_access_levels", column: "group_id") - remove_foreign_key_without_error("protected_environment_deploy_access_levels", column: "protected_environment_id") - remove_foreign_key_without_error("protected_environment_deploy_access_levels", column: "user_id") - remove_foreign_key_without_error("protected_environments", column: "project_id") - remove_foreign_key_without_error("push_rules", column: "project_id") - remove_foreign_key_without_error("resource_label_events", column: "epic_id") - remove_foreign_key_without_error("reviews", column: "merge_request_id") - remove_foreign_key_without_error("reviews", column: "project_id") - remove_foreign_key_without_error("reviews", column: "author_id") - remove_foreign_key_without_error("saml_providers", column: "group_id") - remove_foreign_key_without_error("scim_oauth_access_tokens", column: "group_id") - remove_foreign_key_without_error("slack_integrations", column: "service_id") - remove_foreign_key_without_error("smartcard_identities", column: "user_id") - remove_foreign_key_without_error("software_license_policies", column: "project_id") - remove_foreign_key_without_error("software_license_policies", column: "software_license_id") - remove_foreign_key_without_error("users", column: "managing_group_id") - remove_foreign_key_without_error("users_ops_dashboard_projects", column: "project_id") - remove_foreign_key_without_error("users_ops_dashboard_projects", column: "user_id") - remove_foreign_key_without_error("vulnerability_feedback", column: "pipeline_id") - remove_foreign_key_without_error("vulnerability_feedback", column: "issue_id") - remove_foreign_key_without_error("vulnerability_feedback", column: "merge_request_id") - remove_foreign_key_without_error("vulnerability_feedback", column: "project_id") - remove_foreign_key_without_error("vulnerability_feedback", column: "author_id") - remove_foreign_key_without_error("vulnerability_identifiers", column: "project_id") - remove_foreign_key_without_error("vulnerability_occurrence_identifiers", column: "identifier_id") - remove_foreign_key_without_error("vulnerability_occurrence_identifiers", column: "occurrence_id") - remove_foreign_key_without_error("vulnerability_occurrence_pipelines", column: "pipeline_id") - remove_foreign_key_without_error("vulnerability_occurrence_pipelines", column: "occurrence_id") - remove_foreign_key_without_error("vulnerability_occurrences", column: "project_id") - remove_foreign_key_without_error("vulnerability_occurrences", column: "primary_identifier_id") - remove_foreign_key_without_error("vulnerability_occurrences", column: "scanner_id") - remove_foreign_key_without_error("vulnerability_scanners", column: "project_id") - remove_foreign_key_without_error("dependency_proxy_blobs", column: "group_id") - remove_foreign_key_without_error("dependency_proxy_group_settings", column: "group_id") - remove_foreign_key_without_error("jira_connect_subscriptions", "jira_connect_installations", column: "jira_connect_installation_id") - remove_foreign_key_without_error("jira_connect_subscriptions", "namespaces", column: "namespace_id") - - remove_foreign_key_without_error("protected_tag_create_access_levels", column: :group_id) - add_concurrent_foreign_key("protected_tag_create_access_levels", "namespaces", column: :group_id, on_delete: nil) - end -end -# rubocop: enable Metrics/AbcSize -# rubocop: enable Migration/Datetime -# rubocop: enable Migration/PreventStrings -# rubocop: enable Migration/AddLimitToTextColumns diff --git a/db/migrate/20190403161806_update_designs_index.rb b/db/migrate/20190403161806_update_designs_index.rb deleted file mode 100644 index 78517e372d5..00000000000 --- a/db/migrate/20190403161806_update_designs_index.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class UpdateDesignsIndex < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - remove_concurrent_index :design_management_designs, :issue_id, unique: true - end - - def down - add_concurrent_index :design_management_designs, :issue_id, unique: true - end -end diff --git a/db/migrate/20190408163745_prometheus_knative05_fix.rb b/db/migrate/20190408163745_prometheus_knative05_fix.rb deleted file mode 100644 index 3d0aa782669..00000000000 --- a/db/migrate/20190408163745_prometheus_knative05_fix.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class PrometheusKnative05Fix < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute - end - - def down - # no-op - end -end diff --git a/db/migrate/20190409224933_add_name_to_geo_nodes.rb b/db/migrate/20190409224933_add_name_to_geo_nodes.rb deleted file mode 100644 index ac3eda701d1..00000000000 --- a/db/migrate/20190409224933_add_name_to_geo_nodes.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddNameToGeoNodes < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def up - add_column :geo_nodes, :name, :string # rubocop:disable Migration/PreventStrings - - # url is also unique, and its type and size is identical to the name column, - # so this is safe. - execute "UPDATE geo_nodes SET name = url;" - - # url is also `null: false`, so this is safe. - change_column :geo_nodes, :name, :string, null: false - end - - def down - remove_column :geo_nodes, :name - end -end diff --git a/db/migrate/20190410173409_add_name_index_to_geo_nodes.rb b/db/migrate/20190410173409_add_name_index_to_geo_nodes.rb deleted file mode 100644 index efbdaf1d025..00000000000 --- a/db/migrate/20190410173409_add_name_index_to_geo_nodes.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddNameIndexToGeoNodes < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :geo_nodes, :name, unique: true - end - - def down - remove_concurrent_index :geo_nodes, :name - end -end diff --git a/db/migrate/20190412155659_add_merge_request_blocks.rb b/db/migrate/20190412155659_add_merge_request_blocks.rb deleted file mode 100644 index 9e7f370d1cf..00000000000 --- a/db/migrate/20190412155659_add_merge_request_blocks.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class AddMergeRequestBlocks < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - create_table :merge_request_blocks, id: :bigserial do |t| - t.references :blocking_merge_request, - index: false, null: false, - foreign_key: { to_table: :merge_requests, on_delete: :cascade } - - t.references :blocked_merge_request, - index: true, null: false, - foreign_key: { to_table: :merge_requests, on_delete: :cascade } - - t.index [:blocking_merge_request_id, :blocked_merge_request_id], - unique: true, - name: 'index_mr_blocks_on_blocking_and_blocked_mr_ids' - - t.timestamps_with_timezone - end - end -end diff --git a/db/migrate/20190412183653_remove_url_index_from_geo_nodes.rb b/db/migrate/20190412183653_remove_url_index_from_geo_nodes.rb deleted file mode 100644 index 86a46260553..00000000000 --- a/db/migrate/20190412183653_remove_url_index_from_geo_nodes.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class RemoveUrlIndexFromGeoNodes < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - remove_concurrent_index :geo_nodes, :url - end - - def down - add_concurrent_index :geo_nodes, :url, unique: true - end -end diff --git a/db/migrate/20190414185432_add_comment_to_vulnerability_feedback.rb b/db/migrate/20190414185432_add_comment_to_vulnerability_feedback.rb deleted file mode 100644 index f2047e21d1e..00000000000 --- a/db/migrate/20190414185432_add_comment_to_vulnerability_feedback.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddCommentToVulnerabilityFeedback < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def up - add_column :vulnerability_feedback, :comment_author_id, :integer - add_column :vulnerability_feedback, :comment, :text # rubocop:disable Migration/AddLimitToTextColumns - add_column :vulnerability_feedback, :comment_timestamp, :datetime_with_timezone - end - - def down - remove_column :vulnerability_feedback, :comment_author_id - remove_column :vulnerability_feedback, :comment - remove_column :vulnerability_feedback, :comment_timestamp - end -end diff --git a/db/migrate/20190415030217_add_variable_type_to_ci_variables.rb b/db/migrate/20190415030217_add_variable_type_to_ci_variables.rb deleted file mode 100644 index ed7af455e12..00000000000 --- a/db/migrate/20190415030217_add_variable_type_to_ci_variables.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddVariableTypeToCiVariables < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - disable_ddl_transaction! - - DOWNTIME = false - ENV_VAR_VARIABLE_TYPE = 1 - - def up - add_column_with_default(:ci_variables, :variable_type, :smallint, default: ENV_VAR_VARIABLE_TYPE) # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column(:ci_variables, :variable_type) - end -end diff --git a/db/migrate/20190415095825_add_packages_size_to_project_statistics.rb b/db/migrate/20190415095825_add_packages_size_to_project_statistics.rb deleted file mode 100644 index 99625981563..00000000000 --- a/db/migrate/20190415095825_add_packages_size_to_project_statistics.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddPackagesSizeToProjectStatistics < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :project_statistics, :packages_size, :bigint - end -end diff --git a/db/migrate/20190415172035_update_insights_foreign_keys.rb b/db/migrate/20190415172035_update_insights_foreign_keys.rb deleted file mode 100644 index 5d3aa4c05e9..00000000000 --- a/db/migrate/20190415172035_update_insights_foreign_keys.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# rubocop: disable Migration/AddConcurrentForeignKey - -class UpdateInsightsForeignKeys < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - remove_foreign_key_if_exists(:insights, column: :project_id) - add_foreign_key(:insights, :projects, column: :project_id, on_delete: :cascade) - - remove_foreign_key_if_exists(:insights, column: :namespace_id) - add_foreign_key(:insights, :namespaces, column: :namespace_id, on_delete: :cascade) - end - - def down - remove_foreign_key_if_exists(:insights, column: :namespace_id) - add_foreign_key(:insights, :namespaces, column: :namespace_id) - - remove_foreign_key_if_exists(:insights, column: :project_id) - add_foreign_key(:insights, :projects, column: :project_id) - end -end diff --git a/db/migrate/20190416185130_add_merge_train_enabled_to_ci_cd_settings.rb b/db/migrate/20190416185130_add_merge_train_enabled_to_ci_cd_settings.rb deleted file mode 100644 index 2488cff38af..00000000000 --- a/db/migrate/20190416185130_add_merge_train_enabled_to_ci_cd_settings.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddMergeTrainEnabledToCiCdSettings < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - # rubocop:disable Migration/AddColumnWithDefault - # rubocop:disable Migration/UpdateLargeTable - def up - add_column_with_default :project_ci_cd_settings, :merge_trains_enabled, :boolean, default: false, allow_null: false - end - # rubocop:enable Migration/AddColumnWithDefault - # rubocop:enable Migration/UpdateLargeTable - - def down - remove_column :project_ci_cd_settings, :merge_trains_enabled - end -end diff --git a/db/migrate/20190416213556_add_variable_type_to_ci_group_variables.rb b/db/migrate/20190416213556_add_variable_type_to_ci_group_variables.rb deleted file mode 100644 index 4d329cea1b5..00000000000 --- a/db/migrate/20190416213556_add_variable_type_to_ci_group_variables.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddVariableTypeToCiGroupVariables < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - disable_ddl_transaction! - - DOWNTIME = false - ENV_VAR_VARIABLE_TYPE = 1 - - def up - add_column_with_default(:ci_group_variables, :variable_type, :smallint, default: ENV_VAR_VARIABLE_TYPE) # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column(:ci_group_variables, :variable_type) - end -end diff --git a/db/migrate/20190416213615_add_variable_type_to_ci_pipeline_variables.rb b/db/migrate/20190416213615_add_variable_type_to_ci_pipeline_variables.rb deleted file mode 100644 index 1a4439da5bf..00000000000 --- a/db/migrate/20190416213615_add_variable_type_to_ci_pipeline_variables.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddVariableTypeToCiPipelineVariables < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - disable_ddl_transaction! - - DOWNTIME = false - ENV_VAR_VARIABLE_TYPE = 1 - - # rubocop:disable Migration/AddColumnWithDefault - # rubocop:disable Migration/UpdateLargeTable - def up - add_column_with_default(:ci_pipeline_variables, :variable_type, :smallint, default: ENV_VAR_VARIABLE_TYPE) - end - # rubocop:enable Migration/AddColumnWithDefault - # rubocop:enable Migration/UpdateLargeTable - - def down - remove_column(:ci_pipeline_variables, :variable_type) - end -end diff --git a/db/migrate/20190416213631_add_variable_type_to_ci_pipeline_schedule_variables.rb b/db/migrate/20190416213631_add_variable_type_to_ci_pipeline_schedule_variables.rb deleted file mode 100644 index b7d80cb2d0d..00000000000 --- a/db/migrate/20190416213631_add_variable_type_to_ci_pipeline_schedule_variables.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddVariableTypeToCiPipelineScheduleVariables < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - disable_ddl_transaction! - - DOWNTIME = false - ENV_VAR_VARIABLE_TYPE = 1 - - def up - add_column_with_default(:ci_pipeline_schedule_variables, :variable_type, :smallint, default: ENV_VAR_VARIABLE_TYPE) # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column(:ci_pipeline_schedule_variables, :variable_type) - end -end diff --git a/db/migrate/20190418132750_add_foreign_key_from_vulnerability_feedback_to_users.rb b/db/migrate/20190418132750_add_foreign_key_from_vulnerability_feedback_to_users.rb deleted file mode 100644 index 0bd9012aee8..00000000000 --- a/db/migrate/20190418132750_add_foreign_key_from_vulnerability_feedback_to_users.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyFromVulnerabilityFeedbackToUsers < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :vulnerability_feedback, :users, column: :comment_author_id, on_delete: :nullify - add_concurrent_index :vulnerability_feedback, :comment_author_id - end - - def down - remove_foreign_key :vulnerability_feedback, column: :comment_author_id - remove_concurrent_index :vulnerability_feedback, :comment_author_id - end -end diff --git a/db/migrate/20190418182545_create_merge_request_trains_table.rb b/db/migrate/20190418182545_create_merge_request_trains_table.rb deleted file mode 100644 index ac927c9c6b9..00000000000 --- a/db/migrate/20190418182545_create_merge_request_trains_table.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreateMergeRequestTrainsTable < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - create_table :merge_trains, id: :bigserial do |t| - t.references :merge_request, foreign_key: { on_delete: :cascade }, type: :integer, index: false, null: false - t.references :user, foreign_key: { on_delete: :cascade }, type: :integer, null: false - t.references :pipeline, foreign_key: { to_table: :ci_pipelines, on_delete: :nullify }, type: :integer - t.timestamps_with_timezone null: false - - t.index [:merge_request_id], unique: true - end - end -end diff --git a/db/migrate/20190419121952_add_bridged_pipeline_id_to_bridges.rb b/db/migrate/20190419121952_add_bridged_pipeline_id_to_bridges.rb deleted file mode 100644 index efb59403df3..00000000000 --- a/db/migrate/20190419121952_add_bridged_pipeline_id_to_bridges.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddBridgedPipelineIdToBridges < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def change - add_column :ci_builds, :upstream_pipeline_id, :integer # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20190419123057_add_bridged_pipeline_id_foreign_key.rb b/db/migrate/20190419123057_add_bridged_pipeline_id_foreign_key.rb deleted file mode 100644 index c31ec7bc107..00000000000 --- a/db/migrate/20190419123057_add_bridged_pipeline_id_foreign_key.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddBridgedPipelineIdForeignKey < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_builds, :upstream_pipeline_id, where: 'upstream_pipeline_id IS NOT NULL' - add_concurrent_foreign_key :ci_builds, :ci_pipelines, column: :upstream_pipeline_id - end - - def down - remove_foreign_key :ci_builds, column: :upstream_pipeline_id - remove_concurrent_index :ci_builds, :upstream_pipeline_id - end -end diff --git a/db/migrate/20190422082247_create_project_metrics_settings.rb b/db/migrate/20190422082247_create_project_metrics_settings.rb deleted file mode 100644 index 177c4820a0c..00000000000 --- a/db/migrate/20190422082247_create_project_metrics_settings.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class CreateProjectMetricsSettings < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - create_table :project_metrics_settings, id: :int, primary_key: :project_id, default: nil do |t| - t.string :external_dashboard_url, null: false # rubocop:disable Migration/PreventStrings - t.foreign_key :projects, column: :project_id, on_delete: :cascade - end - end -end diff --git a/db/migrate/20190423124640_add_index_to_projects_mirror_user_id.rb b/db/migrate/20190423124640_add_index_to_projects_mirror_user_id.rb deleted file mode 100644 index b008d8ce0cc..00000000000 --- a/db/migrate/20190423124640_add_index_to_projects_mirror_user_id.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToProjectsMirrorUserId < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :projects, :mirror_user_id - end - - def down - remove_concurrent_index :projects, :mirror_user_id - end -end diff --git a/db/migrate/20190426180107_add_deployment_events_to_services.rb b/db/migrate/20190426180107_add_deployment_events_to_services.rb deleted file mode 100644 index 61339ea7506..00000000000 --- a/db/migrate/20190426180107_add_deployment_events_to_services.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddDeploymentEventsToServices < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - # rubocop:disable Migration/AddColumnWithDefault - # rubocop:disable Migration/UpdateLargeTable - def up - add_column_with_default(:services, :deployment_events, :boolean, default: false, allow_null: false) - end - # rubocop:enable Migration/AddColumnWithDefault - # rubocop:enable Migration/UpdateLargeTable - - def down - remove_column(:services, :deployment_events) - end -end diff --git a/db/migrate/20190429082448_create_pages_domain_acme_orders.rb b/db/migrate/20190429082448_create_pages_domain_acme_orders.rb deleted file mode 100644 index 75636031193..00000000000 --- a/db/migrate/20190429082448_create_pages_domain_acme_orders.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class CreatePagesDomainAcmeOrders < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - # rubocop:disable Migration/AddLimitToTextColumns - def change - create_table :pages_domain_acme_orders do |t| - t.references :pages_domain, null: false, index: true, foreign_key: { on_delete: :cascade }, type: :integer - - t.datetime_with_timezone :expires_at, null: false - t.timestamps_with_timezone null: false - - t.string :url, null: false - - t.string :challenge_token, null: false, index: true - t.text :challenge_file_content, null: false - - t.text :encrypted_private_key, null: false - t.text :encrypted_private_key_iv, null: false - end - end - # rubocop:enable Migration/AddLimitToTextColumns - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190430131225_create_issue_tracker_data.rb b/db/migrate/20190430131225_create_issue_tracker_data.rb deleted file mode 100644 index 2ec9802dbcd..00000000000 --- a/db/migrate/20190430131225_create_issue_tracker_data.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class CreateIssueTrackerData < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :issue_tracker_data do |t| - t.references :service, foreign_key: { on_delete: :cascade }, type: :integer, index: true, null: false - t.timestamps_with_timezone - t.string :encrypted_project_url - t.string :encrypted_project_url_iv - t.string :encrypted_issues_url - t.string :encrypted_issues_url_iv - t.string :encrypted_new_issue_url - t.string :encrypted_new_issue_url_iv - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190430142025_create_jira_tracker_data.rb b/db/migrate/20190430142025_create_jira_tracker_data.rb deleted file mode 100644 index 2144c60a267..00000000000 --- a/db/migrate/20190430142025_create_jira_tracker_data.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class CreateJiraTrackerData < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :jira_tracker_data do |t| - t.references :service, foreign_key: { on_delete: :cascade }, type: :integer, index: true, null: false - t.timestamps_with_timezone - t.string :encrypted_url - t.string :encrypted_url_iv - t.string :encrypted_api_url - t.string :encrypted_api_url_iv - t.string :encrypted_username - t.string :encrypted_username_iv - t.string :encrypted_password - t.string :encrypted_password_iv - t.string :jira_issue_transition_id - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190506135337_add_temporary_indexes_to_state_id.rb b/db/migrate/20190506135337_add_temporary_indexes_to_state_id.rb deleted file mode 100644 index 8e9838e1afb..00000000000 --- a/db/migrate/20190506135337_add_temporary_indexes_to_state_id.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# This migration adds temporary indexes to state_id column of issues -# and merge_requests tables. It will be used only to peform the scheduling -# for populating state_id in a post migrate and will be removed after it. -# Check: ScheduleSyncIssuablesStateIdWhereNil. - -class AddTemporaryIndexesToStateId < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - %w(issues merge_requests).each do |table| - add_concurrent_index( - table, - 'id', - name: index_name_for(table), - where: "state_id IS NULL" - ) - end - end - - def down - remove_concurrent_index_by_name(:issues, index_name_for("issues")) - remove_concurrent_index_by_name(:merge_requests, index_name_for("merge_requests")) - end - - def index_name_for(table) - "idx_on_#{table}_where_state_id_is_null" - end -end diff --git a/db/migrate/20190513174947_enable_create_incident_issues_by_default.rb b/db/migrate/20190513174947_enable_create_incident_issues_by_default.rb deleted file mode 100644 index ecd466627fe..00000000000 --- a/db/migrate/20190513174947_enable_create_incident_issues_by_default.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class EnableCreateIncidentIssuesByDefault < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - change_default_for :create_issue, from: false, to: true - change_default_for :send_email, from: true, to: false - end - - private - - def change_default_for(column, from:, to:) - change_column_default :project_incident_management_settings, - column, from: from, to: to - end -end diff --git a/db/migrate/20190514105711_create_ip_restriction.rb b/db/migrate/20190514105711_create_ip_restriction.rb deleted file mode 100644 index 51e711ca32b..00000000000 --- a/db/migrate/20190514105711_create_ip_restriction.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class CreateIpRestriction < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - create_table :ip_restrictions do |t| - t.references :group, references: :namespace, - column: :group_id, - type: :integer, - null: false, - index: true - t.string :range, null: false # rubocop:disable Migration/PreventStrings - end - - add_foreign_key(:ip_restrictions, :namespaces, column: :group_id, on_delete: :cascade) # rubocop: disable Migration/AddConcurrentForeignKey - end -end diff --git a/db/migrate/20190515125613_add_application_settings_elasticsearch_shards.rb b/db/migrate/20190515125613_add_application_settings_elasticsearch_shards.rb deleted file mode 100644 index 9cebc0f8db4..00000000000 --- a/db/migrate/20190515125613_add_application_settings_elasticsearch_shards.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddApplicationSettingsElasticsearchShards < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def change - add_column :application_settings, :elasticsearch_shards, :integer, null: false, default: 5 - add_column :application_settings, :elasticsearch_replicas, :integer, null: false, default: 1 - end -end diff --git a/db/migrate/20190516011213_add_build_queued_at_index.rb b/db/migrate/20190516011213_add_build_queued_at_index.rb deleted file mode 100644 index 77ffa7cd4e9..00000000000 --- a/db/migrate/20190516011213_add_build_queued_at_index.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# This migration make queued_at field indexed to speed up builds filtering by job_age - -class AddBuildQueuedAtIndex < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_builds, :queued_at - end - - def down - remove_concurrent_index :ci_builds, :queued_at - end -end diff --git a/db/migrate/20190516151857_add_lets_encrypt_private_key_to_application_settings.rb b/db/migrate/20190516151857_add_lets_encrypt_private_key_to_application_settings.rb deleted file mode 100644 index a2692ad32e9..00000000000 --- a/db/migrate/20190516151857_add_lets_encrypt_private_key_to_application_settings.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddLetsEncryptPrivateKeyToApplicationSettings < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # rubocop:disable Migration/AddLimitToTextColumns - def change - add_column :application_settings, :encrypted_lets_encrypt_private_key, :text - add_column :application_settings, :encrypted_lets_encrypt_private_key_iv, :text - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20190516155724_change_packages_size_defaults_in_project_statistics.rb b/db/migrate/20190516155724_change_packages_size_defaults_in_project_statistics.rb deleted file mode 100644 index eba154df496..00000000000 --- a/db/migrate/20190516155724_change_packages_size_defaults_in_project_statistics.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class ChangePackagesSizeDefaultsInProjectStatistics < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - change_column_default :project_statistics, :packages_size, 0 - - update_column_in_batches(:project_statistics, :packages_size, 0) do |table, query| - query.where(table[:packages_size].eq(nil)) - end - - change_column_null :project_statistics, :packages_size, false - end - - def down - change_column_null :project_statistics, :packages_size, true - change_column_default :project_statistics, :packages_size, nil - end -end diff --git a/db/migrate/20190520200123_add_rule_type_to_approval_merge_request_approval_rules.rb b/db/migrate/20190520200123_add_rule_type_to_approval_merge_request_approval_rules.rb deleted file mode 100644 index 7bdb48f3eec..00000000000 --- a/db/migrate/20190520200123_add_rule_type_to_approval_merge_request_approval_rules.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddRuleTypeToApprovalMergeRequestApprovalRules < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default(:approval_merge_request_rules, :rule_type, :integer, limit: 2, default: 1) # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column(:approval_merge_request_rules, :rule_type) - end -end diff --git a/db/migrate/20190521174505_add_report_type_to_approval_merge_request_rules.rb b/db/migrate/20190521174505_add_report_type_to_approval_merge_request_rules.rb deleted file mode 100644 index eafffd4f5a3..00000000000 --- a/db/migrate/20190521174505_add_report_type_to_approval_merge_request_rules.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddReportTypeToApprovalMergeRequestRules < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - change_table :approval_merge_request_rules do |t| - t.integer :report_type, limit: 2 - end - end -end diff --git a/db/migrate/20190523112344_limit_milestone_date_years_to_4_digits.rb b/db/migrate/20190523112344_limit_milestone_date_years_to_4_digits.rb deleted file mode 100644 index 86fe09d7573..00000000000 --- a/db/migrate/20190523112344_limit_milestone_date_years_to_4_digits.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class LimitMilestoneDateYearsTo4Digits < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # When a migration requires downtime you **must** uncomment the following - # constant and define a short and easy to understand explanation as to why the - # migration requires downtime. - # DOWNTIME_REASON = '' - - # When using the methods "add_concurrent_index", "remove_concurrent_index" or - # "add_column_with_default" you must disable the use of transactions - # as these methods can not run in an existing transaction. - # When using "add_concurrent_index" or "remove_concurrent_index" methods make sure - # that either of them is the _only_ method called in the migration, - # any other changes should go in a separate migration. - # This ensures that upon failure _only_ the index creation or removing fails - # and can be retried or reverted easily. - # - # To disable transactions uncomment the following line and remove these - # comments: - # disable_ddl_transaction! - - def change - Milestone.where("start_date > '9999-12-31'").update_all( - "start_date = '9999-12-31'" - ) - Milestone.where("due_date > '9999-12-31'").update_all( - "due_date = '9999-12-31'" - ) - end -end diff --git a/db/migrate/20190524062810_generate_lets_encrypt_private_key.rb b/db/migrate/20190524062810_generate_lets_encrypt_private_key.rb deleted file mode 100644 index ae93a76575a..00000000000 --- a/db/migrate/20190524062810_generate_lets_encrypt_private_key.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class GenerateLetsEncryptPrivateKey < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # we now generate this key on the fly, but since this migration was merged to master, we don't remove it - def up - end - - def down - end -end diff --git a/db/migrate/20190524071727_add_ssl_valid_period_to_pages_domain.rb b/db/migrate/20190524071727_add_ssl_valid_period_to_pages_domain.rb deleted file mode 100644 index 18544dcb6d3..00000000000 --- a/db/migrate/20190524071727_add_ssl_valid_period_to_pages_domain.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddSslValidPeriodToPagesDomain < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def change - add_column :pages_domains, :certificate_valid_not_before, :datetime_with_timezone - add_column :pages_domains, :certificate_valid_not_after, :datetime_with_timezone - end -end diff --git a/db/migrate/20190527011309_add_required_template_name_to_application_settings.rb b/db/migrate/20190527011309_add_required_template_name_to_application_settings.rb deleted file mode 100644 index 9e0f5c5b1e7..00000000000 --- a/db/migrate/20190527011309_add_required_template_name_to_application_settings.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddRequiredTemplateNameToApplicationSettings < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :application_settings, :required_instance_ci_template, :string, null: true - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190527194830_add_wiki_size_to_statistics.rb b/db/migrate/20190527194830_add_wiki_size_to_statistics.rb deleted file mode 100644 index d4f16cdec18..00000000000 --- a/db/migrate/20190527194830_add_wiki_size_to_statistics.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddWikiSizeToStatistics < ActiveRecord::Migration[5.0] - DOWNTIME = false - - def change - add_column :project_statistics, :wiki_size, :bigint - end -end diff --git a/db/migrate/20190528173628_add_index_for_code_owner_rule_type_on_approval_merge_request_rules.rb b/db/migrate/20190528173628_add_index_for_code_owner_rule_type_on_approval_merge_request_rules.rb deleted file mode 100644 index 96d878a98f2..00000000000 --- a/db/migrate/20190528173628_add_index_for_code_owner_rule_type_on_approval_merge_request_rules.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddIndexForCodeOwnerRuleTypeOnApprovalMergeRequestRules < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_CODE_OWNERS_RULES_UNIQUENESS_NAME = 'index_approval_rule_name_for_code_owners_rule_type' - INDEX_CODE_OWNERS_RULES_QUERY_NAME = 'index_approval_rules_code_owners_rule_type' - - class ApprovalMergeRequestRule < ActiveRecord::Base - include EachBatch - - enum rule_types: { - regular: 1, - code_owner: 2 - } - end - - def up - # Ensure only 1 code_owner rule per merge_request - add_concurrent_index( - :approval_merge_request_rules, - [:merge_request_id, :rule_type, :name], - unique: true, - where: "rule_type = #{ApprovalMergeRequestRule.rule_types[:code_owner]}", - name: INDEX_CODE_OWNERS_RULES_UNIQUENESS_NAME - ) - - # Support lookups for all code_owner rules per merge_request - add_concurrent_index( - :approval_merge_request_rules, - [:merge_request_id, :rule_type], - where: "rule_type = #{ApprovalMergeRequestRule.rule_types[:code_owner]}", - name: INDEX_CODE_OWNERS_RULES_QUERY_NAME - ) - end - - def down - remove_concurrent_index_by_name( - :approval_merge_request_rules, - INDEX_CODE_OWNERS_RULES_UNIQUENESS_NAME - ) - - remove_concurrent_index_by_name( - :approval_merge_request_rules, - INDEX_CODE_OWNERS_RULES_QUERY_NAME - ) - end -end diff --git a/db/migrate/20190529142545_add_dns_rebinding_protection_enabled_to_application_settings.rb b/db/migrate/20190529142545_add_dns_rebinding_protection_enabled_to_application_settings.rb deleted file mode 100644 index b50845c85b3..00000000000 --- a/db/migrate/20190529142545_add_dns_rebinding_protection_enabled_to_application_settings.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddDnsRebindingProtectionEnabledToApplicationSettings < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default(:application_settings, :dns_rebinding_protection_enabled, # rubocop:disable Migration/AddColumnWithDefault - :boolean, - default: true, - allow_null: false) - end - - def down - remove_column(:application_settings, :dns_rebinding_protection_enabled) - end -end diff --git a/db/migrate/20190530042141_add_default_git_depth_to_ci_cd_settings.rb b/db/migrate/20190530042141_add_default_git_depth_to_ci_cd_settings.rb deleted file mode 100644 index 8abea05def4..00000000000 --- a/db/migrate/20190530042141_add_default_git_depth_to_ci_cd_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddDefaultGitDepthToCiCdSettings < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :project_ci_cd_settings, :default_git_depth, :integer - end -end diff --git a/db/migrate/20190530154715_add_index_to_merge_requests_state_and_merge_status.rb b/db/migrate/20190530154715_add_index_to_merge_requests_state_and_merge_status.rb deleted file mode 100644 index e669f81ca35..00000000000 --- a/db/migrate/20190530154715_add_index_to_merge_requests_state_and_merge_status.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddIndexToMergeRequestsStateAndMergeStatus < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :merge_requests, [:state, :merge_status], - where: "state = 'opened' AND merge_status = 'can_be_merged'" - end - - def down - remove_concurrent_index :merge_requests, [:state, :merge_status] - end -end diff --git a/db/migrate/20190531153110_create_namespace_root_storage_statistics.rb b/db/migrate/20190531153110_create_namespace_root_storage_statistics.rb deleted file mode 100644 index 702560d05cc..00000000000 --- a/db/migrate/20190531153110_create_namespace_root_storage_statistics.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class CreateNamespaceRootStorageStatistics < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def change - create_table :namespace_root_storage_statistics, id: false, primary_key: :namespace_id do |t| - t.integer :namespace_id, null: false, primary_key: true - t.datetime_with_timezone :updated_at, null: false - - t.bigint :repository_size, null: false, default: 0 - t.bigint :lfs_objects_size, null: false, default: 0 - t.bigint :wiki_size, null: false, default: 0 - t.bigint :build_artifacts_size, null: false, default: 0 - t.bigint :storage_size, null: false, default: 0 - t.bigint :packages_size, null: false, default: 0 - - t.index :namespace_id, unique: true - t.foreign_key :namespaces, column: :namespace_id, on_delete: :cascade - end - end -end diff --git a/db/migrate/20190602014139_add_repository_type_to_lfs_objects_project.rb b/db/migrate/20190602014139_add_repository_type_to_lfs_objects_project.rb deleted file mode 100644 index 6ff64ba12a9..00000000000 --- a/db/migrate/20190602014139_add_repository_type_to_lfs_objects_project.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddRepositoryTypeToLfsObjectsProject < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :lfs_objects_projects, :repository_type, :integer, limit: 2, null: true - end -end diff --git a/db/migrate/20190603124955_add_index_to_count_pending_mirror_updates.rb b/db/migrate/20190603124955_add_index_to_count_pending_mirror_updates.rb deleted file mode 100644 index 6aa94f7b20b..00000000000 --- a/db/migrate/20190603124955_add_index_to_count_pending_mirror_updates.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToCountPendingMirrorUpdates < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :project_mirror_data, [:last_update_at, :retry_count] - end - - def down - remove_concurrent_index :project_mirror_data, [:last_update_at, :retry_count] - end -end diff --git a/db/migrate/20190604091310_add_ldap_membership_lock.rb b/db/migrate/20190604091310_add_ldap_membership_lock.rb deleted file mode 100644 index d2e99f33b87..00000000000 --- a/db/migrate/20190604091310_add_ldap_membership_lock.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddLdapMembershipLock < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default(:application_settings, :lock_memberships_to_ldap, :boolean, default: false) # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column(:application_settings, :lock_memberships_to_ldap) - end -end diff --git a/db/migrate/20190604184643_fix_pool_repository_source_project_id.rb b/db/migrate/20190604184643_fix_pool_repository_source_project_id.rb deleted file mode 100644 index 30244760e6b..00000000000 --- a/db/migrate/20190604184643_fix_pool_repository_source_project_id.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class FixPoolRepositorySourceProjectId < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def up - execute "UPDATE pool_repositories SET source_project_id = (SELECT MIN(id) FROM projects WHERE pool_repository_id = pool_repositories.id) WHERE pool_repositories.source_project_id IS NULL" - end - - def down - # nothing to do her - end -end diff --git a/db/migrate/20190605104727_add_default_project_deletion_protection_to_application_settings.rb b/db/migrate/20190605104727_add_default_project_deletion_protection_to_application_settings.rb deleted file mode 100644 index e660c918fa4..00000000000 --- a/db/migrate/20190605104727_add_default_project_deletion_protection_to_application_settings.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddDefaultProjectDeletionProtectionToApplicationSettings < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - # rubocop:disable Migration/AddColumnWithDefault - add_column_with_default :application_settings, :default_project_deletion_protection, :boolean, default: false, allow_null: false - # rubocop:enable Migration/AddColumnWithDefault - end - - def down - remove_column :application_settings, :default_project_deletion_protection - end -end diff --git a/db/migrate/20190605184422_create_namespace_aggregation_schedules.rb b/db/migrate/20190605184422_create_namespace_aggregation_schedules.rb deleted file mode 100644 index 5e8cb616cc1..00000000000 --- a/db/migrate/20190605184422_create_namespace_aggregation_schedules.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class CreateNamespaceAggregationSchedules < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def change - create_table :namespace_aggregation_schedules, id: false, primary_key: :namespace_id do |t| - t.integer :namespace_id, null: false, primary_key: true - - t.index :namespace_id, unique: true - t.foreign_key :namespaces, column: :namespace_id, on_delete: :cascade - end - end -end diff --git a/db/migrate/20190606014128_add_last_ci_minutes_notification_at_to_namespaces.rb b/db/migrate/20190606014128_add_last_ci_minutes_notification_at_to_namespaces.rb deleted file mode 100644 index 53b2e9f01fe..00000000000 --- a/db/migrate/20190606014128_add_last_ci_minutes_notification_at_to_namespaces.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddLastCiMinutesNotificationAtToNamespaces < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def change - add_column :namespaces, :last_ci_minutes_notification_at, :datetime_with_timezone # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20190606034427_add_lfs_object_id_index_to_lfs_objects_projects.rb b/db/migrate/20190606034427_add_lfs_object_id_index_to_lfs_objects_projects.rb deleted file mode 100644 index fc09fcfae0f..00000000000 --- a/db/migrate/20190606034427_add_lfs_object_id_index_to_lfs_objects_projects.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddLfsObjectIdIndexToLfsObjectsProjects < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :lfs_objects_projects, :lfs_object_id - end - - def down - remove_concurrent_index :lfs_objects_projects, :lfs_object_id - end -end diff --git a/db/migrate/20190606054649_change_operations_feature_flags_clients_token_not_null.rb b/db/migrate/20190606054649_change_operations_feature_flags_clients_token_not_null.rb deleted file mode 100644 index c9dbb48f5bd..00000000000 --- a/db/migrate/20190606054649_change_operations_feature_flags_clients_token_not_null.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class ChangeOperationsFeatureFlagsClientsTokenNotNull < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - change_column_null :operations_feature_flags_clients, :token, true - end -end diff --git a/db/migrate/20190606054742_add_token_encrypted_to_operations_feature_flags_clients.rb b/db/migrate/20190606054742_add_token_encrypted_to_operations_feature_flags_clients.rb deleted file mode 100644 index 01cd49ac219..00000000000 --- a/db/migrate/20190606054742_add_token_encrypted_to_operations_feature_flags_clients.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddTokenEncryptedToOperationsFeatureFlagsClients < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :operations_feature_flags_clients, :token_encrypted, :string - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190606054832_add_index_to_operations_feature_flags_clients_token_encrypted.rb b/db/migrate/20190606054832_add_index_to_operations_feature_flags_clients_token_encrypted.rb deleted file mode 100644 index 5627457af5c..00000000000 --- a/db/migrate/20190606054832_add_index_to_operations_feature_flags_clients_token_encrypted.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToOperationsFeatureFlagsClientsTokenEncrypted < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :operations_feature_flags_clients, [:project_id, :token_encrypted], - unique: true, name: "index_feature_flags_clients_on_project_id_and_token_encrypted" - end - - def down - remove_concurrent_index_by_name :operations_feature_flags_clients, "index_feature_flags_clients_on_project_id_and_token_encrypted" - end -end diff --git a/db/migrate/20190606202100_add_name_to_badges.rb b/db/migrate/20190606202100_add_name_to_badges.rb deleted file mode 100644 index 7b386a6e690..00000000000 --- a/db/migrate/20190606202100_add_name_to_badges.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddNameToBadges < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :badges, :name, :string, null: true, limit: 255 # rubocop:disable Migration/PreventStrings - end -end diff --git a/db/migrate/20190607085356_add_source_to_pages_domains.rb b/db/migrate/20190607085356_add_source_to_pages_domains.rb deleted file mode 100644 index d681ab67431..00000000000 --- a/db/migrate/20190607085356_add_source_to_pages_domains.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddSourceToPagesDomains < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default(:pages_domains, :certificate_source, :smallint, default: 0) # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column(:pages_domains, :certificate_source) - end -end diff --git a/db/migrate/20190607145325_add_pages_domains_ssl_renew_index.rb b/db/migrate/20190607145325_add_pages_domains_ssl_renew_index.rb deleted file mode 100644 index 7167accbf1e..00000000000 --- a/db/migrate/20190607145325_add_pages_domains_ssl_renew_index.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddPagesDomainsSslRenewIndex < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - INDEX_NAME = 'index_pages_domains_need_auto_ssl_renewal' - - disable_ddl_transaction! - - def up - add_concurrent_index(:pages_domains, [:certificate_source, :certificate_valid_not_after], - where: "auto_ssl_enabled = #{::Gitlab::Database.true_value}", name: INDEX_NAME) - end - - def down - remove_concurrent_index(:pages_domains, [:certificate_source, :certificate_valid_not_after], - where: "auto_ssl_enabled = #{::Gitlab::Database.true_value}", name: INDEX_NAME) - end -end diff --git a/db/migrate/20190607190856_add_index_to_users_public_emails.rb b/db/migrate/20190607190856_add_index_to_users_public_emails.rb deleted file mode 100644 index 81ec38b8b32..00000000000 --- a/db/migrate/20190607190856_add_index_to_users_public_emails.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddIndexToUsersPublicEmails < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :users, [:public_email], - where: "public_email != ''" - end - - def down - remove_concurrent_index :users, [:public_email], - where: "public_email != ''" - end -end diff --git a/db/migrate/20190607205656_add_wiki_columns_to_index_status.rb b/db/migrate/20190607205656_add_wiki_columns_to_index_status.rb deleted file mode 100644 index 0910d425212..00000000000 --- a/db/migrate/20190607205656_add_wiki_columns_to_index_status.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class AddWikiColumnsToIndexStatus < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :index_statuses, :last_wiki_commit, :binary - add_column :index_statuses, :wiki_indexed_at, :datetime_with_timezone - end -end diff --git a/db/migrate/20190610142825_add_index_to_members_invite_email.rb b/db/migrate/20190610142825_add_index_to_members_invite_email.rb deleted file mode 100644 index 58157cc5313..00000000000 --- a/db/migrate/20190610142825_add_index_to_members_invite_email.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddIndexToMembersInviteEmail < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :members, [:invite_email] - end - - def down - remove_concurrent_index :members, [:invite_email] - end -end diff --git a/db/migrate/20190611090827_add_time_tracking_limit_to_hours_to_application_settings.rb b/db/migrate/20190611090827_add_time_tracking_limit_to_hours_to_application_settings.rb deleted file mode 100644 index f0a3ec1d3bc..00000000000 --- a/db/migrate/20190611090827_add_time_tracking_limit_to_hours_to_application_settings.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddTimeTrackingLimitToHoursToApplicationSettings < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - # rubocop:disable Migration/AddColumnWithDefault - add_column_with_default :application_settings, :time_tracking_limit_to_hours, :boolean, default: false, allow_null: false - # rubocop:enable Migration/AddColumnWithDefault - end - - def down - remove_column :application_settings, :time_tracking_limit_to_hours - end -end diff --git a/db/migrate/20190611100201_add_geo_container_repository_updated_events_table.rb b/db/migrate/20190611100201_add_geo_container_repository_updated_events_table.rb deleted file mode 100644 index 8963e837e08..00000000000 --- a/db/migrate/20190611100201_add_geo_container_repository_updated_events_table.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddGeoContainerRepositoryUpdatedEventsTable < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - create_table :geo_container_repository_updated_events, force: :cascade do |t| - t.integer :container_repository_id, null: false - - t.index :container_repository_id, name: :idx_geo_con_rep_updated_events_on_container_repository_id, using: :btree - end - - add_column :geo_event_log, :container_repository_updated_event_id, :bigint - end -end diff --git a/db/migrate/20190611100202_add_index_to_geo_event_log.rb b/db/migrate/20190611100202_add_index_to_geo_event_log.rb deleted file mode 100644 index c5c855fed61..00000000000 --- a/db/migrate/20190611100202_add_index_to_geo_event_log.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToGeoEventLog < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :geo_event_log, :container_repository_updated_event_id - end - - def down - remove_concurrent_index(:geo_event_log, :container_repository_updated_event_id) - end -end diff --git a/db/migrate/20190611161641_add_target_project_id_to_merge_trains.rb b/db/migrate/20190611161641_add_target_project_id_to_merge_trains.rb deleted file mode 100644 index 7b73202ab8d..00000000000 --- a/db/migrate/20190611161641_add_target_project_id_to_merge_trains.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddTargetProjectIdToMergeTrains < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Rails/NotNullColumn - # rubocop:disable Migration/AddReference - # rubocop:disable Migration/AddLimitToTextColumns - def change - add_reference :merge_trains, :target_project, null: false, index: true, foreign_key: { on_delete: :cascade, to_table: :projects }, type: :integer - add_column :merge_trains, :target_branch, :text, null: false - end - # rubocop:enable Migration/AddLimitToTextColumns - # rubocop:enable Migration/AddReference - # rubocop:enable Rails/NotNullColumn -end diff --git a/db/migrate/20190612111201_add_geo_container_repository_counters.rb b/db/migrate/20190612111201_add_geo_container_repository_counters.rb deleted file mode 100644 index b73bb885ab7..00000000000 --- a/db/migrate/20190612111201_add_geo_container_repository_counters.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddGeoContainerRepositoryCounters < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - change_table :geo_node_statuses do |t| - t.column :container_repositories_count, :integer - t.column :container_repositories_synced_count, :integer - t.column :container_repositories_failed_count, :integer - t.column :container_repositories_registry_count, :integer - end - end -end diff --git a/db/migrate/20190612111404_add_geo_container_sync_capacity.rb b/db/migrate/20190612111404_add_geo_container_sync_capacity.rb deleted file mode 100644 index d4cd569f460..00000000000 --- a/db/migrate/20190612111404_add_geo_container_sync_capacity.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddGeoContainerSyncCapacity < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - change_table :geo_nodes do |t| - t.column :container_repositories_max_capacity, :integer, default: 10, null: false - end - end -end diff --git a/db/migrate/20190613030606_enable_hashed_storage_by_default.rb b/db/migrate/20190613030606_enable_hashed_storage_by_default.rb deleted file mode 100644 index 8edefd1273e..00000000000 --- a/db/migrate/20190613030606_enable_hashed_storage_by_default.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class EnableHashedStorageByDefault < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - change_column_default :application_settings, :hashed_storage_enabled, true - end - - def down - change_column_default :application_settings, :hashed_storage_enabled, false - end -end diff --git a/db/migrate/20190613044655_add_username_to_deploy_tokens.rb b/db/migrate/20190613044655_add_username_to_deploy_tokens.rb deleted file mode 100644 index ac5a6589f07..00000000000 --- a/db/migrate/20190613044655_add_username_to_deploy_tokens.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddUsernameToDeployTokens < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def change - add_column :deploy_tokens, :username, :string # rubocop:disable Migration/PreventStrings - end -end diff --git a/db/migrate/20190613073003_create_project_aliases.rb b/db/migrate/20190613073003_create_project_aliases.rb deleted file mode 100644 index ee111d437e9..00000000000 --- a/db/migrate/20190613073003_create_project_aliases.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class CreateProjectAliases < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - create_table :project_aliases do |t| - t.references :project, null: false, index: true, foreign_key: { on_delete: :cascade }, type: :integer - t.string :name, null: false, index: { unique: true } # rubocop:disable Migration/PreventStrings - - t.timestamps_with_timezone null: false - end - end -end diff --git a/db/migrate/20190617123615_add_grafana_to_settings.rb b/db/migrate/20190617123615_add_grafana_to_settings.rb deleted file mode 100644 index 2d2250cef27..00000000000 --- a/db/migrate/20190617123615_add_grafana_to_settings.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddGrafanaToSettings < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - def up - add_column_with_default(:application_settings, :grafana_enabled, :boolean, # rubocop:disable Migration/AddColumnWithDefault - default: false, allow_null: false) - end - - def down - remove_column(:application_settings, :grafana_enabled) - end -end diff --git a/db/migrate/20190620105427_change_null_private_profile_to_false.rb b/db/migrate/20190620105427_change_null_private_profile_to_false.rb deleted file mode 100644 index d820dbbe9d3..00000000000 --- a/db/migrate/20190620105427_change_null_private_profile_to_false.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -class ChangeNullPrivateProfileToFalse < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - DELAY = 30.seconds.to_i - BATCH_SIZE = 1_000 - - disable_ddl_transaction! - - class User < ActiveRecord::Base - self.table_name = 'users' - - include ::EachBatch - end - - def up - change_column_default :users, :private_profile, false - - # Migration will take about 120 hours - User.where(private_profile: nil).each_batch(of: BATCH_SIZE) do |batch, index| - range = batch.pluck('MIN(id)', 'MAX(id)').first - delay = index * DELAY - - BackgroundMigrationWorker.perform_in(delay.seconds, 'MigrateNullPrivateProfileToFalse', [*range]) - end - end - - def down - change_column_default :users, :private_profile, nil - end -end diff --git a/db/migrate/20190621022810_add_last_ci_minutes_usage_notification_level_to_namespaces.rb b/db/migrate/20190621022810_add_last_ci_minutes_usage_notification_level_to_namespaces.rb deleted file mode 100644 index 02e06703acc..00000000000 --- a/db/migrate/20190621022810_add_last_ci_minutes_usage_notification_level_to_namespaces.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddLastCiMinutesUsageNotificationLevelToNamespaces < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def change - add_column :namespaces, :last_ci_minutes_usage_notification_level, :integer # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20190621151636_add_merge_request_rebase_jid.rb b/db/migrate/20190621151636_add_merge_request_rebase_jid.rb deleted file mode 100644 index df1b1c79375..00000000000 --- a/db/migrate/20190621151636_add_merge_request_rebase_jid.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddMergeRequestRebaseJid < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def change - add_column :merge_requests, :rebase_jid, :string # rubocop:disable Migration/PreventStrings - end -end diff --git a/db/migrate/20190623212503_add_cluster_id_to_deployments.rb b/db/migrate/20190623212503_add_cluster_id_to_deployments.rb deleted file mode 100644 index cd0c4191568..00000000000 --- a/db/migrate/20190623212503_add_cluster_id_to_deployments.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddClusterIdToDeployments < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def change - add_column :deployments, :cluster_id, :integer - end -end diff --git a/db/migrate/20190624123615_add_grafana_url_to_settings.rb b/db/migrate/20190624123615_add_grafana_url_to_settings.rb deleted file mode 100644 index f10014872e9..00000000000 --- a/db/migrate/20190624123615_add_grafana_url_to_settings.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddGrafanaUrlToSettings < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def up - add_column_with_default(:application_settings, :grafana_url, :string, # rubocop:disable Migration/AddColumnWithDefault - default: '/-/grafana', allow_null: false) - end - # rubocop:enable Migration/PreventStrings - - def down - remove_column(:application_settings, :grafana_url) - end -end diff --git a/db/migrate/20190625115224_add_description_to_services.rb b/db/migrate/20190625115224_add_description_to_services.rb deleted file mode 100644 index bdd6d70cb0f..00000000000 --- a/db/migrate/20190625115224_add_description_to_services.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddDescriptionToServices < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :services, :description, :string, limit: 500 # rubocop:disable Migration/PreventStrings - end -end diff --git a/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb b/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb deleted file mode 100644 index 6fcadc0c82c..00000000000 --- a/db/migrate/20190626175626_add_group_creation_level_to_namespaces.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddGroupCreationLevelToNamespaces < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - add_column(:namespaces, :subgroup_creation_level, :integer) # rubocop:disable Migration/AddColumnsToWideTables - change_column_default(:namespaces, - :subgroup_creation_level, - ::Gitlab::Access::MAINTAINER_SUBGROUP_ACCESS) - end - - def down - remove_column(:namespaces, :subgroup_creation_level) - end -end diff --git a/db/migrate/20190627051902_add_cluster_id_index_fk_to_deployments.rb b/db/migrate/20190627051902_add_cluster_id_index_fk_to_deployments.rb deleted file mode 100644 index f41e5c80269..00000000000 --- a/db/migrate/20190627051902_add_cluster_id_index_fk_to_deployments.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddClusterIdIndexFkToDeployments < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :deployments, :cluster_id - - add_concurrent_foreign_key :deployments, :clusters, column: :cluster_id, on_delete: :nullify - end - - def down - remove_foreign_key :deployments, :clusters - - remove_concurrent_index :deployments, :cluster_id - end -end diff --git a/db/migrate/20190627100221_add_mr_productivity_metrics.rb b/db/migrate/20190627100221_add_mr_productivity_metrics.rb deleted file mode 100644 index b6f1520cb2d..00000000000 --- a/db/migrate/20190627100221_add_mr_productivity_metrics.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class AddMrProductivityMetrics < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def change - add_column :merge_request_metrics, :first_comment_at, :datetime_with_timezone - add_column :merge_request_metrics, :first_commit_at, :datetime_with_timezone - add_column :merge_request_metrics, :last_commit_at, :datetime_with_timezone - add_column :merge_request_metrics, :diff_size, :integer - add_column :merge_request_metrics, :modified_paths_size, :integer - add_column :merge_request_metrics, :commits_count, :integer - end -end diff --git a/db/migrate/20190627122264_add_foreign_keys_for_container_repository.rb b/db/migrate/20190627122264_add_foreign_keys_for_container_repository.rb deleted file mode 100644 index cf7fd03e9af..00000000000 --- a/db/migrate/20190627122264_add_foreign_keys_for_container_repository.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeysForContainerRepository < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key(:geo_container_repository_updated_events, :container_repositories, column: :container_repository_id, on_delete: :cascade) - - add_concurrent_foreign_key(:geo_event_log, :geo_container_repository_updated_events, column: :container_repository_updated_event_id, on_delete: :cascade) - end - - def down - if foreign_key_exists?(:geo_container_repository_updated_events, :container_repositories) - remove_foreign_key(:geo_container_repository_updated_events, :container_repositories) - end - - if foreign_key_exists?(:geo_event_log, :geo_container_repository_updated_events) - remove_foreign_key(:geo_event_log, :geo_container_repository_updated_events) - end - end -end diff --git a/db/migrate/20190628145246_add_strategies_to_operations_feature_flag_scopes.rb b/db/migrate/20190628145246_add_strategies_to_operations_feature_flag_scopes.rb deleted file mode 100644 index 185a2b04531..00000000000 --- a/db/migrate/20190628145246_add_strategies_to_operations_feature_flag_scopes.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddStrategiesToOperationsFeatureFlagScopes < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - # rubocop:disable Migration/AddColumnWithDefault - add_column_with_default :operations_feature_flag_scopes, :strategies, :jsonb, default: [{ name: "default", parameters: {} }] - # rubocop:enable Migration/AddColumnWithDefault - end - - def down - remove_column(:operations_feature_flag_scopes, :strategies) - end -end diff --git a/db/migrate/20190628185000_add_released_at_to_releases_table.rb b/db/migrate/20190628185000_add_released_at_to_releases_table.rb deleted file mode 100644 index ae55aa434d9..00000000000 --- a/db/migrate/20190628185000_add_released_at_to_releases_table.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddReleasedAtToReleasesTable < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column(:releases, :released_at, :datetime_with_timezone) - end -end diff --git a/db/migrate/20190628185004_backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table.rb b/db/migrate/20190628185004_backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table.rb deleted file mode 100644 index 1e5d3e8f235..00000000000 --- a/db/migrate/20190628185004_backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class BackfillAndAddNotNullConstraintToReleasedAtColumnOnReleasesTable < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - update_column_in_batches(:releases, :released_at, Arel.sql('created_at')) - change_column_null(:releases, :released_at, false) - end - - def down - change_column_null(:releases, :released_at, true) - end -end diff --git a/db/migrate/20190703043358_add_commit_id_to_draft_notes.rb b/db/migrate/20190703043358_add_commit_id_to_draft_notes.rb deleted file mode 100644 index 022400ce585..00000000000 --- a/db/migrate/20190703043358_add_commit_id_to_draft_notes.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddCommitIdToDraftNotes < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :draft_notes, :commit_id, :binary - end -end diff --git a/db/migrate/20190703130053_remove_gitaly_feature_flags.rb b/db/migrate/20190703130053_remove_gitaly_feature_flags.rb deleted file mode 100644 index 13ac10a5e21..00000000000 --- a/db/migrate/20190703130053_remove_gitaly_feature_flags.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -class RemoveGitalyFeatureFlags < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - FEATURES = %w[ - gitaly_batch_lfs_pointers gitaly_blame gitaly_blob_get_all_lfs_pointers gitaly_blob_get_new_lfs_pointers - gitaly_branch_names gitaly_branch_names_contains_sha gitaly_branches gitaly_bundle_to_disk - gitaly_calculate_checksum gitaly_can_be_merged gitaly_cherry_pick gitaly_commit_count - gitaly_commit_deltas gitaly_commit_languages gitaly_commit_messages gitaly_commit_patch - gitaly_commit_raw_diffs gitaly_commit_stats gitaly_commit_tree_entry gitaly_commits_between - gitaly_commits_by_message gitaly_conflicts_list_conflict_files gitaly_conflicts_resolve_conflicts gitaly_count_commits - gitaly_count_diverging_commits_no_max gitaly_create_branch gitaly_create_repo_from_bundle gitaly_create_repository - gitaly_delete_branch gitaly_delete_refs gitaly_delta_islands gitaly_deny_disk_acces - gitaly_diff_between gitaly_extract_commit_signature gitaly_fetch_ref gitaly_fetch_remote - gitaly_fetch_source_branch gitaly_filter_shas_with_signature gitaly_filter_shas_with_signatures gitaly_find_all_commits - gitaly_find_branch gitaly_find_commit gitaly_find_commits gitaly_find_ref_name - gitaly_force_push gitaly_fork_repository gitaly_garbage_collect gitaly_get_info_attributes - gitaly_git_blob_load_all_data gitaly_git_blob_raw gitaly_git_fsck gitaly_go-find-all-tags - gitaly_has_local_branches gitaly_import_repository gitaly_is_ancestor gitaly_last_commit_for_path - gitaly_license_short_name gitaly_list_blobs_by_sha_path gitaly_list_commits_by_oid gitaly_local_branches - gitaly_ls_files gitaly_merge_base gitaly_merged_branch_names gitaly_new_commits - gitaly_operation_user_add_tag gitaly_operation_user_commit_file gitaly_operation_user_commit_files gitaly_operation_user_create_branch - gitaly_operation_user_delete_branch gitaly_operation_user_delete_tag gitaly_operation_user_ff_branch gitaly_operation_user_merge_branch - gitaly_post_receive_pack gitaly_post_upload_pack gitaly_project_raw_show gitaly_raw_changes_between - gitaly_rebase gitaly_rebase_in_progress gitaly_ref_delete_refs gitaly_ref_exists - gitaly_ref_exists_branch gitaly_ref_exists_branches gitaly_ref_find_all_remote_branches gitaly_remote_add_remote - gitaly_remote_fetch_internal_remote gitaly_remote_remove_remote gitaly_remote_update_remote_mirror gitaly_remove_namespace - gitaly_repack_full gitaly_repack_incremental gitaly_repository_cleanup gitaly_repository_exists - gitaly_repository_size gitaly_root_ref gitaly_search_files_by_content gitaly_search_files_by_name - gitaly_squash gitaly_squash_in_progress gitaly_ssh_receive_pack gitaly_ssh_upload_pack - gitaly_submodule_url_for gitaly_tag_messages gitaly_tag_names gitaly_tag_names_contains_sha - gitaly_tags gitaly_tree_entries gitaly_wiki_delete_page gitaly_wiki_find_file - gitaly_wiki_find_page gitaly_wiki_get_all_pages gitaly_wiki_page_formatted_data gitaly_wiki_page_versions - gitaly_wiki_update_page gitaly_wiki_write_page gitaly_workhorse_archive gitaly_workhorse_raw_show - gitaly_workhorse_send_git_diff gitaly_workhorse_send_git_patch gitaly_write_config gitaly_write_ref - ] - - class Feature < ActiveRecord::Base - self.table_name = 'features' - end - - def up - Feature.where(key: FEATURES).delete_all - end -end diff --git a/db/migrate/20190703171157_add_sourcing_epic_dates.rb b/db/migrate/20190703171157_add_sourcing_epic_dates.rb deleted file mode 100644 index 202e2098d5b..00000000000 --- a/db/migrate/20190703171157_add_sourcing_epic_dates.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddSourcingEpicDates < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def change - add_column :epics, :start_date_sourcing_epic_id, :integer - add_column :epics, :due_date_sourcing_epic_id, :integer - end -end diff --git a/db/migrate/20190703171555_add_sourcing_epic_dates_fks.rb b/db/migrate/20190703171555_add_sourcing_epic_dates_fks.rb deleted file mode 100644 index 4995a3cd03f..00000000000 --- a/db/migrate/20190703171555_add_sourcing_epic_dates_fks.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class AddSourcingEpicDatesFks < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :epics, :start_date_sourcing_epic_id, where: 'start_date_sourcing_epic_id is not null' - add_concurrent_index :epics, :due_date_sourcing_epic_id, where: 'due_date_sourcing_epic_id is not null' - - add_concurrent_foreign_key :epics, :epics, column: :start_date_sourcing_epic_id, on_delete: :nullify - add_concurrent_foreign_key :epics, :epics, column: :due_date_sourcing_epic_id, on_delete: :nullify - end - - def down - remove_foreign_key_if_exists :epics, column: :start_date_sourcing_epic_id - remove_foreign_key_if_exists :epics, column: :due_date_sourcing_epic_id - - remove_concurrent_index :epics, :start_date_sourcing_epic_id - remove_concurrent_index :epics, :due_date_sourcing_epic_id - end -end diff --git a/db/migrate/20190709204413_add_rule_type_to_approval_project_rules.rb b/db/migrate/20190709204413_add_rule_type_to_approval_project_rules.rb deleted file mode 100644 index b11154d0f26..00000000000 --- a/db/migrate/20190709204413_add_rule_type_to_approval_project_rules.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddRuleTypeToApprovalProjectRules < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :approval_project_rules, :rule_type, :integer, limit: 2, default: 0, allow_null: false # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :approval_project_rules, :rule_type - end -end diff --git a/db/migrate/20190709220014_import_common_metrics_y_axis.rb b/db/migrate/20190709220014_import_common_metrics_y_axis.rb deleted file mode 100644 index 89ecf32ecc1..00000000000 --- a/db/migrate/20190709220014_import_common_metrics_y_axis.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class ImportCommonMetricsYAxis < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def up - ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute - end - - def down - # no-op - end -end diff --git a/db/migrate/20190709220143_add_index_to_issues_relative_position.rb b/db/migrate/20190709220143_add_index_to_issues_relative_position.rb deleted file mode 100644 index ec11c6d768f..00000000000 --- a/db/migrate/20190709220143_add_index_to_issues_relative_position.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToIssuesRelativePosition < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_NAME = 'index_issues_on_project_id_and_state_and_rel_position_and_id' - - def up - add_concurrent_index :issues, [:project_id, :state, :relative_position, :id], order: { id: :desc }, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :issues, INDEX_NAME - end -end diff --git a/db/migrate/20190710151229_add_index_to_approval_project_rules_rule_type.rb b/db/migrate/20190710151229_add_index_to_approval_project_rules_rule_type.rb deleted file mode 100644 index 64123c53c4a..00000000000 --- a/db/migrate/20190710151229_add_index_to_approval_project_rules_rule_type.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToApprovalProjectRulesRuleType < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :approval_project_rules, :rule_type - end - - def down - remove_concurrent_index :approval_project_rules, :rule_type - end -end diff --git a/db/migrate/20190711124721_create_job_variables.rb b/db/migrate/20190711124721_create_job_variables.rb deleted file mode 100644 index 6174afc236c..00000000000 --- a/db/migrate/20190711124721_create_job_variables.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class CreateJobVariables < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - # rubocop:disable Migration/AddLimitToTextColumns - def change - create_table :ci_job_variables do |t| - t.string :key, null: false - t.text :encrypted_value - t.string :encrypted_value_iv - t.references :job, null: false, index: true, foreign_key: { to_table: :ci_builds, on_delete: :cascade } - t.integer :variable_type, null: false, limit: 2, default: 1 - end - - add_index :ci_job_variables, [:key, :job_id], unique: true - end - # rubocop:enable Migration/AddLimitToTextColumns - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190711200053_change_deploy_tokens_token_not_null.rb b/db/migrate/20190711200053_change_deploy_tokens_token_not_null.rb deleted file mode 100644 index 14ccf544d0b..00000000000 --- a/db/migrate/20190711200053_change_deploy_tokens_token_not_null.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class ChangeDeployTokensTokenNotNull < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - change_column_null :deploy_tokens, :token, true - end -end diff --git a/db/migrate/20190711200508_add_token_encrypted_to_deploy_tokens.rb b/db/migrate/20190711200508_add_token_encrypted_to_deploy_tokens.rb deleted file mode 100644 index dff682e8ce7..00000000000 --- a/db/migrate/20190711200508_add_token_encrypted_to_deploy_tokens.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddTokenEncryptedToDeployTokens < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :deploy_tokens, :token_encrypted, :string, limit: 255 - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190712040400_add_environment_id_to_clusters_kubernetes_namespaces.rb b/db/migrate/20190712040400_add_environment_id_to_clusters_kubernetes_namespaces.rb deleted file mode 100644 index 7f465c0a962..00000000000 --- a/db/migrate/20190712040400_add_environment_id_to_clusters_kubernetes_namespaces.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class AddEnvironmentIdToClustersKubernetesNamespaces < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def change - # rubocop:disable Migration/AddReference - add_reference :clusters_kubernetes_namespaces, :environment, - index: true, type: :bigint, foreign_key: { on_delete: :nullify } - # rubocop:enable Migration/AddReference - end -end diff --git a/db/migrate/20190712040412_index_clusters_kubernetes_namespaces_on_environment_id.rb b/db/migrate/20190712040412_index_clusters_kubernetes_namespaces_on_environment_id.rb deleted file mode 100644 index 23082492091..00000000000 --- a/db/migrate/20190712040412_index_clusters_kubernetes_namespaces_on_environment_id.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class IndexClustersKubernetesNamespacesOnEnvironmentId < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_kubernetes_namespaces_on_cluster_project_environment_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :clusters_kubernetes_namespaces, [:cluster_id, :project_id, :environment_id], unique: true, name: INDEX_NAME - end - - def down - remove_concurrent_index :clusters_kubernetes_namespaces, name: INDEX_NAME - end -end diff --git a/db/migrate/20190712064021_add_namespace_per_environment_flag_to_clusters.rb b/db/migrate/20190712064021_add_namespace_per_environment_flag_to_clusters.rb deleted file mode 100644 index 771eb21c4b6..00000000000 --- a/db/migrate/20190712064021_add_namespace_per_environment_flag_to_clusters.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddNamespacePerEnvironmentFlagToClusters < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :clusters, :namespace_per_environment, :boolean, default: false # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :clusters, :namespace_per_environment - end -end diff --git a/db/migrate/20190715042813_add_issue_id_to_versions.rb b/db/migrate/20190715042813_add_issue_id_to_versions.rb deleted file mode 100644 index 623e72c1096..00000000000 --- a/db/migrate/20190715042813_add_issue_id_to_versions.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIssueIdToVersions < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - # rubocop:disable Migration/AddReference - add_reference :design_management_versions, :issue, index: true, foreign_key: { on_delete: :cascade } - # rubocop:enable Migration/AddReference - end - - def down - remove_reference :design_management_versions, :issue - end -end diff --git a/db/migrate/20190715043954_set_issue_id_for_all_versions.rb b/db/migrate/20190715043954_set_issue_id_for_all_versions.rb deleted file mode 100644 index 345b749f1a4..00000000000 --- a/db/migrate/20190715043954_set_issue_id_for_all_versions.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class SetIssueIdForAllVersions < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - execute('UPDATE design_management_versions as versions SET issue_id = ( - SELECT design_management_designs.issue_id - FROM design_management_designs - INNER JOIN design_management_designs_versions ON design_management_designs.id = design_management_designs_versions.design_id - WHERE design_management_designs_versions.version_id = versions.id - LIMIT 1 - )') - end - - def down - # no-op - end -end diff --git a/db/migrate/20190715140740_add_event_type_to_design_management_designs_versions.rb b/db/migrate/20190715140740_add_event_type_to_design_management_designs_versions.rb deleted file mode 100644 index 136a9d27e25..00000000000 --- a/db/migrate/20190715140740_add_event_type_to_design_management_designs_versions.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -# This migration sets up a event enum on the DesignsVersions join table -class AddEventTypeToDesignManagementDesignsVersions < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # We disable these cops here because adding this column is safe. The table does not - # have any data in it. - # rubocop: disable Migration/AddIndex - def up - add_column(:design_management_designs_versions, :event, :integer, - limit: 2, - null: false, - default: 0) - add_index(:design_management_designs_versions, :event) - end - - # rubocop: disable Migration/RemoveIndex - def down - remove_index(:design_management_designs_versions, :event) - remove_column(:design_management_designs_versions, :event) - end -end diff --git a/db/migrate/20190715142138_add_raw_blob_request_limit_to_application_settings.rb b/db/migrate/20190715142138_add_raw_blob_request_limit_to_application_settings.rb deleted file mode 100644 index e8198e11ea7..00000000000 --- a/db/migrate/20190715142138_add_raw_blob_request_limit_to_application_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddRawBlobRequestLimitToApplicationSettings < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :application_settings, :raw_blob_request_limit, :integer, default: 300, null: false - end -end diff --git a/db/migrate/20190715173819_add_object_storage_flag_to_geo_node.rb b/db/migrate/20190715173819_add_object_storage_flag_to_geo_node.rb deleted file mode 100644 index cbc353b6282..00000000000 --- a/db/migrate/20190715173819_add_object_storage_flag_to_geo_node.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddObjectStorageFlagToGeoNode < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :geo_nodes, :sync_object_storage, :boolean, default: false # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :geo_nodes, :sync_object_storage - end -end diff --git a/db/migrate/20190715215532_add_project_emails_disabled.rb b/db/migrate/20190715215532_add_project_emails_disabled.rb deleted file mode 100644 index 72dba82ef1c..00000000000 --- a/db/migrate/20190715215532_add_project_emails_disabled.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddProjectEmailsDisabled < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :projects, :emails_disabled, :boolean # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20190715215549_add_group_emails_disabled.rb b/db/migrate/20190715215549_add_group_emails_disabled.rb deleted file mode 100644 index 63a815cb880..00000000000 --- a/db/migrate/20190715215549_add_group_emails_disabled.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddGroupEmailsDisabled < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :namespaces, :emails_disabled, :boolean # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20190716144222_create_analytics_cycle_analytics_project_stages.rb b/db/migrate/20190716144222_create_analytics_cycle_analytics_project_stages.rb deleted file mode 100644 index 5723f6db0a3..00000000000 --- a/db/migrate/20190716144222_create_analytics_cycle_analytics_project_stages.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -class CreateAnalyticsCycleAnalyticsProjectStages < ActiveRecord::Migration[5.2] - DOWNTIME = false - - INDEX_PREFIX = 'index_analytics_ca_project_stages_' - - def change - create_table :analytics_cycle_analytics_project_stages do |t| - t.timestamps_with_timezone - t.integer :relative_position - t.integer :start_event_identifier, null: false - t.integer :end_event_identifier, null: false - - t.references(:project, - null: false, - foreign_key: { to_table: :projects, on_delete: :cascade }, - index: { name: INDEX_PREFIX + 'on_project_id' } - ) - t.references(:start_event_label, - foreign_key: { to_table: :labels, on_delete: :cascade }, - index: { name: INDEX_PREFIX + 'on_start_event_label_id' } - ) - t.references(:end_event_label, - foreign_key: { to_table: :labels, on_delete: :cascade }, - index: { name: INDEX_PREFIX + 'on_end_event_label_id' } - ) - t.boolean :hidden, default: false, null: false - t.boolean :custom, default: true, null: false - t.string :name, null: false, limit: 255 # rubocop:disable Migration/PreventStrings - end - - add_index :analytics_cycle_analytics_project_stages, [:project_id, :name], unique: true, name: INDEX_PREFIX + 'on_project_id_and_name' - add_index :analytics_cycle_analytics_project_stages, [:relative_position], name: INDEX_PREFIX + 'on_relative_position' - end -end diff --git a/db/migrate/20190719122333_add_login_recaptcha_protection_enabled_to_application_settings.rb b/db/migrate/20190719122333_add_login_recaptcha_protection_enabled_to_application_settings.rb deleted file mode 100644 index 4561e1e8aa9..00000000000 --- a/db/migrate/20190719122333_add_login_recaptcha_protection_enabled_to_application_settings.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddLoginRecaptchaProtectionEnabledToApplicationSettings < ActiveRecord::Migration[5.1] - DOWNTIME = false - - def change - add_column :application_settings, :login_recaptcha_protection_enabled, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20190719174505_add_index_to_deploy_tokens_token_encrypted.rb b/db/migrate/20190719174505_add_index_to_deploy_tokens_token_encrypted.rb deleted file mode 100644 index d58d1d8348c..00000000000 --- a/db/migrate/20190719174505_add_index_to_deploy_tokens_token_encrypted.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToDeployTokensTokenEncrypted < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :deploy_tokens, :token_encrypted, unique: true, name: "index_deploy_tokens_on_token_encrypted" - end - - def down - remove_concurrent_index_by_name :deploy_tokens, "index_deploy_tokens_on_token_encrypted" - end -end diff --git a/db/migrate/20190722104947_add_static_object_token_to_users.rb b/db/migrate/20190722104947_add_static_object_token_to_users.rb deleted file mode 100644 index 3983f076b3f..00000000000 --- a/db/migrate/20190722104947_add_static_object_token_to_users.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddStaticObjectTokenToUsers < ActiveRecord::Migration[5.2] - DOWNTIME = false - - disable_ddl_transaction! - - # rubocop:disable Migration/AddColumnsToWideTables - # rubocop:disable Migration/PreventStrings - def up - add_column :users, :static_object_token, :string, limit: 255 - end - # rubocop:enable Migration/PreventStrings - # rubocop:enable Migration/AddColumnsToWideTables - - def down - remove_column :users, :static_object_token - end -end diff --git a/db/migrate/20190722132830_add_static_objects_external_storage_columns_to_application_settings.rb b/db/migrate/20190722132830_add_static_objects_external_storage_columns_to_application_settings.rb deleted file mode 100644 index f493eae26a8..00000000000 --- a/db/migrate/20190722132830_add_static_objects_external_storage_columns_to_application_settings.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddStaticObjectsExternalStorageColumnsToApplicationSettings < ActiveRecord::Migration[5.2] - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :application_settings, :static_objects_external_storage_url, :string, limit: 255 - add_column :application_settings, :static_objects_external_storage_auth_token, :string, limit: 255 - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190722144316_create_milestone_releases_table.rb b/db/migrate/20190722144316_create_milestone_releases_table.rb deleted file mode 100644 index 55878bcec41..00000000000 --- a/db/migrate/20190722144316_create_milestone_releases_table.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class CreateMilestoneReleasesTable < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - create_table :milestone_releases do |t| - t.references :milestone, foreign_key: { on_delete: :cascade }, null: false, index: false - t.references :release, foreign_key: { on_delete: :cascade }, null: false - end - - add_index :milestone_releases, [:milestone_id, :release_id], unique: true, name: 'index_miletone_releases_on_milestone_and_release' - end - - def down - drop_table :milestone_releases - end -end diff --git a/db/migrate/20190723153247_create_allowed_email_domains_for_groups.rb b/db/migrate/20190723153247_create_allowed_email_domains_for_groups.rb deleted file mode 100644 index 71af7434f9d..00000000000 --- a/db/migrate/20190723153247_create_allowed_email_domains_for_groups.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class CreateAllowedEmailDomainsForGroups < ActiveRecord::Migration[5.2] - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def change - create_table :allowed_email_domains do |t| - t.timestamps_with_timezone null: false - t.references :group, references: :namespace, - column: :group_id, - type: :integer, - null: false, - index: true - t.foreign_key :namespaces, column: :group_id, on_delete: :cascade - t.string :domain, null: false, limit: 255 # rubocop:disable Migration/PreventStrings - end - end -end diff --git a/db/migrate/20190724112147_add_column_for_self_monitoring_project_id.rb b/db/migrate/20190724112147_add_column_for_self_monitoring_project_id.rb deleted file mode 100644 index cf44804cdb4..00000000000 --- a/db/migrate/20190724112147_add_column_for_self_monitoring_project_id.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddColumnForSelfMonitoringProjectId < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - # rubocop:disable Migration/AddReference - add_reference( - :application_settings, - :instance_administration_project, - index: { name: 'index_applicationsettings_on_instance_administration_project_id' }, - foreign_key: { to_table: :projects, on_delete: :nullify } - ) - # rubocop:enable Migration/AddReference - end -end diff --git a/db/migrate/20190725012225_change_outbound_local_requests_whitelist_default.rb b/db/migrate/20190725012225_change_outbound_local_requests_whitelist_default.rb deleted file mode 100644 index 21b00e0b7d9..00000000000 --- a/db/migrate/20190725012225_change_outbound_local_requests_whitelist_default.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class ChangeOutboundLocalRequestsWhitelistDefault < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - class ApplicationSetting < ActiveRecord::Base - self.table_name = 'application_settings' - end - - def up - default_value = [] - - change_column_default(:application_settings, :outbound_local_requests_whitelist, default_value) - - ApplicationSetting - .where(outbound_local_requests_whitelist: nil) - .update(outbound_local_requests_whitelist: default_value) - - change_column_null(:application_settings, :outbound_local_requests_whitelist, false) - end - - def down - change_column_null(:application_settings, :outbound_local_requests_whitelist, true) - - change_column_default(:application_settings, :outbound_local_requests_whitelist, nil) - end -end diff --git a/db/migrate/20190725183432_add_index_to_index_on_static_object_token.rb b/db/migrate/20190725183432_add_index_to_index_on_static_object_token.rb deleted file mode 100644 index 423c45b9543..00000000000 --- a/db/migrate/20190725183432_add_index_to_index_on_static_object_token.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddIndexToIndexOnStaticObjectToken < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :users, :static_object_token, unique: true - end - - def down - remove_concurrent_index :users, :static_object_token - end -end diff --git a/db/migrate/20190726101050_rename_allow_local_requests_from_hooks_and_services_application_setting.rb b/db/migrate/20190726101050_rename_allow_local_requests_from_hooks_and_services_application_setting.rb deleted file mode 100644 index cce8942128c..00000000000 --- a/db/migrate/20190726101050_rename_allow_local_requests_from_hooks_and_services_application_setting.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RenameAllowLocalRequestsFromHooksAndServicesApplicationSetting < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - rename_column_concurrently :application_settings, :allow_local_requests_from_hooks_and_services, :allow_local_requests_from_web_hooks_and_services - end - - def down - undo_rename_column_concurrently :application_settings, :allow_local_requests_from_hooks_and_services, :allow_local_requests_from_web_hooks_and_services - end -end diff --git a/db/migrate/20190726101133_add_allow_local_requests_from_system_hooks_to_application_settings.rb b/db/migrate/20190726101133_add_allow_local_requests_from_system_hooks_to_application_settings.rb deleted file mode 100644 index 95d4f956f93..00000000000 --- a/db/migrate/20190726101133_add_allow_local_requests_from_system_hooks_to_application_settings.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddAllowLocalRequestsFromSystemHooksToApplicationSettings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - add_column(:application_settings, :allow_local_requests_from_system_hooks, - :boolean, - default: true, - null: false) - end - - def down - remove_column(:application_settings, :allow_local_requests_from_system_hooks) - end -end diff --git a/db/migrate/20190729062536_create_analytics_cycle_analytics_group_stages.rb b/db/migrate/20190729062536_create_analytics_cycle_analytics_group_stages.rb deleted file mode 100644 index d438ece9951..00000000000 --- a/db/migrate/20190729062536_create_analytics_cycle_analytics_group_stages.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -class CreateAnalyticsCycleAnalyticsGroupStages < ActiveRecord::Migration[5.2] - DOWNTIME = false - - INDEX_PREFIX = 'index_analytics_ca_group_stages_' - - def change - create_table :analytics_cycle_analytics_group_stages do |t| - t.timestamps_with_timezone - t.integer :relative_position - t.integer :start_event_identifier, null: false - t.integer :end_event_identifier, null: false - - t.references(:group, - null: false, - foreign_key: { to_table: :namespaces, on_delete: :cascade }, - index: { name: INDEX_PREFIX + 'on_group_id' } - ) - t.references(:start_event_label, - foreign_key: { to_table: :labels, on_delete: :cascade }, - index: { name: INDEX_PREFIX + 'on_start_event_label_id' } - ) - t.references(:end_event_label, - foreign_key: { to_table: :labels, on_delete: :cascade }, - index: { name: INDEX_PREFIX + 'on_end_event_label_id' } - ) - t.boolean :hidden, default: false, null: false - t.boolean :custom, default: true, null: false - t.string :name, null: false, limit: 255 # rubocop:disable Migration/PreventStrings - end - - add_index :analytics_cycle_analytics_group_stages, [:group_id, :name], unique: true, name: INDEX_PREFIX + 'on_group_id_and_name' - add_index :analytics_cycle_analytics_group_stages, [:relative_position], name: INDEX_PREFIX + 'on_relative_position' - end -end diff --git a/db/migrate/20190729090456_add_index_on_environments_with_state.rb b/db/migrate/20190729090456_add_index_on_environments_with_state.rb deleted file mode 100644 index 9a8d8391415..00000000000 --- a/db/migrate/20190729090456_add_index_on_environments_with_state.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnEnvironmentsWithState < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :environments, [:project_id, :state] - end - - def down - remove_concurrent_index :environments, [:project_id, :state] - end -end diff --git a/db/migrate/20190729180447_add_merge_requests_require_code_owner_approval_to_protected_branches.rb b/db/migrate/20190729180447_add_merge_requests_require_code_owner_approval_to_protected_branches.rb deleted file mode 100644 index bfac67606d6..00000000000 --- a/db/migrate/20190729180447_add_merge_requests_require_code_owner_approval_to_protected_branches.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class AddMergeRequestsRequireCodeOwnerApprovalToProtectedBranches < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default( # rubocop:disable Migration/AddColumnWithDefault - :protected_branches, - :code_owner_approval_required, - :boolean, - default: false - ) - - add_concurrent_index( - :protected_branches, - [:project_id, :code_owner_approval_required], - name: "code_owner_approval_required", - where: "code_owner_approval_required = #{Gitlab::Database.true_value}") - end - - def down - remove_concurrent_index(:protected_branches, name: "code_owner_approval_required") - - remove_column(:protected_branches, :code_owner_approval_required) - end -end diff --git a/db/migrate/20190731084415_add_build_need.rb b/db/migrate/20190731084415_add_build_need.rb deleted file mode 100644 index ba044260db2..00000000000 --- a/db/migrate/20190731084415_add_build_need.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddBuildNeed < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - create_table :ci_build_needs, id: :serial do |t| - t.integer :build_id, null: false - t.text :name, null: false # rubocop:disable Migration/AddLimitToTextColumns - - t.index [:build_id, :name], unique: true - t.foreign_key :ci_builds, column: :build_id, on_delete: :cascade - end - end -end diff --git a/db/migrate/20190801060809_delete_kubernetes_services.rb b/db/migrate/20190801060809_delete_kubernetes_services.rb deleted file mode 100644 index 88717293817..00000000000 --- a/db/migrate/20190801060809_delete_kubernetes_services.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class DeleteKubernetesServices < ActiveRecord::Migration[5.2] - DOWNTIME = false - - class Service < ActiveRecord::Base - self.table_name = 'services' - self.inheritance_column = :_type_disabled - end - - def up - Service.where(type: "KubernetesService").delete_all - end - - def down - # no-op - end -end diff --git a/db/migrate/20190801142441_add_throttle_protected_path_columns.rb b/db/migrate/20190801142441_add_throttle_protected_path_columns.rb deleted file mode 100644 index f9e0922ad66..00000000000 --- a/db/migrate/20190801142441_add_throttle_protected_path_columns.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class AddThrottleProtectedPathColumns < ActiveRecord::Migration[5.2] - DOWNTIME = false - - DEFAULT_PROTECTED_PATHS = [ - '/users/password', - '/users/sign_in', - '/api/v3/session.json', - '/api/v3/session', - '/api/v4/session.json', - '/api/v4/session', - '/users', - '/users/confirmation', - '/unsubscribes/', - '/import/github/personal_access_token' - ] - - # rubocop:disable Migration/PreventStrings - def change - add_column :application_settings, :throttle_protected_paths_enabled, :boolean, default: true, null: false - add_column :application_settings, :throttle_protected_paths_requests_per_period, :integer, default: 10, null: false - add_column :application_settings, :throttle_protected_paths_period_in_seconds, :integer, default: 60, null: false - add_column :application_settings, :protected_paths, :string, array: true, limit: 255, default: DEFAULT_PROTECTED_PATHS - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190801193427_rename_application_settings_snowplow_collector_uri_column.rb b/db/migrate/20190801193427_rename_application_settings_snowplow_collector_uri_column.rb deleted file mode 100644 index fba9849d3eb..00000000000 --- a/db/migrate/20190801193427_rename_application_settings_snowplow_collector_uri_column.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RenameApplicationSettingsSnowplowCollectorUriColumn < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - rename_column_concurrently :application_settings, :snowplow_collector_uri, :snowplow_collector_hostname - end - - def down - undo_rename_column_concurrently :application_settings, :snowplow_collector_uri, :snowplow_collector_hostname - end -end diff --git a/db/migrate/20190802012622_reorder_issues_project_id_relative_position_index.rb b/db/migrate/20190802012622_reorder_issues_project_id_relative_position_index.rb deleted file mode 100644 index 12088dd763f..00000000000 --- a/db/migrate/20190802012622_reorder_issues_project_id_relative_position_index.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class ReorderIssuesProjectIdRelativePositionIndex < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - OLD_INDEX_NAME = 'index_issues_on_project_id_and_state_and_rel_position_and_id' - NEW_INDEX_NAME = 'index_issues_on_project_id_and_rel_position_and_state_and_id' - - def up - add_concurrent_index :issues, [:project_id, :relative_position, :state, :id], order: { id: :desc }, name: NEW_INDEX_NAME - - remove_concurrent_index_by_name :issues, OLD_INDEX_NAME - end - - def down - add_concurrent_index :issues, [:project_id, :state, :relative_position, :id], order: { id: :desc }, name: OLD_INDEX_NAME - - remove_concurrent_index_by_name :issues, NEW_INDEX_NAME - end -end diff --git a/db/migrate/20190802195602_add_timestamps_columns_to_geo_nodes.rb b/db/migrate/20190802195602_add_timestamps_columns_to_geo_nodes.rb deleted file mode 100644 index b95d9037afe..00000000000 --- a/db/migrate/20190802195602_add_timestamps_columns_to_geo_nodes.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddTimestampsColumnsToGeoNodes < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column(:geo_nodes, :created_at, :datetime_with_timezone, null: true) - add_column(:geo_nodes, :updated_at, :datetime_with_timezone, null: true) - end -end diff --git a/db/migrate/20190805140353_remove_rendundant_index_from_releases.rb b/db/migrate/20190805140353_remove_rendundant_index_from_releases.rb deleted file mode 100644 index 477f8a850f8..00000000000 --- a/db/migrate/20190805140353_remove_rendundant_index_from_releases.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class RemoveRendundantIndexFromReleases < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name :releases, 'index_releases_on_project_id' - - # This is an extra index that is not present in db/schema.rb but known to exist on some installs - remove_concurrent_index_by_name :releases, 'releases_project_id_idx' if index_exists_by_name?(:releases, 'releases_project_id_idx') - end - - def down - add_concurrent_index :releases, :project_id, name: 'index_releases_on_project_id' - end -end diff --git a/db/migrate/20190806071559_remove_epic_issues_default_relative_position.rb b/db/migrate/20190806071559_remove_epic_issues_default_relative_position.rb deleted file mode 100644 index 0994bbbfd17..00000000000 --- a/db/migrate/20190806071559_remove_epic_issues_default_relative_position.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class RemoveEpicIssuesDefaultRelativePosition < ActiveRecord::Migration[5.2] - DOWNTIME = false - - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - def up - # The column won't exist if someone installed EE, downgraded to CE - # before it was added in EE, then tries to upgrade CE. - if column_exists?(:epic_issues, :relative_position) - change_column_null :epic_issues, :relative_position, true - change_column_default :epic_issues, :relative_position, from: 1073741823, to: nil - else - add_column_with_default(:epic_issues, :relative_position, :integer, default: nil, allow_null: true) # rubocop:disable Migration/AddColumnWithDefault - end - end - - def down - change_column_default :epic_issues, :relative_position, from: nil, to: 1073741823 - change_column_null :epic_issues, :relative_position, false - end -end diff --git a/db/migrate/20190807023052_design_issue_id_nullable.rb b/db/migrate/20190807023052_design_issue_id_nullable.rb deleted file mode 100644 index 4429e23d520..00000000000 --- a/db/migrate/20190807023052_design_issue_id_nullable.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class DesignIssueIdNullable < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - change_column_null :design_management_designs, :issue_id, true - end -end diff --git a/db/migrate/20190808152507_add_projects_sorting_field_to_user_preferences.rb b/db/migrate/20190808152507_add_projects_sorting_field_to_user_preferences.rb deleted file mode 100644 index 5022ae843e7..00000000000 --- a/db/migrate/20190808152507_add_projects_sorting_field_to_user_preferences.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddProjectsSortingFieldToUserPreferences < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def up - add_column :user_preferences, :projects_sort, :string, limit: 64 - end - # rubocop:enable Migration/PreventStrings - - def down - remove_column :user_preferences, :projects_sort - end -end diff --git a/db/migrate/20190814205640_import_common_metrics_line_charts.rb b/db/migrate/20190814205640_import_common_metrics_line_charts.rb deleted file mode 100644 index 1c28d686a42..00000000000 --- a/db/migrate/20190814205640_import_common_metrics_line_charts.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class ImportCommonMetricsLineCharts < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute - end - - def down - # no-op - end -end diff --git a/db/migrate/20190815093936_add_index_notes_on_project_id_and_id_and_system_false.rb b/db/migrate/20190815093936_add_index_notes_on_project_id_and_id_and_system_false.rb deleted file mode 100644 index cbbece35901..00000000000 --- a/db/migrate/20190815093936_add_index_notes_on_project_id_and_id_and_system_false.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class AddIndexNotesOnProjectIdAndIdAndSystemFalse < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index(*index_arguments) - end - - def down - remove_concurrent_index(*index_arguments) - end - - private - - def index_arguments - [ - :notes, - [:project_id, :id], - { - name: 'index_notes_on_project_id_and_id_and_system_false', - where: 'NOT system' - } - ] - end -end diff --git a/db/migrate/20190815093949_remove_index_notes_on_noteable_type.rb b/db/migrate/20190815093949_remove_index_notes_on_noteable_type.rb deleted file mode 100644 index 158c88e6258..00000000000 --- a/db/migrate/20190815093949_remove_index_notes_on_noteable_type.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class RemoveIndexNotesOnNoteableType < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - remove_concurrent_index(*index_arguments) - end - - def down - add_concurrent_index(*index_arguments) - end - - private - - def index_arguments - [ - :notes, - [:noteable_type], - { - name: 'index_notes_on_noteable_type' - } - ] - end -end diff --git a/db/migrate/20190816151221_add_active_jobs_limit_to_plans.rb b/db/migrate/20190816151221_add_active_jobs_limit_to_plans.rb deleted file mode 100644 index 193e6cb188e..00000000000 --- a/db/migrate/20190816151221_add_active_jobs_limit_to_plans.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddActiveJobsLimitToPlans < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :plans, :active_jobs_limit, :integer, default: 0 # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :plans, :active_jobs_limit - end -end diff --git a/db/migrate/20190819131155_add_cluster_status_index_to_deployments.rb b/db/migrate/20190819131155_add_cluster_status_index_to_deployments.rb deleted file mode 100644 index bfa91e33558..00000000000 --- a/db/migrate/20190819131155_add_cluster_status_index_to_deployments.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddClusterStatusIndexToDeployments < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :deployments, [:cluster_id, :status] - end - - def down - remove_concurrent_index :deployments, [:cluster_id, :status] - end -end diff --git a/db/migrate/20190820163320_add_first_last_name_to_user.rb b/db/migrate/20190820163320_add_first_last_name_to_user.rb deleted file mode 100644 index 908f55fa821..00000000000 --- a/db/migrate/20190820163320_add_first_last_name_to_user.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddFirstLastNameToUser < ActiveRecord::Migration[5.2] - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # rubocop:disable Migration/AddColumnsToWideTables - # rubocop:disable Migration/PreventStrings - def change - add_column(:users, :first_name, :string, null: true, limit: 255) - add_column(:users, :last_name, :string, null: true, limit: 255) - end - # rubocop:enable Migration/PreventStrings - # rubocop:enable Migration/AddColumnsToWideTables -end diff --git a/db/migrate/20190821040941_create_cluster_providers_aws.rb b/db/migrate/20190821040941_create_cluster_providers_aws.rb deleted file mode 100644 index 666c33759a2..00000000000 --- a/db/migrate/20190821040941_create_cluster_providers_aws.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class CreateClusterProvidersAws < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - # rubocop:disable Migration/AddLimitToTextColumns - def change - create_table :cluster_providers_aws do |t| - t.references :cluster, null: false, type: :bigint, index: { unique: true }, foreign_key: { on_delete: :cascade } - t.references :created_by_user, type: :integer, foreign_key: { on_delete: :nullify, to_table: :users } - - t.integer :num_nodes, null: false - t.integer :status, null: false - - t.timestamps_with_timezone null: false - - t.string :key_name, null: false, limit: 255 - t.string :role_arn, null: false, limit: 2048 - t.string :region, null: false, limit: 255 - t.string :vpc_id, null: false, limit: 255 - t.string :subnet_ids, null: false, array: true, default: [], limit: 255 - t.string :security_group_id, null: false, limit: 255 - t.string :instance_type, null: false, limit: 255 - - t.string :access_key_id, limit: 255 - t.string :encrypted_secret_access_key_iv, limit: 255 - t.text :encrypted_secret_access_key - t.text :session_token - t.text :status_reason - - t.index [:cluster_id, :status] - end - end - # rubocop:enable Migration/AddLimitToTextColumns - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190822175441_rename_epics_state_to_state_id.rb b/db/migrate/20190822175441_rename_epics_state_to_state_id.rb deleted file mode 100644 index 7f40d164a8e..00000000000 --- a/db/migrate/20190822175441_rename_epics_state_to_state_id.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RenameEpicsStateToStateId < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - rename_column_concurrently :epics, :state, :state_id - end - - def down - cleanup_concurrent_column_rename :epics, :state_id, :state - end -end diff --git a/db/migrate/20190822181528_create_list_user_preferences.rb b/db/migrate/20190822181528_create_list_user_preferences.rb deleted file mode 100644 index a7993818b50..00000000000 --- a/db/migrate/20190822181528_create_list_user_preferences.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class CreateListUserPreferences < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :list_user_preferences do |t| - t.references :user, index: true, null: false, foreign_key: { on_delete: :cascade } - t.references :list, index: true, null: false, foreign_key: { on_delete: :cascade } - t.timestamps_with_timezone null: false - t.boolean :collapsed - end - - add_index :list_user_preferences, [:user_id, :list_id], unique: true - end -end diff --git a/db/migrate/20190823055948_change_clusters_namespace_per_environment_default.rb b/db/migrate/20190823055948_change_clusters_namespace_per_environment_default.rb deleted file mode 100644 index 919ce807869..00000000000 --- a/db/migrate/20190823055948_change_clusters_namespace_per_environment_default.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class ChangeClustersNamespacePerEnvironmentDefault < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - change_column_default :clusters, :namespace_per_environment, from: false, to: true - end -end diff --git a/db/migrate/20190826090628_remove_redundant_deployments_index.rb b/db/migrate/20190826090628_remove_redundant_deployments_index.rb deleted file mode 100644 index 6b009c17d64..00000000000 --- a/db/migrate/20190826090628_remove_redundant_deployments_index.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class RemoveRedundantDeploymentsIndex < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - remove_concurrent_index :deployments, :cluster_id - end - - def down - add_concurrent_index :deployments, :cluster_id - end -end diff --git a/db/migrate/20190826100605_add_group_column_to_events.rb b/db/migrate/20190826100605_add_group_column_to_events.rb deleted file mode 100644 index dfc9d8cbdf1..00000000000 --- a/db/migrate/20190826100605_add_group_column_to_events.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddGroupColumnToEvents < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column(:events, :group_id, :bigint) unless column_exists?(:events, :group_id) - add_concurrent_index(:events, :group_id) - add_concurrent_foreign_key(:events, :namespaces, column: :group_id, on_delete: :cascade) - end - - def down - remove_column(:events, :group_id) if column_exists?(:events, :group_id) - end -end diff --git a/db/migrate/20190827222124_add_sourcegraph_configuration_to_application_settings.rb b/db/migrate/20190827222124_add_sourcegraph_configuration_to_application_settings.rb deleted file mode 100644 index 1059f73db8a..00000000000 --- a/db/migrate/20190827222124_add_sourcegraph_configuration_to_application_settings.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddSourcegraphConfigurationToApplicationSettings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def up - add_column(:application_settings, :sourcegraph_enabled, :boolean, default: false, null: false) - add_column(:application_settings, :sourcegraph_url, :string, null: true, limit: 255) - end - # rubocop:enable Migration/PreventStrings - - def down - remove_column(:application_settings, :sourcegraph_enabled) - remove_column(:application_settings, :sourcegraph_url) - end -end diff --git a/db/migrate/20190828083843_add_index_to_ci_job_artifacts_on_project_id_for_security_reports.rb b/db/migrate/20190828083843_add_index_to_ci_job_artifacts_on_project_id_for_security_reports.rb deleted file mode 100644 index 5253f25aab4..00000000000 --- a/db/migrate/20190828083843_add_index_to_ci_job_artifacts_on_project_id_for_security_reports.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToCiJobArtifactsOnProjectIdForSecurityReports < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_job_artifacts, - :project_id, - name: "index_ci_job_artifacts_on_project_id_for_security_reports", - where: "file_type IN (5, 6, 7, 8)" - end - - def down - remove_concurrent_index :ci_job_artifacts, - :project_id, - name: "index_ci_job_artifacts_on_project_id_for_security_reports" - end -end diff --git a/db/migrate/20190828110802_add_not_null_constraints_to_prometheus_metrics_y_label_and_unit.rb b/db/migrate/20190828110802_add_not_null_constraints_to_prometheus_metrics_y_label_and_unit.rb deleted file mode 100644 index 1b238907af6..00000000000 --- a/db/migrate/20190828110802_add_not_null_constraints_to_prometheus_metrics_y_label_and_unit.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddNotNullConstraintsToPrometheusMetricsYLabelAndUnit < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - change_column_null(:prometheus_metrics, :y_label, false) - change_column_null(:prometheus_metrics, :unit, false) - end -end diff --git a/db/migrate/20190828170945_create_package_metadatum.rb b/db/migrate/20190828170945_create_package_metadatum.rb deleted file mode 100644 index 3047b812e0e..00000000000 --- a/db/migrate/20190828170945_create_package_metadatum.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class CreatePackageMetadatum < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - create_table :packages_package_metadata do |t| - t.references :package, index: { unique: true }, null: false, foreign_key: { to_table: :packages_packages, on_delete: :cascade }, type: :integer - t.binary :metadata, null: false - end - end -end diff --git a/db/migrate/20190828172831_create_package_tag.rb b/db/migrate/20190828172831_create_package_tag.rb deleted file mode 100644 index a70b71db51d..00000000000 --- a/db/migrate/20190828172831_create_package_tag.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -# frozen_string_literal: true . - -class CreatePackageTag < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - create_table :packages_package_tags do |t| - t.references :package, index: true, null: false, foreign_key: { to_table: :packages_packages, on_delete: :cascade }, type: :integer - t.string :name, limit: 255, null: false # rubocop:disable Migration/PreventStrings - end - end -end diff --git a/db/migrate/20190829131130_create_external_pull_requests.rb b/db/migrate/20190829131130_create_external_pull_requests.rb deleted file mode 100644 index 817f84017e2..00000000000 --- a/db/migrate/20190829131130_create_external_pull_requests.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class CreateExternalPullRequests < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX = 'index_external_pull_requests_on_project_and_branches' - - # rubocop:disable Migration/PreventStrings - def change - create_table :external_pull_requests do |t| - t.timestamps_with_timezone null: false - t.references :project, null: false, foreign_key: { on_delete: :cascade }, index: false - t.integer :pull_request_iid, null: false - t.integer :status, null: false, limit: 2 - t.string :source_branch, null: false, limit: 255 - t.string :target_branch, null: false, limit: 255 - t.string :source_repository, null: false, limit: 255 - t.string :target_repository, null: false, limit: 255 - t.binary :source_sha, null: false - t.binary :target_sha, null: false - - t.index [:project_id, :source_branch, :target_branch], unique: true, name: INDEX - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190830075508_add_external_pull_request_id_to_ci_pipelines.rb b/db/migrate/20190830075508_add_external_pull_request_id_to_ci_pipelines.rb deleted file mode 100644 index 5abf56742b1..00000000000 --- a/db/migrate/20190830075508_add_external_pull_request_id_to_ci_pipelines.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddExternalPullRequestIdToCiPipelines < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - add_column :ci_pipelines, :external_pull_request_id, :bigint - end - - def down - remove_column :ci_pipelines, :external_pull_request_id - end -end diff --git a/db/migrate/20190830080123_add_index_to_ci_pipelines_external_pull_request.rb b/db/migrate/20190830080123_add_index_to_ci_pipelines_external_pull_request.rb deleted file mode 100644 index d2f5ad7a420..00000000000 --- a/db/migrate/20190830080123_add_index_to_ci_pipelines_external_pull_request.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToCiPipelinesExternalPullRequest < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_pipelines, :external_pull_request_id, where: 'external_pull_request_id IS NOT NULL' - end - - def down - remove_concurrent_index :ci_pipelines, :external_pull_request_id - end -end diff --git a/db/migrate/20190830080626_add_foreign_key_to_ci_pipelines_external_pull_request.rb b/db/migrate/20190830080626_add_foreign_key_to_ci_pipelines_external_pull_request.rb deleted file mode 100644 index b38fda83047..00000000000 --- a/db/migrate/20190830080626_add_foreign_key_to_ci_pipelines_external_pull_request.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyToCiPipelinesExternalPullRequest < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :ci_pipelines, :external_pull_requests, column: :external_pull_request_id, on_delete: :nullify - end - - def down - remove_foreign_key :ci_pipelines, :external_pull_requests - end -end diff --git a/db/migrate/20190830140240_add_duplicated_to_to_issue.rb b/db/migrate/20190830140240_add_duplicated_to_to_issue.rb deleted file mode 100644 index b38e4302a0b..00000000000 --- a/db/migrate/20190830140240_add_duplicated_to_to_issue.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class AddDuplicatedToToIssue < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column :issues, :duplicated_to_id, :integer unless duplicated_to_id_exists? - add_concurrent_foreign_key :issues, :issues, column: :duplicated_to_id, on_delete: :nullify - add_concurrent_index :issues, :duplicated_to_id, where: 'duplicated_to_id IS NOT NULL' - end - - def down - remove_foreign_key_without_error(:issues, column: :duplicated_to_id) - remove_concurrent_index(:issues, :duplicated_to_id) - remove_column(:issues, :duplicated_to_id) if duplicated_to_id_exists? - end - - private - - def duplicated_to_id_exists? - column_exists?(:issues, :duplicated_to_id) - end -end diff --git a/db/migrate/20190901174200_add_max_issue_count_to_list.rb b/db/migrate/20190901174200_add_max_issue_count_to_list.rb deleted file mode 100644 index 7408d2f1c93..00000000000 --- a/db/migrate/20190901174200_add_max_issue_count_to_list.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddMaxIssueCountToList < ActiveRecord::Migration[4.2] - include Gitlab::Database::MigrationHelpers - disable_ddl_transaction! - - DOWNTIME = false - - def up - add_column_with_default :lists, :max_issue_count, :integer, default: 0 # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :lists, :max_issue_count - end -end diff --git a/db/migrate/20190902131045_replace_indexes_for_counting_active_users.rb b/db/migrate/20190902131045_replace_indexes_for_counting_active_users.rb deleted file mode 100644 index 2c7c47bee96..00000000000 --- a/db/migrate/20190902131045_replace_indexes_for_counting_active_users.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class ReplaceIndexesForCountingActiveUsers < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name(:users, 'index_users_on_state_and_internal') - - add_concurrent_index(:users, :state, where: 'ghost IS NOT TRUE', name: 'index_users_on_state_and_internal') - add_concurrent_index(:users, :state, where: 'ghost IS NOT TRUE AND bot_type IS NULL', name: 'index_users_on_state_and_internal_ee') - end - - def down - remove_concurrent_index_by_name(:users, 'index_users_on_state_and_internal_ee') - remove_concurrent_index_by_name(:users, 'index_users_on_state_and_internal') - - add_concurrent_index(:users, :state, where: 'ghost <> true AND bot_type IS NULL', name: 'index_users_on_state_and_internal') - end -end diff --git a/db/migrate/20190902152329_add_index_for_ci_builds_metrics.rb b/db/migrate/20190902152329_add_index_for_ci_builds_metrics.rb deleted file mode 100644 index b755d60e311..00000000000 --- a/db/migrate/20190902152329_add_index_for_ci_builds_metrics.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexForCiBuildsMetrics < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_NAME = 'ci_builds_gitlab_monitor_metrics' - - def up - add_concurrent_index(:ci_builds, [:status, :created_at, :project_id], where: "type = 'Ci::Build'", name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:ci_builds, INDEX_NAME) - end -end diff --git a/db/migrate/20190903150358_create_analytics_repository_files_table.rb b/db/migrate/20190903150358_create_analytics_repository_files_table.rb deleted file mode 100644 index 69c9cd504f4..00000000000 --- a/db/migrate/20190903150358_create_analytics_repository_files_table.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class CreateAnalyticsRepositoryFilesTable < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :analytics_repository_files do |t| - t.references :project, - index: false, - foreign_key: { on_delete: :cascade }, - null: false - t.string :file_path, - limit: 4096, - null: false - end - - add_index :analytics_repository_files, [:project_id, :file_path], unique: true - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190903150435_create_analytics_repository_file_edits_table.rb b/db/migrate/20190903150435_create_analytics_repository_file_edits_table.rb deleted file mode 100644 index dca3fa1b37d..00000000000 --- a/db/migrate/20190903150435_create_analytics_repository_file_edits_table.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class CreateAnalyticsRepositoryFileEditsTable < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - create_table :analytics_repository_file_edits do |t| - t.references :project, - index: true, - foreign_key: { on_delete: :cascade }, null: false - t.references :analytics_repository_file, - index: false, - foreign_key: { on_delete: :cascade }, - null: false - t.date :committed_date, - null: false - t.integer :num_edits, - null: false, - default: 0 - end - - add_index :analytics_repository_file_edits, - [:analytics_repository_file_id, :committed_date, :project_id], - name: 'index_file_edits_on_committed_date_file_id_and_project_id', - unique: true - end -end diff --git a/db/migrate/20190904173203_add_index_on_users_unconfirmed_email.rb b/db/migrate/20190904173203_add_index_on_users_unconfirmed_email.rb deleted file mode 100644 index e78d47f023f..00000000000 --- a/db/migrate/20190904173203_add_index_on_users_unconfirmed_email.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnUsersUnconfirmedEmail < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :users, :unconfirmed_email, where: 'unconfirmed_email IS NOT NULL' - end - - def down - remove_concurrent_index :users, :unconfirmed_email, where: 'unconfirmed_email IS NOT NULL' - end -end diff --git a/db/migrate/20190905022045_add_issues_prometheus_alert_event_join_table.rb b/db/migrate/20190905022045_add_issues_prometheus_alert_event_join_table.rb deleted file mode 100644 index 861b97f0a09..00000000000 --- a/db/migrate/20190905022045_add_issues_prometheus_alert_event_join_table.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class AddIssuesPrometheusAlertEventJoinTable < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - create_table :issues_prometheus_alert_events, id: false do |t| - t.references :issue, null: false, - index: false, # Uses the index below - foreign_key: { on_delete: :cascade } - t.references :prometheus_alert_event, null: false, - index: { name: 'issue_id_issues_prometheus_alert_events_index' }, - foreign_key: { on_delete: :cascade } - - t.timestamps_with_timezone - t.index [:issue_id, :prometheus_alert_event_id], - unique: true, name: 'issue_id_prometheus_alert_event_id_index' - end - end -end diff --git a/db/migrate/20190905074652_index_timestamp_columns_for_issue_metrics.rb b/db/migrate/20190905074652_index_timestamp_columns_for_issue_metrics.rb deleted file mode 100644 index e468b2decd9..00000000000 --- a/db/migrate/20190905074652_index_timestamp_columns_for_issue_metrics.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class IndexTimestampColumnsForIssueMetrics < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index(*index_arguments) - end - - def down - remove_concurrent_index(*index_arguments) - end - - private - - def index_arguments - [ - :issue_metrics, - [:issue_id, :first_mentioned_in_commit_at, :first_associated_with_milestone_at, :first_added_to_board_at], - { - name: 'index_issue_metrics_on_issue_id_and_timestamps' - } - ] - end -end diff --git a/db/migrate/20190905140605_add_cloud_run_to_clusters_providers_gcp.rb b/db/migrate/20190905140605_add_cloud_run_to_clusters_providers_gcp.rb deleted file mode 100644 index cd6b2fb7d4f..00000000000 --- a/db/migrate/20190905140605_add_cloud_run_to_clusters_providers_gcp.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddCloudRunToClustersProvidersGcp < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default(:cluster_providers_gcp, :cloud_run, :boolean, default: false) # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column(:cluster_providers_gcp, :cloud_run) - end -end diff --git a/db/migrate/20190905223800_add_interruptible_to_builds_metadata.rb b/db/migrate/20190905223800_add_interruptible_to_builds_metadata.rb deleted file mode 100644 index a666b11013b..00000000000 --- a/db/migrate/20190905223800_add_interruptible_to_builds_metadata.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddInterruptibleToBuildsMetadata < ActiveRecord::Migration[5.0] - DOWNTIME = false - - def change - add_column :ci_builds_metadata, :interruptible, :boolean - end -end diff --git a/db/migrate/20190905223900_add_concurrent_index_to_builds_metadata.rb b/db/migrate/20190905223900_add_concurrent_index_to_builds_metadata.rb deleted file mode 100644 index d394f995673..00000000000 --- a/db/migrate/20190905223900_add_concurrent_index_to_builds_metadata.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddConcurrentIndexToBuildsMetadata < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_builds_metadata, [:build_id], - where: "interruptible = false", - name: "index_ci_builds_metadata_on_build_id_and_interruptible_false" - end - - def down - remove_concurrent_index_by_name(:ci_builds_metadata, 'index_ci_builds_metadata_on_build_id_and_interruptible_false') - end -end diff --git a/db/migrate/20190906104555_create_alerts_service_data.rb b/db/migrate/20190906104555_create_alerts_service_data.rb deleted file mode 100644 index 9388a205978..00000000000 --- a/db/migrate/20190906104555_create_alerts_service_data.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CreateAlertsServiceData < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :alerts_service_data do |t| - t.references :service, type: :integer, index: true, null: false, - foreign_key: { on_delete: :cascade } - t.timestamps_with_timezone - t.string :encrypted_token, limit: 255 - t.string :encrypted_token_iv, limit: 255 - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190907184714_add_show_whitespace_in_diffs_to_user_preferences.rb b/db/migrate/20190907184714_add_show_whitespace_in_diffs_to_user_preferences.rb deleted file mode 100644 index 41f9b36278a..00000000000 --- a/db/migrate/20190907184714_add_show_whitespace_in_diffs_to_user_preferences.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddShowWhitespaceInDiffsToUserPreferences < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :user_preferences, :show_whitespace_in_diffs, :boolean, default: true, allow_null: false # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :user_preferences, :show_whitespace_in_diffs - end -end diff --git a/db/migrate/20190909045845_create_project_pages_metadata.rb b/db/migrate/20190909045845_create_project_pages_metadata.rb deleted file mode 100644 index 5fc8fc6e6c1..00000000000 --- a/db/migrate/20190909045845_create_project_pages_metadata.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class CreateProjectPagesMetadata < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :project_pages_metadata, id: false do |t| - t.references :project, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade } - t.boolean :deployed, null: false, default: false - - t.index :project_id, name: 'index_project_pages_metadata_on_project_id_and_deployed_is_true', where: "deployed = TRUE" - end - end -end diff --git a/db/migrate/20190910103144_replace_events_index_on_group_id_with_partial_index.rb b/db/migrate/20190910103144_replace_events_index_on_group_id_with_partial_index.rb deleted file mode 100644 index 40a7454fd20..00000000000 --- a/db/migrate/20190910103144_replace_events_index_on_group_id_with_partial_index.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class ReplaceEventsIndexOnGroupIdWithPartialIndex < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index(:events, :group_id, where: 'group_id IS NOT NULL', name: 'index_events_on_group_id_partial') - remove_concurrent_index_by_name(:events, 'index_events_on_group_id') - end - - def down - add_concurrent_index(:events, :group_id, name: 'index_events_on_group_id') - remove_concurrent_index_by_name(:events, 'index_events_on_group_id_partial') - end -end diff --git a/db/migrate/20190910114843_exclude_nulls_from_index_on_namespaces_type.rb b/db/migrate/20190910114843_exclude_nulls_from_index_on_namespaces_type.rb deleted file mode 100644 index 8237c48b16d..00000000000 --- a/db/migrate/20190910114843_exclude_nulls_from_index_on_namespaces_type.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class ExcludeNullsFromIndexOnNamespacesType < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index(:namespaces, :type, where: 'type is not null', name: 'index_namespaces_on_type_partial') - remove_concurrent_index_by_name(:namespaces, 'index_namespaces_on_type') - end - - def down - add_concurrent_index(:namespaces, :type, name: 'index_namespaces_on_type') - remove_concurrent_index_by_name(:namespaces, 'index_namespaces_on_type_partial') - end -end diff --git a/db/migrate/20190910125852_create_analytics_language_trend_repository_languages.rb b/db/migrate/20190910125852_create_analytics_language_trend_repository_languages.rb deleted file mode 100644 index 1fc9034655c..00000000000 --- a/db/migrate/20190910125852_create_analytics_language_trend_repository_languages.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -class CreateAnalyticsLanguageTrendRepositoryLanguages < ActiveRecord::Migration[5.2] - DOWNTIME = false - INDEX_PREFIX = 'analytics_repository_languages_' - - def change - create_table :analytics_language_trend_repository_languages, id: false do |t| - t.integer :file_count, null: false, default: 0 - - t.references :programming_language, - null: false, - foreign_key: { on_delete: :cascade }, - index: false - t.references :project, - null: false, - foreign_key: { on_delete: :cascade }, - index: { name: INDEX_PREFIX + 'on_project_id' } - t.integer :loc, null: false, default: 0 - t.integer :bytes, null: false, default: 0 - # Storing percentage (with 2 decimal places), on 2 bytes. - # 50.25% => 5025 - # Max: 100.00% => 10000 (fits smallint: 32767) - t.integer :percentage, limit: 2, null: false, default: 0 - t.date :snapshot_date, null: false - end - - add_index :analytics_language_trend_repository_languages, %I[ - programming_language_id - project_id - snapshot_date - ], name: INDEX_PREFIX + 'unique_index', unique: true - end -end diff --git a/db/migrate/20190910211526_create_packages_conan_file_metadata.rb b/db/migrate/20190910211526_create_packages_conan_file_metadata.rb deleted file mode 100644 index a6830a93cbc..00000000000 --- a/db/migrate/20190910211526_create_packages_conan_file_metadata.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class CreatePackagesConanFileMetadata < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :packages_conan_file_metadata do |t| - t.references :package_file, index: { unique: true }, null: false, foreign_key: { to_table: :packages_package_files, on_delete: :cascade }, type: :bigint - t.timestamps_with_timezone - t.string "recipe_revision", null: false, default: "0", limit: 255 - t.string "package_revision", limit: 255 - t.string "conan_package_reference", limit: 255 - t.integer "conan_file_type", limit: 2, null: false - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190910212256_add_any_approver_rule_unique_indexes.rb b/db/migrate/20190910212256_add_any_approver_rule_unique_indexes.rb deleted file mode 100644 index e8f5b853d1d..00000000000 --- a/db/migrate/20190910212256_add_any_approver_rule_unique_indexes.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddAnyApproverRuleUniqueIndexes < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - PROJECT_RULE_UNIQUE_INDEX = 'any_approver_project_rule_type_unique_index' - MERGE_REQUEST_RULE_UNIQUE_INDEX = 'any_approver_merge_request_rule_type_unique_index' - - disable_ddl_transaction! - - def up - add_concurrent_index(:approval_project_rules, [:project_id], - where: "rule_type = 3", - name: PROJECT_RULE_UNIQUE_INDEX, unique: true) - - add_concurrent_index(:approval_merge_request_rules, [:merge_request_id, :rule_type], - where: "rule_type = 4", - name: MERGE_REQUEST_RULE_UNIQUE_INDEX, unique: true) - end - - def down - remove_concurrent_index_by_name(:approval_project_rules, PROJECT_RULE_UNIQUE_INDEX) - remove_concurrent_index_by_name(:approval_merge_request_rules, MERGE_REQUEST_RULE_UNIQUE_INDEX) - end -end diff --git a/db/migrate/20190911115056_add_projects_max_pages_size.rb b/db/migrate/20190911115056_add_projects_max_pages_size.rb deleted file mode 100644 index 70812e31ab8..00000000000 --- a/db/migrate/20190911115056_add_projects_max_pages_size.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddProjectsMaxPagesSize < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :projects, :max_pages_size, :integer # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20190911115109_add_namespaces_max_pages_size.rb b/db/migrate/20190911115109_add_namespaces_max_pages_size.rb deleted file mode 100644 index d3054714188..00000000000 --- a/db/migrate/20190911115109_add_namespaces_max_pages_size.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddNamespacesMaxPagesSize < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :namespaces, :max_pages_size, :integer # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20190911115207_add_projects_max_artifacts_size.rb b/db/migrate/20190911115207_add_projects_max_artifacts_size.rb deleted file mode 100644 index cd4574ad9c8..00000000000 --- a/db/migrate/20190911115207_add_projects_max_artifacts_size.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddProjectsMaxArtifactsSize < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :projects, :max_artifacts_size, :integer # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20190911115222_add_namespaces_max_artifacts_size.rb b/db/migrate/20190911115222_add_namespaces_max_artifacts_size.rb deleted file mode 100644 index bec81d6c7e1..00000000000 --- a/db/migrate/20190911115222_add_namespaces_max_artifacts_size.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddNamespacesMaxArtifactsSize < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :namespaces, :max_artifacts_size, :integer # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20190912061145_add_index_to_members_on_expires_at.rb b/db/migrate/20190912061145_add_index_to_members_on_expires_at.rb deleted file mode 100644 index e961977747b..00000000000 --- a/db/migrate/20190912061145_add_index_to_members_on_expires_at.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToMembersOnExpiresAt < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :members, :expires_at - end - - def down - remove_concurrent_index :members, :expires_at - end -end diff --git a/db/migrate/20190912223232_add_role_to_users.rb b/db/migrate/20190912223232_add_role_to_users.rb deleted file mode 100644 index a6405ab896d..00000000000 --- a/db/migrate/20190912223232_add_role_to_users.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddRoleToUsers < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :users, :role, :smallint # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20190913174707_add_spdx_id_to_software_licenses.rb b/db/migrate/20190913174707_add_spdx_id_to_software_licenses.rb deleted file mode 100644 index 46e1400c394..00000000000 --- a/db/migrate/20190913174707_add_spdx_id_to_software_licenses.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddSpdxIdToSoftwareLicenses < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def up - add_column :software_licenses, :spdx_identifier, :string, limit: 255 - end - # rubocop:enable Migration/PreventStrings - - def down - remove_column :software_licenses, :spdx_identifier - end -end diff --git a/db/migrate/20190913175827_add_index_to_software_licenses_on_spdx_id.rb b/db/migrate/20190913175827_add_index_to_software_licenses_on_spdx_id.rb deleted file mode 100644 index 94f8738b0cc..00000000000 --- a/db/migrate/20190913175827_add_index_to_software_licenses_on_spdx_id.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToSoftwareLicensesOnSpdxId < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :software_licenses, :spdx_identifier - end - - def down - remove_concurrent_index :software_licenses, :spdx_identifier - end -end diff --git a/db/migrate/20190914223900_modify_concurrent_index_to_builds_metadata.rb b/db/migrate/20190914223900_modify_concurrent_index_to_builds_metadata.rb deleted file mode 100644 index ad8979045e5..00000000000 --- a/db/migrate/20190914223900_modify_concurrent_index_to_builds_metadata.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class ModifyConcurrentIndexToBuildsMetadata < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_builds_metadata, [:build_id], - where: "interruptible = true", - name: "index_ci_builds_metadata_on_build_id_and_interruptible" - remove_concurrent_index_by_name(:ci_builds_metadata, 'index_ci_builds_metadata_on_build_id_and_interruptible_false') - end - - def down - remove_concurrent_index_by_name(:ci_builds_metadata, 'index_ci_builds_metadata_on_build_id_and_interruptible') - add_concurrent_index :ci_builds_metadata, [:build_id], - where: "interruptible = false", - name: "index_ci_builds_metadata_on_build_id_and_interruptible_false" - end -end diff --git a/db/migrate/20190918025618_add_user_and_timestamps_to_design_management_versions.rb b/db/migrate/20190918025618_add_user_and_timestamps_to_design_management_versions.rb deleted file mode 100644 index 3daca8a8e97..00000000000 --- a/db/migrate/20190918025618_add_user_and_timestamps_to_design_management_versions.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddUserAndTimestampsToDesignManagementVersions < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - add_column :design_management_versions, :user_id, :integer - add_column :design_management_versions, :created_at, :datetime_with_timezone - end - - def down - remove_columns :design_management_versions, :user_id, :created_at - end -end diff --git a/db/migrate/20190918102042_create_grafana_integrations.rb b/db/migrate/20190918102042_create_grafana_integrations.rb deleted file mode 100644 index d48aaaf45bc..00000000000 --- a/db/migrate/20190918102042_create_grafana_integrations.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CreateGrafanaIntegrations < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :grafana_integrations do |t| - t.references :project, index: true, foreign_key: { on_delete: :cascade }, unique: true, null: false - t.timestamps_with_timezone null: false - t.string :encrypted_token, limit: 255, null: false - t.string :encrypted_token_iv, limit: 255, null: false - t.string :grafana_url, null: false, limit: 1024 - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190918104212_add_merge_request_metrics_merged_at_index.rb b/db/migrate/20190918104212_add_merge_request_metrics_merged_at_index.rb deleted file mode 100644 index 9db4e42f3ee..00000000000 --- a/db/migrate/20190918104212_add_merge_request_metrics_merged_at_index.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddMergeRequestMetricsMergedAtIndex < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :merge_request_metrics, [:merged_at, :id] - end - - def down - remove_concurrent_index :merge_request_metrics, [:merged_at, :id] - end -end diff --git a/db/migrate/20190918104731_add_cleanup_status_to_cluster.rb b/db/migrate/20190918104731_add_cleanup_status_to_cluster.rb deleted file mode 100644 index 62290fb0fa6..00000000000 --- a/db/migrate/20190918104731_add_cleanup_status_to_cluster.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddCleanupStatusToCluster < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default(:clusters, :cleanup_status, # rubocop:disable Migration/AddColumnWithDefault - :smallint, - default: 1, - allow_null: false) - end - - def down - remove_column(:clusters, :cleanup_status) - end -end diff --git a/db/migrate/20190918121135_add_cleanup_status_reason_to_cluster.rb b/db/migrate/20190918121135_add_cleanup_status_reason_to_cluster.rb deleted file mode 100644 index 85293ebbe86..00000000000 --- a/db/migrate/20190918121135_add_cleanup_status_reason_to_cluster.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class AddCleanupStatusReasonToCluster < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def change - add_column :clusters, :cleanup_status_reason, :text # rubocop:disable Migration/AddLimitToTextColumns - end -end diff --git a/db/migrate/20190919040324_add_successfull_pages_deploy_partial_index_on_ci_builds.rb b/db/migrate/20190919040324_add_successfull_pages_deploy_partial_index_on_ci_builds.rb deleted file mode 100644 index d736b21dddf..00000000000 --- a/db/migrate/20190919040324_add_successfull_pages_deploy_partial_index_on_ci_builds.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class AddSuccessfullPagesDeployPartialIndexOnCiBuilds < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_NAME = 'index_ci_builds_on_project_id_for_successfull_pages_deploy' - - def up - add_concurrent_index( - :ci_builds, :project_id, - name: INDEX_NAME, - where: "type='GenericCommitStatus' AND stage='deploy' AND name='pages:deploy' AND status = 'success'" - ) - end - - def down - remove_concurrent_index_by_name :ci_builds, INDEX_NAME - end -end diff --git a/db/migrate/20190919091300_create_evidences.rb b/db/migrate/20190919091300_create_evidences.rb deleted file mode 100644 index 3f861ed26bd..00000000000 --- a/db/migrate/20190919091300_create_evidences.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class CreateEvidences < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :evidences do |t| - t.references :release, foreign_key: { on_delete: :cascade }, null: false - t.timestamps_with_timezone - t.binary :summary_sha - t.jsonb :summary, null: false, default: {} - end - end -end diff --git a/db/migrate/20190919104119_index_timestamp_columns_for_merge_requests_creation_date.rb b/db/migrate/20190919104119_index_timestamp_columns_for_merge_requests_creation_date.rb deleted file mode 100644 index 5e0d80630cd..00000000000 --- a/db/migrate/20190919104119_index_timestamp_columns_for_merge_requests_creation_date.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class IndexTimestampColumnsForMergeRequestsCreationDate < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index(*index_arguments) - end - - def down - remove_concurrent_index(*index_arguments) - end - - private - - def index_arguments - [ - :merge_requests, - [:target_project_id, :created_at], - { - name: 'index_merge_requests_target_project_id_created_at' - } - ] - end -end diff --git a/db/migrate/20190919162036_add_index_to_clusters_providers_gcp_on_cloud_run.rb b/db/migrate/20190919162036_add_index_to_clusters_providers_gcp_on_cloud_run.rb deleted file mode 100644 index 8e0bde97cc1..00000000000 --- a/db/migrate/20190919162036_add_index_to_clusters_providers_gcp_on_cloud_run.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToClustersProvidersGcpOnCloudRun < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index(:cluster_providers_gcp, :cloud_run) - end - - def down - remove_concurrent_index(:cluster_providers_gcp, :cloud_run) - end -end diff --git a/db/migrate/20190919183411_add_index_packages_on_name_trigram_to_packages_packages.rb b/db/migrate/20190919183411_add_index_packages_on_name_trigram_to_packages_packages.rb deleted file mode 100644 index d359350a891..00000000000 --- a/db/migrate/20190919183411_add_index_packages_on_name_trigram_to_packages_packages.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexPackagesOnNameTrigramToPackagesPackages < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_packages_packages_on_name_trigram' - - disable_ddl_transaction! - - def up - add_concurrent_index :packages_packages, :name, name: INDEX_NAME, using: :gin, opclass: { name: :gin_trgm_ops } - end - - def down - remove_concurrent_index_by_name(:packages_packages, INDEX_NAME) - end -end diff --git a/db/migrate/20190920122420_add_max_personal_access_token_lifetime_to_application_settings.rb b/db/migrate/20190920122420_add_max_personal_access_token_lifetime_to_application_settings.rb deleted file mode 100644 index 5a6e810dede..00000000000 --- a/db/migrate/20190920122420_add_max_personal_access_token_lifetime_to_application_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddMaxPersonalAccessTokenLifetimeToApplicationSettings < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :application_settings, :max_personal_access_token_lifetime, :integer - end -end diff --git a/db/migrate/20190920194925_backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps.rb b/db/migrate/20190920194925_backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps.rb deleted file mode 100644 index f8f1c6c231b..00000000000 --- a/db/migrate/20190920194925_backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class BackfillReleasesTableUpdatedAtAndAddNotNullConstraintsToTimestamps < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - change_column_null(:releases, :created_at, false, Time.zone.now) - - update_column_in_batches(:releases, :updated_at, Arel.sql('created_at')) do |table, query| - query.where(table[:updated_at].eq(nil)) - end - - change_column_null(:releases, :updated_at, false, Time.zone.now) - end - - def down - change_column_null(:releases, :updated_at, true) - change_column_null(:releases, :created_at, true) - end -end diff --git a/db/migrate/20190920224341_create_merge_request_context_commits_and_diffs.rb b/db/migrate/20190920224341_create_merge_request_context_commits_and_diffs.rb deleted file mode 100644 index bd97d3d3183..00000000000 --- a/db/migrate/20190920224341_create_merge_request_context_commits_and_diffs.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class CreateMergeRequestContextCommitsAndDiffs < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - # rubocop:disable Migration/AddLimitToTextColumns - def change - create_table :merge_request_context_commits do |t| - t.references :merge_request, foreign_key: { on_delete: :cascade } - t.datetime_with_timezone :authored_date - t.datetime_with_timezone :committed_date - t.binary :sha, null: false - t.integer :relative_order, null: false - t.text :author_name - t.text :author_email - t.text :committer_name - t.text :committer_email - t.text :message - t.index [:merge_request_id, :sha], unique: true, name: 'index_mr_context_commits_on_merge_request_id_and_sha' - end - - create_table :merge_request_context_commit_diff_files, id: false do |t| - t.references :merge_request_context_commit, foreign_key: { on_delete: :cascade }, index: { name: "idx_mr_cc_diff_files_on_mr_cc_id" } - t.binary :sha, null: false - t.integer :relative_order, null: false - t.string :a_mode, null: false, limit: 255 - t.string :b_mode, null: false, limit: 255 - t.boolean :new_file, null: false - t.boolean :renamed_file, null: false - t.boolean :deleted_file, null: false - t.boolean :too_large, null: false - t.boolean :binary - t.text :new_path, null: false - t.text :old_path, null: false - t.text :diff - t.index [:merge_request_context_commit_id, :sha], name: 'idx_mr_cc_diff_files_on_mr_cc_id_and_sha' - end - end - # rubocop:enable Migration/AddLimitToTextColumns - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190924124627_add_pull_mirror_branch_prefix_to_projects.rb b/db/migrate/20190924124627_add_pull_mirror_branch_prefix_to_projects.rb deleted file mode 100644 index 2750468834f..00000000000 --- a/db/migrate/20190924124627_add_pull_mirror_branch_prefix_to_projects.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddPullMirrorBranchPrefixToProjects < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/AddColumnsToWideTables - # rubocop:disable Migration/PreventStrings - def change - add_column :projects, :pull_mirror_branch_prefix, :string, limit: 50 - end - # rubocop:enable Migration/PreventStrings - # rubocop:enable Migration/AddColumnsToWideTables -end diff --git a/db/migrate/20190925055714_default_request_access_groups.rb b/db/migrate/20190925055714_default_request_access_groups.rb deleted file mode 100644 index ba3efbe56f4..00000000000 --- a/db/migrate/20190925055714_default_request_access_groups.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class DefaultRequestAccessGroups < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - change_column_default :namespaces, :request_access_enabled, true - end - - def down - change_column_default :namespaces, :request_access_enabled, false - end -end diff --git a/db/migrate/20190925055902_default_request_access_projects.rb b/db/migrate/20190925055902_default_request_access_projects.rb deleted file mode 100644 index 3ad88d0963d..00000000000 --- a/db/migrate/20190925055902_default_request_access_projects.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class DefaultRequestAccessProjects < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - change_column_default :projects, :request_access_enabled, true - end - - def down - change_column_default :projects, :request_access_enabled, false - end -end diff --git a/db/migrate/20190926041216_add_user_indexes_to_design_management_versions.rb b/db/migrate/20190926041216_add_user_indexes_to_design_management_versions.rb deleted file mode 100644 index 6eb9fdbbcaa..00000000000 --- a/db/migrate/20190926041216_add_user_indexes_to_design_management_versions.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddUserIndexesToDesignManagementVersions < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :design_management_versions, :users, column: :user_id, on_delete: :nullify - add_concurrent_index :design_management_versions, :user_id, where: 'user_id IS NOT NULL' - end - - def down - remove_concurrent_index :design_management_versions, :user_id - remove_foreign_key :design_management_versions, column: :user_id - end -end diff --git a/db/migrate/20190926225633_create_x509_signatures.rb b/db/migrate/20190926225633_create_x509_signatures.rb deleted file mode 100644 index 40d2c351524..00000000000 --- a/db/migrate/20190926225633_create_x509_signatures.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class CreateX509Signatures < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :x509_issuers do |t| - t.timestamps_with_timezone null: false - - t.string :subject_key_identifier, index: true, null: false, unique: true, limit: 255 - t.string :subject, null: false, limit: 255 - t.string :crl_url, null: false, limit: 255 - end - - create_table :x509_certificates do |t| - t.timestamps_with_timezone null: false - - t.string :subject_key_identifier, index: true, null: false, unique: true, limit: 255 - t.string :subject, null: false, limit: 255 - t.string :email, null: false, limit: 255 - t.binary :serial_number, null: false - - t.integer :certificate_status, limit: 2, default: 0, null: false - - t.references :x509_issuer, index: true, null: false, foreign_key: { on_delete: :cascade } - end - - create_table :x509_commit_signatures do |t| - t.timestamps_with_timezone null: false - - t.references :project, index: true, null: false, foreign_key: { on_delete: :cascade } - t.references :x509_certificate, index: true, null: false, foreign_key: { on_delete: :cascade } - - t.binary :commit_sha, index: true, null: false - t.integer :verification_status, limit: 2, default: 0, null: false - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20190927055500_create_description_versions.rb b/db/migrate/20190927055500_create_description_versions.rb deleted file mode 100644 index b3082533a6f..00000000000 --- a/db/migrate/20190927055500_create_description_versions.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class CreateDescriptionVersions < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - create_table :description_versions do |t| - t.timestamps_with_timezone - t.references :issue, index: false, foreign_key: { on_delete: :cascade }, type: :integer - t.references :merge_request, index: false, foreign_key: { on_delete: :cascade }, type: :integer - t.references :epic, index: false, foreign_key: { on_delete: :cascade }, type: :integer - t.text :description # rubocop:disable Migration/AddLimitToTextColumns - end - - add_index :description_versions, :issue_id, where: 'issue_id IS NOT NULL' - add_index :description_versions, :merge_request_id, where: 'merge_request_id IS NOT NULL' - add_index :description_versions, :epic_id, where: 'epic_id IS NOT NULL' - - add_column :system_note_metadata, :description_version_id, :bigint - end - - def down - remove_column :system_note_metadata, :description_version_id - - drop_table :description_versions - end -end diff --git a/db/migrate/20190927055540_add_index_to_sytem_note_metadata_description_version_id.rb b/db/migrate/20190927055540_add_index_to_sytem_note_metadata_description_version_id.rb deleted file mode 100644 index 695ba955043..00000000000 --- a/db/migrate/20190927055540_add_index_to_sytem_note_metadata_description_version_id.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToSytemNoteMetadataDescriptionVersionId < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :system_note_metadata, :description_version_id, unique: true, where: 'description_version_id IS NOT NULL' - add_concurrent_foreign_key :system_note_metadata, :description_versions, column: :description_version_id, on_delete: :nullify - end - - def down - remove_foreign_key :system_note_metadata, column: :description_version_id - remove_concurrent_index :system_note_metadata, :description_version_id - end -end diff --git a/db/migrate/20190927074328_add_index_on_snippet_content.rb b/db/migrate/20190927074328_add_index_on_snippet_content.rb deleted file mode 100644 index ef7583508f2..00000000000 --- a/db/migrate/20190927074328_add_index_on_snippet_content.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnSnippetContent < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_snippets_on_content_trigram' - - disable_ddl_transaction! - - def up - add_concurrent_index :snippets, :content, name: INDEX_NAME, using: :gin, opclass: { content: :gin_trgm_ops } - end - - def down - remove_concurrent_index_by_name(:snippets, INDEX_NAME) - end -end diff --git a/db/migrate/20190929180751_create_vulnerabilities.rb b/db/migrate/20190929180751_create_vulnerabilities.rb deleted file mode 100644 index e4c53b1063a..00000000000 --- a/db/migrate/20190929180751_create_vulnerabilities.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class CreateVulnerabilities < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/AddLimitToTextColumns - def change - create_table :vulnerabilities do |t| - t.bigint "milestone_id" - t.bigint "epic_id" - t.bigint "project_id", null: false - t.bigint "author_id", null: false - t.bigint "updated_by_id" - t.bigint "last_edited_by_id" - t.bigint "start_date_sourcing_milestone_id" - t.bigint "due_date_sourcing_milestone_id" - t.bigint "closed_by_id" - t.datetime_with_timezone "last_edited_at" - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.datetime_with_timezone "closed_at" - t.date "start_date" - t.date "due_date" - t.integer "state", limit: 2, default: 1, null: false # initially: open, closed - t.integer "severity", limit: 2, null: false # auto-calculated as highest-severity finding, but overrideable - t.integer "confidence", limit: 2, null: false # auto-calculated as lowest-confidence finding, but overrideable - t.boolean "severity_overridden", default: false - t.boolean "confidence_overridden", default: false - t.string "title", limit: 255, null: false # rubocop:disable Migration/PreventStrings - t.text "title_html", null: false - t.text "description" - t.text "description_html" - end - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20190929180813_add_reference_from_vulnerability_occurrences_to_occurrences.rb b/db/migrate/20190929180813_add_reference_from_vulnerability_occurrences_to_occurrences.rb deleted file mode 100644 index eb8e8fb73d1..00000000000 --- a/db/migrate/20190929180813_add_reference_from_vulnerability_occurrences_to_occurrences.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddReferenceFromVulnerabilityOccurrencesToOccurrences < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :vulnerability_occurrences, :vulnerability_id, :bigint - end -end diff --git a/db/migrate/20190929180827_add_foreign_keys_and_indexes_to_vulnerabilities.rb b/db/migrate/20190929180827_add_foreign_keys_and_indexes_to_vulnerabilities.rb deleted file mode 100644 index 4d7c2363083..00000000000 --- a/db/migrate/20190929180827_add_foreign_keys_and_indexes_to_vulnerabilities.rb +++ /dev/null @@ -1,76 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddForeignKeysAndIndexesToVulnerabilities < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :vulnerabilities, :milestone_id - add_concurrent_foreign_key :vulnerabilities, :milestones, column: :milestone_id, on_delete: :nullify - - add_concurrent_index :vulnerabilities, :epic_id - add_concurrent_foreign_key :vulnerabilities, :epics, column: :epic_id, on_delete: :nullify - - add_concurrent_index :vulnerabilities, :project_id - add_concurrent_foreign_key :vulnerabilities, :projects, column: :project_id - - add_concurrent_index :vulnerabilities, :author_id - add_concurrent_foreign_key :vulnerabilities, :users, column: :author_id, on_delete: :nullify - - add_concurrent_index :vulnerabilities, :updated_by_id - add_concurrent_foreign_key :vulnerabilities, :users, column: :updated_by_id, on_delete: :nullify - - add_concurrent_index :vulnerabilities, :last_edited_by_id - add_concurrent_foreign_key :vulnerabilities, :users, column: :last_edited_by_id, on_delete: :nullify - - add_concurrent_index :vulnerabilities, :closed_by_id - add_concurrent_foreign_key :vulnerabilities, :users, column: :closed_by_id, on_delete: :nullify - - add_concurrent_index :vulnerabilities, :start_date_sourcing_milestone_id - add_concurrent_foreign_key :vulnerabilities, :milestones, column: :start_date_sourcing_milestone_id, on_delete: :nullify - - add_concurrent_index :vulnerabilities, :due_date_sourcing_milestone_id - add_concurrent_foreign_key :vulnerabilities, :milestones, column: :due_date_sourcing_milestone_id, on_delete: :nullify - - add_concurrent_index :vulnerability_occurrences, :vulnerability_id - add_concurrent_foreign_key :vulnerability_occurrences, :vulnerabilities, column: :vulnerability_id, on_delete: :nullify - end - - def down - remove_foreign_key :vulnerability_occurrences, :vulnerabilities - remove_concurrent_index :vulnerability_occurrences, :vulnerability_id - - remove_foreign_key :vulnerabilities, column: :due_date_sourcing_milestone_id - remove_concurrent_index :vulnerabilities, :due_date_sourcing_milestone_id - - remove_foreign_key :vulnerabilities, column: :start_date_sourcing_milestone_id - remove_concurrent_index :vulnerabilities, :start_date_sourcing_milestone_id - - remove_foreign_key :vulnerabilities, column: :closed_by_id - remove_concurrent_index :vulnerabilities, :closed_by_id - - remove_foreign_key :vulnerabilities, column: :last_edited_by_id - remove_concurrent_index :vulnerabilities, :last_edited_by_id - - remove_foreign_key :vulnerabilities, column: :updated_by_id - remove_concurrent_index :vulnerabilities, :updated_by_id - - remove_foreign_key :vulnerabilities, column: :author_id - remove_concurrent_index :vulnerabilities, :author_id - - remove_foreign_key :vulnerabilities, :projects - remove_concurrent_index :vulnerabilities, :project_id - - remove_foreign_key :vulnerabilities, :epics - remove_concurrent_index :vulnerabilities, :epic_id - - remove_foreign_key :vulnerabilities, :milestones - remove_concurrent_index :vulnerabilities, :milestone_id - end -end diff --git a/db/migrate/20190930025655_add_incident_management_throttle_columns_to_application_setting.rb b/db/migrate/20190930025655_add_incident_management_throttle_columns_to_application_setting.rb deleted file mode 100644 index 577c705fbef..00000000000 --- a/db/migrate/20190930025655_add_incident_management_throttle_columns_to_application_setting.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class AddIncidentManagementThrottleColumnsToApplicationSetting < ActiveRecord::Migration[5.2] - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def up - add_column(:application_settings, - :throttle_incident_management_notification_enabled, - :boolean, - null: false, - default: false) - - add_column(:application_settings, - :throttle_incident_management_notification_period_in_seconds, - :integer, - default: 3_600) - - add_column(:application_settings, - :throttle_incident_management_notification_per_period, - :integer, - default: 3_600) - end - - def down - remove_column :application_settings, :throttle_incident_management_notification_enabled - remove_column :application_settings, :throttle_incident_management_notification_period_in_seconds - remove_column :application_settings, :throttle_incident_management_notification_per_period - end -end diff --git a/db/migrate/20190930063627_add_management_project_id_to_clusters.rb b/db/migrate/20190930063627_add_management_project_id_to_clusters.rb deleted file mode 100644 index 46c3fef8e76..00000000000 --- a/db/migrate/20190930063627_add_management_project_id_to_clusters.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddManagementProjectIdToClusters < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :clusters, :management_project_id, :integer - end -end diff --git a/db/migrate/20190930082942_add_new_release_to_notification_settings.rb b/db/migrate/20190930082942_add_new_release_to_notification_settings.rb deleted file mode 100644 index 2ec5815f542..00000000000 --- a/db/migrate/20190930082942_add_new_release_to_notification_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddNewReleaseToNotificationSettings < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :notification_settings, :new_release, :boolean - end -end diff --git a/db/migrate/20190930153535_create_zoom_meetings.rb b/db/migrate/20190930153535_create_zoom_meetings.rb deleted file mode 100644 index 8bc9f0e89de..00000000000 --- a/db/migrate/20190930153535_create_zoom_meetings.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class CreateZoomMeetings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - ZOOM_MEETING_STATUS_ADDED = 1 - - def change - create_table :zoom_meetings do |t| - t.references :project, foreign_key: { on_delete: :cascade }, - null: false - t.references :issue, foreign_key: { on_delete: :cascade }, - null: false - t.timestamps_with_timezone null: false - t.integer :issue_status, limit: 2, default: 1, null: false - t.string :url, limit: 255 # rubocop:disable Migration/PreventStrings - - t.index [:issue_id, :issue_status], unique: true, - where: "issue_status = #{ZOOM_MEETING_STATUS_ADDED}" - end - end -end diff --git a/db/migrate/20191001040549_add_management_project_id_index_fk_to_clusters.rb b/db/migrate/20191001040549_add_management_project_id_index_fk_to_clusters.rb deleted file mode 100644 index 97253dd1f2d..00000000000 --- a/db/migrate/20191001040549_add_management_project_id_index_fk_to_clusters.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddManagementProjectIdIndexFkToClusters < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :clusters, :projects, column: :management_project_id, on_delete: :nullify - add_concurrent_index :clusters, :management_project_id, where: 'management_project_id IS NOT NULL' - end - - def down - remove_concurrent_index :clusters, :management_project_id - remove_foreign_key_if_exists :clusters, column: :management_project_id - end -end diff --git a/db/migrate/20191001170300_create_ci_ref.rb b/db/migrate/20191001170300_create_ci_ref.rb deleted file mode 100644 index feeb8517e6e..00000000000 --- a/db/migrate/20191001170300_create_ci_ref.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class CreateCiRef < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :ci_refs do |t| - t.references :project, null: false, index: false, foreign_key: { on_delete: :cascade }, type: :integer - t.integer :lock_version, default: 0 - t.integer :last_updated_by_pipeline_id - t.boolean :tag, default: false, null: false - t.string :ref, null: false, limit: 255 - t.string :status, null: false, limit: 255 - t.foreign_key :ci_pipelines, column: :last_updated_by_pipeline_id, on_delete: :nullify - t.index [:project_id, :ref, :tag], unique: true - t.index [:last_updated_by_pipeline_id] - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191002123516_create_clusters_applications_elastic_stack.rb b/db/migrate/20191002123516_create_clusters_applications_elastic_stack.rb deleted file mode 100644 index e1236423672..00000000000 --- a/db/migrate/20191002123516_create_clusters_applications_elastic_stack.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class CreateClustersApplicationsElasticStack < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :clusters_applications_elastic_stacks do |t| - t.timestamps_with_timezone null: false - t.references :cluster, null: false, index: false, foreign_key: { on_delete: :cascade } - t.integer :status, null: false - t.string :version, null: false, limit: 255 - t.string :kibana_hostname, limit: 255 - t.text :status_reason # rubocop:disable Migration/AddLimitToTextColumns - t.index :cluster_id, unique: true - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191003015155_add_self_managed_prometheus_alerts.rb b/db/migrate/20191003015155_add_self_managed_prometheus_alerts.rb deleted file mode 100644 index eec6f518257..00000000000 --- a/db/migrate/20191003015155_add_self_managed_prometheus_alerts.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class AddSelfManagedPrometheusAlerts < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :self_managed_prometheus_alert_events do |t| - t.references :project, index: false, foreign_key: { on_delete: :cascade }, null: false - t.references :environment, index: true, foreign_key: { on_delete: :cascade } - t.datetime_with_timezone :started_at, null: false - t.datetime_with_timezone :ended_at - - t.integer :status, null: false, limit: 2 - t.string :title, null: false, limit: 255 - t.string :query_expression, limit: 255 - t.string :payload_key, null: false, limit: 255 - t.index [:project_id, :payload_key], unique: true, name: 'idx_project_id_payload_key_self_managed_prometheus_alert_events' - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191003060227_add_push_event_hooks_limit_to_application_settings.rb b/db/migrate/20191003060227_add_push_event_hooks_limit_to_application_settings.rb deleted file mode 100644 index 4b381dca81b..00000000000 --- a/db/migrate/20191003060227_add_push_event_hooks_limit_to_application_settings.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddPushEventHooksLimitToApplicationSettings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default(:application_settings, :push_event_hooks_limit, :integer, default: 3) # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column(:application_settings, :push_event_hooks_limit) - end -end diff --git a/db/migrate/20191003064615_create_aws_roles.rb b/db/migrate/20191003064615_create_aws_roles.rb deleted file mode 100644 index 960e9b28053..00000000000 --- a/db/migrate/20191003064615_create_aws_roles.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class CreateAwsRoles < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :aws_roles, id: false do |t| - t.references :user, primary_key: true, default: nil, type: :integer, index: { unique: true }, foreign_key: { on_delete: :cascade } - - t.timestamps_with_timezone null: false - - t.string :role_arn, null: false, limit: 2048 - t.string :role_external_id, null: false, limit: 64 - - t.index :role_external_id, unique: true - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191003130045_create_issue_user_mentions.rb b/db/migrate/20191003130045_create_issue_user_mentions.rb deleted file mode 100644 index e465a307f44..00000000000 --- a/db/migrate/20191003130045_create_issue_user_mentions.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CreateIssueUserMentions < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :issue_user_mentions do |t| - t.references :issue, type: :integer, index: false, null: false, foreign_key: { on_delete: :cascade } - t.references :note, type: :integer, - index: { where: 'note_id IS NOT NULL', unique: true }, null: true, foreign_key: { on_delete: :cascade } - t.integer :mentioned_users_ids, array: true - t.integer :mentioned_projects_ids, array: true - t.integer :mentioned_groups_ids, array: true - end - - add_index :issue_user_mentions, [:issue_id], where: 'note_id is null', unique: true, name: 'issue_user_mentions_on_issue_id_index' - add_index :issue_user_mentions, [:issue_id, :note_id], unique: true, name: 'issue_user_mentions_on_issue_id_and_note_id_index' - end -end diff --git a/db/migrate/20191003150045_create_merge_request_user_mentions.rb b/db/migrate/20191003150045_create_merge_request_user_mentions.rb deleted file mode 100644 index 0ec45020127..00000000000 --- a/db/migrate/20191003150045_create_merge_request_user_mentions.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CreateMergeRequestUserMentions < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :merge_request_user_mentions do |t| - t.references :merge_request, type: :integer, index: false, null: false, foreign_key: { on_delete: :cascade } - t.references :note, type: :integer, - index: { where: 'note_id IS NOT NULL', unique: true }, null: true, foreign_key: { on_delete: :cascade } - t.integer :mentioned_users_ids, array: true - t.integer :mentioned_projects_ids, array: true - t.integer :mentioned_groups_ids, array: true - end - - add_index :merge_request_user_mentions, [:merge_request_id], where: 'note_id is null', unique: true, name: 'merge_request_user_mentions_on_mr_id_index' - add_index :merge_request_user_mentions, [:merge_request_id, :note_id], unique: true, name: 'merge_request_user_mentions_on_mr_id_and_note_id_index' - end -end diff --git a/db/migrate/20191003161031_add_mark_for_deletion_to_projects.rb b/db/migrate/20191003161031_add_mark_for_deletion_to_projects.rb deleted file mode 100644 index 12f17c849aa..00000000000 --- a/db/migrate/20191003161031_add_mark_for_deletion_to_projects.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddMarkForDeletionToProjects < ActiveRecord::Migration[5.2] - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # rubocop:disable Migration/AddColumnsToWideTables - def change - add_column :projects, :marked_for_deletion_at, :date - add_column :projects, :marked_for_deletion_by_user_id, :integer - end - # rubocop:enable Migration/AddColumnsToWideTables -end diff --git a/db/migrate/20191003161032_add_mark_for_deletion_indexes_to_projects.rb b/db/migrate/20191003161032_add_mark_for_deletion_indexes_to_projects.rb deleted file mode 100644 index d6ef6509fff..00000000000 --- a/db/migrate/20191003161032_add_mark_for_deletion_indexes_to_projects.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddMarkForDeletionIndexesToProjects < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :projects, :users, column: :marked_for_deletion_by_user_id, on_delete: :nullify - add_concurrent_index :projects, :marked_for_deletion_by_user_id, where: 'marked_for_deletion_by_user_id IS NOT NULL' - end - - def down - remove_foreign_key_if_exists :projects, column: :marked_for_deletion_by_user_id - remove_concurrent_index :projects, :marked_for_deletion_by_user_id - end -end diff --git a/db/migrate/20191003195218_add_pendo_enabled_to_application_settings.rb b/db/migrate/20191003195218_add_pendo_enabled_to_application_settings.rb deleted file mode 100644 index 2d937327ca1..00000000000 --- a/db/migrate/20191003195218_add_pendo_enabled_to_application_settings.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddPendoEnabledToApplicationSettings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :application_settings, :pendo_enabled, :boolean, default: false, allow_null: false # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :application_settings, :pendo_enabled - end -end diff --git a/db/migrate/20191003195620_add_pendo_url_to_application_settings.rb b/db/migrate/20191003195620_add_pendo_url_to_application_settings.rb deleted file mode 100644 index cbeb1ef5186..00000000000 --- a/db/migrate/20191003195620_add_pendo_url_to_application_settings.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddPendoUrlToApplicationSettings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :application_settings, :pendo_url, :string, limit: 255 - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191003200045_create_epic_user_mentions.rb b/db/migrate/20191003200045_create_epic_user_mentions.rb deleted file mode 100644 index 25f9b24f9cc..00000000000 --- a/db/migrate/20191003200045_create_epic_user_mentions.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CreateEpicUserMentions < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :epic_user_mentions do |t| - t.references :epic, type: :integer, index: false, null: false, foreign_key: { on_delete: :cascade } - t.references :note, type: :integer, - index: { where: 'note_id IS NOT NULL', unique: true }, null: true, foreign_key: { on_delete: :cascade } - t.integer :mentioned_users_ids, array: true - t.integer :mentioned_projects_ids, array: true - t.integer :mentioned_groups_ids, array: true - end - - add_index :epic_user_mentions, [:epic_id], where: 'note_id is null', unique: true, name: 'epic_user_mentions_on_epic_id_index' - add_index :epic_user_mentions, [:epic_id, :note_id], unique: true, name: 'epic_user_mentions_on_epic_id_and_note_id_index' - end -end diff --git a/db/migrate/20191003250045_create_commit_user_mentions.rb b/db/migrate/20191003250045_create_commit_user_mentions.rb deleted file mode 100644 index 135c115c725..00000000000 --- a/db/migrate/20191003250045_create_commit_user_mentions.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreateCommitUserMentions < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :commit_user_mentions do |t| - t.references :note, type: :integer, - index: { unique: true }, null: false, foreign_key: { on_delete: :cascade } - t.binary :commit_id, null: false - t.integer :mentioned_users_ids, array: true - t.integer :mentioned_projects_ids, array: true - t.integer :mentioned_groups_ids, array: true - end - - add_index :commit_user_mentions, [:commit_id, :note_id], name: 'commit_user_mentions_on_commit_id_and_note_id_index' - end -end diff --git a/db/migrate/20191003300045_create_snippet_user_mentions.rb b/db/migrate/20191003300045_create_snippet_user_mentions.rb deleted file mode 100644 index fb7681d6e33..00000000000 --- a/db/migrate/20191003300045_create_snippet_user_mentions.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CreateSnippetUserMentions < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :snippet_user_mentions do |t| - t.references :snippet, type: :integer, index: false, null: false, foreign_key: { on_delete: :cascade } - t.references :note, type: :integer, - index: { where: 'note_id IS NOT NULL', unique: true }, null: true, foreign_key: { on_delete: :cascade } - t.integer :mentioned_users_ids, array: true - t.integer :mentioned_projects_ids, array: true - t.integer :mentioned_groups_ids, array: true - end - - add_index :snippet_user_mentions, [:snippet_id], where: 'note_id is null', unique: true, name: 'snippet_user_mentions_on_snippet_id_index' - add_index :snippet_user_mentions, [:snippet_id, :note_id], unique: true, name: 'snippet_user_mentions_on_snippet_id_and_note_id_index' - end -end diff --git a/db/migrate/20191003350045_create_design_user_mentions.rb b/db/migrate/20191003350045_create_design_user_mentions.rb deleted file mode 100644 index 149ee5bd124..00000000000 --- a/db/migrate/20191003350045_create_design_user_mentions.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CreateDesignUserMentions < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :design_user_mentions do |t| - t.references :design, type: :integer, index: false, null: false, - foreign_key: { to_table: :design_management_designs, column: :design_id, on_delete: :cascade } - t.references :note, type: :integer, - index: { unique: true }, null: false, foreign_key: { on_delete: :cascade } - t.integer :mentioned_users_ids, array: true - t.integer :mentioned_projects_ids, array: true - t.integer :mentioned_groups_ids, array: true - end - - add_index :design_user_mentions, [:design_id, :note_id], name: 'design_user_mentions_on_design_id_and_note_id_index' - end -end diff --git a/db/migrate/20191004080818_add_productivity_analytics_start_date.rb b/db/migrate/20191004080818_add_productivity_analytics_start_date.rb deleted file mode 100644 index 287b0755bc1..00000000000 --- a/db/migrate/20191004080818_add_productivity_analytics_start_date.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddProductivityAnalyticsStartDate < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :application_settings, :productivity_analytics_start_date, :datetime_with_timezone - end -end diff --git a/db/migrate/20191004081520_fill_productivity_analytics_start_date.rb b/db/migrate/20191004081520_fill_productivity_analytics_start_date.rb deleted file mode 100644 index 9432cd68708..00000000000 --- a/db/migrate/20191004081520_fill_productivity_analytics_start_date.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -# Expected migration duration: 1 minute -class FillProductivityAnalyticsStartDate < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :merge_request_metrics, :merged_at, - where: "merged_at > '2019-09-01' AND commits_count IS NOT NULL", - name: 'fill_productivity_analytics_start_date_tmp_index' - - execute( - <<SQL - UPDATE application_settings - SET productivity_analytics_start_date = COALESCE((SELECT MIN(merged_at) FROM merge_request_metrics - WHERE merged_at > '2019-09-01' AND commits_count IS NOT NULL), NOW()) -SQL - ) - - remove_concurrent_index :merge_request_metrics, :merged_at, - name: 'fill_productivity_analytics_start_date_tmp_index' - end - - def down - execute('UPDATE application_settings SET productivity_analytics_start_date = NULL') - end -end diff --git a/db/migrate/20191004133612_create_analytics_repository_file_commits.rb b/db/migrate/20191004133612_create_analytics_repository_file_commits.rb deleted file mode 100644 index f2064b2b301..00000000000 --- a/db/migrate/20191004133612_create_analytics_repository_file_commits.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CreateAnalyticsRepositoryFileCommits < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :analytics_repository_file_commits do |t| - t.references :analytics_repository_file, index: { name: 'index_analytics_repository_file_commits_file_id' }, foreign_key: { on_delete: :cascade }, null: false - t.references :project, index: false, foreign_key: { on_delete: :cascade }, null: false - t.date :committed_date, null: false - t.integer :commit_count, limit: 2, null: false - end - - add_index :analytics_repository_file_commits, - [:project_id, :committed_date, :analytics_repository_file_id], - name: 'index_file_commits_on_committed_date_file_id_and_project_id', - unique: true - end -end diff --git a/db/migrate/20191004151428_add_auto_stop_in_to_environments.rb b/db/migrate/20191004151428_add_auto_stop_in_to_environments.rb deleted file mode 100644 index 860e52d420c..00000000000 --- a/db/migrate/20191004151428_add_auto_stop_in_to_environments.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddAutoStopInToEnvironments < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :environments, :auto_stop_at, :datetime_with_timezone - end -end diff --git a/db/migrate/20191008013056_add_push_event_activities_limit_to_application_settings.rb b/db/migrate/20191008013056_add_push_event_activities_limit_to_application_settings.rb deleted file mode 100644 index af206bcb8d0..00000000000 --- a/db/migrate/20191008013056_add_push_event_activities_limit_to_application_settings.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddPushEventActivitiesLimitToApplicationSettings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default(:application_settings, :push_event_activities_limit, :integer, default: 3) # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column(:application_settings, :push_event_activities_limit) - end -end diff --git a/db/migrate/20191008142331_add_ref_count_to_push_event_payloads.rb b/db/migrate/20191008142331_add_ref_count_to_push_event_payloads.rb deleted file mode 100644 index 72621971dbb..00000000000 --- a/db/migrate/20191008142331_add_ref_count_to_push_event_payloads.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddRefCountToPushEventPayloads < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :push_event_payloads, :ref_count, :integer - end -end diff --git a/db/migrate/20191008180203_add_issuable_state_id_indexes.rb b/db/migrate/20191008180203_add_issuable_state_id_indexes.rb deleted file mode 100644 index a9a8b8b6359..00000000000 --- a/db/migrate/20191008180203_add_issuable_state_id_indexes.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true - -class AddIssuableStateIdIndexes < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - # Creates the same indexes that are currently using state:string column - # for issues and merge_requests tables - create_indexes_for_issues - create_indexes_for_merge_requests - end - - def down - # Removes indexes for issues - remove_concurrent_index_by_name :issues, 'idx_issues_on_state_id' - remove_concurrent_index_by_name :issues, 'idx_issues_on_project_id_and_created_at_and_id_and_state_id' - remove_concurrent_index_by_name :issues, 'idx_issues_on_project_id_and_due_date_and_id_and_state_id' - remove_concurrent_index_by_name :issues, 'idx_issues_on_project_id_and_rel_position_and_state_id_and_id' - remove_concurrent_index_by_name :issues, 'idx_issues_on_project_id_and_updated_at_and_id_and_state_id' - - # Removes indexes from merge_requests - remove_concurrent_index_by_name :merge_requests, 'idx_merge_requests_on_id_and_merge_jid' - remove_concurrent_index_by_name :merge_requests, 'idx_merge_requests_on_source_project_and_branch_state_opened' - remove_concurrent_index_by_name :merge_requests, 'idx_merge_requests_on_state_id_and_merge_status' - remove_concurrent_index_by_name :merge_requests, 'idx_merge_requests_on_target_project_id_and_iid_opened' - end - - def create_indexes_for_issues - add_concurrent_index :issues, :state_id, name: 'idx_issues_on_state_id' - - add_concurrent_index :issues, - [:project_id, :created_at, :id, :state_id], - name: 'idx_issues_on_project_id_and_created_at_and_id_and_state_id' - - add_concurrent_index :issues, - [:project_id, :due_date, :id, :state_id], - where: 'due_date IS NOT NULL', - name: 'idx_issues_on_project_id_and_due_date_and_id_and_state_id' - - add_concurrent_index :issues, - [:project_id, :relative_position, :state_id, :id], - order: { id: :desc }, - name: 'idx_issues_on_project_id_and_rel_position_and_state_id_and_id' - - add_concurrent_index :issues, - [:project_id, :updated_at, :id, :state_id], - name: 'idx_issues_on_project_id_and_updated_at_and_id_and_state_id' - end - - def create_indexes_for_merge_requests - add_concurrent_index :merge_requests, - [:id, :merge_jid], - where: 'merge_jid IS NOT NULL and state_id = 4', - name: 'idx_merge_requests_on_id_and_merge_jid' - - add_concurrent_index :merge_requests, - [:source_project_id, :source_branch], - where: 'state_id = 1', - name: 'idx_merge_requests_on_source_project_and_branch_state_opened' - - add_concurrent_index :merge_requests, - [:state_id, :merge_status], - where: "state_id = 1 AND merge_status = 'can_be_merged'", - name: 'idx_merge_requests_on_state_id_and_merge_status' - - add_concurrent_index :merge_requests, - [:target_project_id, :iid], - where: 'state_id = 1', - name: 'idx_merge_requests_on_target_project_id_and_iid_opened' - end -end diff --git a/db/migrate/20191008200204_add_state_id_default_value.rb b/db/migrate/20191008200204_add_state_id_default_value.rb deleted file mode 100644 index 15a80163ca8..00000000000 --- a/db/migrate/20191008200204_add_state_id_default_value.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddStateIdDefaultValue < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - change_column_default :issues, :state_id, 1 - change_column_null :issues, :state_id, false - change_column_default :merge_requests, :state_id, 1 - change_column_null :merge_requests, :state_id, false - end - - def down - change_column_default :issues, :state_id, nil - change_column_null :issues, :state_id, true - change_column_default :merge_requests, :state_id, nil - change_column_null :merge_requests, :state_id, true - end -end diff --git a/db/migrate/20191009100244_add_geo_design_repository_counters.rb b/db/migrate/20191009100244_add_geo_design_repository_counters.rb deleted file mode 100644 index 26387453f88..00000000000 --- a/db/migrate/20191009100244_add_geo_design_repository_counters.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddGeoDesignRepositoryCounters < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - change_table :geo_node_statuses do |t| - t.column :design_repositories_count, :integer - t.column :design_repositories_synced_count, :integer - t.column :design_repositories_failed_count, :integer - t.column :design_repositories_registry_count, :integer - end - end -end diff --git a/db/migrate/20191009110124_add_has_exposed_artifacts_to_ci_builds_metadata.rb b/db/migrate/20191009110124_add_has_exposed_artifacts_to_ci_builds_metadata.rb deleted file mode 100644 index 86c3c540e5e..00000000000 --- a/db/migrate/20191009110124_add_has_exposed_artifacts_to_ci_builds_metadata.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddHasExposedArtifactsToCiBuildsMetadata < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - add_column :ci_builds_metadata, :has_exposed_artifacts, :boolean - end - - def down - remove_column :ci_builds_metadata, :has_exposed_artifacts - end -end diff --git a/db/migrate/20191009110757_add_index_to_ci_builds_metadata_has_exposed_artifacts.rb b/db/migrate/20191009110757_add_index_to_ci_builds_metadata_has_exposed_artifacts.rb deleted file mode 100644 index 6b8c452a62a..00000000000 --- a/db/migrate/20191009110757_add_index_to_ci_builds_metadata_has_exposed_artifacts.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToCiBuildsMetadataHasExposedArtifacts < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_builds_metadata, [:build_id], where: "has_exposed_artifacts IS TRUE", name: 'index_ci_builds_metadata_on_build_id_and_has_exposed_artifacts' - end - - def down - remove_concurrent_index_by_name :ci_builds_metadata, 'index_ci_builds_metadata_on_build_id_and_has_exposed_artifacts' - end -end diff --git a/db/migrate/20191009222222_add_custom_http_clone_url_root_to_application_settings.rb b/db/migrate/20191009222222_add_custom_http_clone_url_root_to_application_settings.rb deleted file mode 100644 index 41876ee2cdf..00000000000 --- a/db/migrate/20191009222222_add_custom_http_clone_url_root_to_application_settings.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddCustomHttpCloneUrlRootToApplicationSettings < ActiveRecord::Migration[5.2] - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :application_settings, :custom_http_clone_url_root, :string, limit: 511 - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191010174846_add_snowplow_iglu_registry_url_to_application_settings.rb b/db/migrate/20191010174846_add_snowplow_iglu_registry_url_to_application_settings.rb deleted file mode 100644 index 8f882bcaa50..00000000000 --- a/db/migrate/20191010174846_add_snowplow_iglu_registry_url_to_application_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddSnowplowIgluRegistryUrlToApplicationSettings < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :application_settings, :snowplow_iglu_registry_url, :string, limit: 255 - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191011084019_add_project_deletion_adjourned_period_to_application_settings.rb b/db/migrate/20191011084019_add_project_deletion_adjourned_period_to_application_settings.rb deleted file mode 100644 index 79546e33253..00000000000 --- a/db/migrate/20191011084019_add_project_deletion_adjourned_period_to_application_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddProjectDeletionAdjournedPeriodToApplicationSettings < ActiveRecord::Migration[5.2] - DOWNTIME = false - - DEFAULT_NUMBER_OF_DAYS_BEFORE_REMOVAL = 7 - - def change - add_column :application_settings, :deletion_adjourned_period, :integer, default: DEFAULT_NUMBER_OF_DAYS_BEFORE_REMOVAL, null: false - end -end diff --git a/db/migrate/20191013100213_add_squash_commit_sha_to_merge_requests.rb b/db/migrate/20191013100213_add_squash_commit_sha_to_merge_requests.rb deleted file mode 100644 index 0a58f0a89aa..00000000000 --- a/db/migrate/20191013100213_add_squash_commit_sha_to_merge_requests.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddSquashCommitShaToMergeRequests < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :merge_requests, :squash_commit_sha, :binary - end -end diff --git a/db/migrate/20191014025629_rename_design_management_version_user_to_author.rb b/db/migrate/20191014025629_rename_design_management_version_user_to_author.rb deleted file mode 100644 index 2359cc2e826..00000000000 --- a/db/migrate/20191014025629_rename_design_management_version_user_to_author.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RenameDesignManagementVersionUserToAuthor < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - rename_column_concurrently :design_management_versions, :user_id, :author_id - end - - def down - undo_rename_column_concurrently :design_management_versions, :user_id, :author_id - end -end diff --git a/db/migrate/20191014030730_add_author_index_to_design_management_versions.rb b/db/migrate/20191014030730_add_author_index_to_design_management_versions.rb deleted file mode 100644 index 30e076f1fe6..00000000000 --- a/db/migrate/20191014030730_add_author_index_to_design_management_versions.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddAuthorIndexToDesignManagementVersions < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :design_management_versions, :author_id, where: 'author_id IS NOT NULL' - end - - def down - remove_concurrent_index :design_management_versions, :author_id - end -end diff --git a/db/migrate/20191014084150_add_index_on_snippets_project_id_and_visibility_level.rb b/db/migrate/20191014084150_add_index_on_snippets_project_id_and_visibility_level.rb deleted file mode 100644 index a8f40953e5d..00000000000 --- a/db/migrate/20191014084150_add_index_on_snippets_project_id_and_visibility_level.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnSnippetsProjectIdAndVisibilityLevel < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :snippets, [:project_id, :visibility_level] - end - - def down - remove_concurrent_index :snippets, [:project_id, :visibility_level] - end -end diff --git a/db/migrate/20191014123159_add_expire_notification_delivered_to_personal_access_tokens.rb b/db/migrate/20191014123159_add_expire_notification_delivered_to_personal_access_tokens.rb deleted file mode 100644 index 41a81e3ac87..00000000000 --- a/db/migrate/20191014123159_add_expire_notification_delivered_to_personal_access_tokens.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddExpireNotificationDeliveredToPersonalAccessTokens < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :personal_access_tokens, :expire_notification_delivered, :boolean, default: false # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :personal_access_tokens, :expire_notification_delivered - end -end diff --git a/db/migrate/20191014132931_remove_index_on_snippets_project_id.rb b/db/migrate/20191014132931_remove_index_on_snippets_project_id.rb deleted file mode 100644 index 850112b4f0b..00000000000 --- a/db/migrate/20191014132931_remove_index_on_snippets_project_id.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class RemoveIndexOnSnippetsProjectId < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name :snippets, 'index_snippets_on_project_id' - - # This is an extra index that is not present in db/schema.rb but known to exist on some installs - remove_concurrent_index_by_name :snippets, :snippets_project_id_idx if index_exists_by_name? :snippets, :snippets_project_id_idx - end - - def down - add_concurrent_index :snippets, [:project_id], name: 'index_snippets_on_project_id' - end -end diff --git a/db/migrate/20191016072826_replace_ci_trigger_requests_index.rb b/db/migrate/20191016072826_replace_ci_trigger_requests_index.rb deleted file mode 100644 index 8faa6c3847f..00000000000 --- a/db/migrate/20191016072826_replace_ci_trigger_requests_index.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class ReplaceCiTriggerRequestsIndex < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_trigger_requests, [:trigger_id, :id], order: { id: :desc } - - # Some installations have legacy, duplicate indexes on - # ci_trigger_requests.trigger_id. Rails won't drop them without an - # explicit name: https://gitlab.com/gitlab-org/gitlab/issues/34818 - old_index_names.each do |name| - remove_concurrent_index :ci_trigger_requests, [:trigger_id], name: name - end - end - - def down - add_concurrent_index :ci_trigger_requests, [:trigger_id] - - remove_concurrent_index :ci_trigger_requests, [:trigger_id, :id], order: { id: :desc } - end - - private - - def old_index_names - indexes(:ci_trigger_requests).select { |i| i.columns == ['trigger_id'] }.map(&:name) - end -end diff --git a/db/migrate/20191016133352_create_ci_subscriptions_projects.rb b/db/migrate/20191016133352_create_ci_subscriptions_projects.rb deleted file mode 100644 index 00ab2c19193..00000000000 --- a/db/migrate/20191016133352_create_ci_subscriptions_projects.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class CreateCiSubscriptionsProjects < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def change - create_table :ci_subscriptions_projects do |t| - t.references :downstream_project, null: false, index: false, foreign_key: { to_table: :projects, on_delete: :cascade } - t.references :upstream_project, null: false, foreign_key: { to_table: :projects, on_delete: :cascade } - end - - add_index :ci_subscriptions_projects, [:downstream_project_id, :upstream_project_id], - unique: true, name: 'index_ci_subscriptions_projects_unique_subscription' - end -end diff --git a/db/migrate/20191016220135_add_join_table_for_self_managed_prometheus_alert_issues.rb b/db/migrate/20191016220135_add_join_table_for_self_managed_prometheus_alert_issues.rb deleted file mode 100644 index 68b448f8836..00000000000 --- a/db/migrate/20191016220135_add_join_table_for_self_managed_prometheus_alert_issues.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class AddJoinTableForSelfManagedPrometheusAlertIssues < ActiveRecord::Migration[5.2] - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def change - # Join table to Issues - create_table :issues_self_managed_prometheus_alert_events, id: false do |t| - t.references :issue, null: false, - index: false, # Uses the index below - foreign_key: { on_delete: :cascade } - t.references :self_managed_prometheus_alert_event, null: false, - index: { name: 'issue_id_issues_self_managed_rometheus_alert_events_index' }, - foreign_key: { on_delete: :cascade } - - t.timestamps_with_timezone - t.index [:issue_id, :self_managed_prometheus_alert_event_id], - unique: true, name: 'issue_id_self_managed_prometheus_alert_event_id_index' - end - end -end diff --git a/db/migrate/20191017001326_create_users_security_dashboard_projects.rb b/db/migrate/20191017001326_create_users_security_dashboard_projects.rb deleted file mode 100644 index 398401dbee6..00000000000 --- a/db/migrate/20191017001326_create_users_security_dashboard_projects.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class CreateUsersSecurityDashboardProjects < ActiveRecord::Migration[5.2] - DOWNTIME = false - INDEX_NAME = 'users_security_dashboard_projects_unique_index' - - def change - create_table :users_security_dashboard_projects, id: false do |t| - t.references :user, null: false, foreign_key: { on_delete: :cascade } - t.references :project, null: false, index: false, foreign_key: { on_delete: :cascade } - end - - add_index :users_security_dashboard_projects, [:project_id, :user_id], name: INDEX_NAME, unique: true - end -end diff --git a/db/migrate/20191017094449_add_remove_source_branch_after_merge_to_projects.rb b/db/migrate/20191017094449_add_remove_source_branch_after_merge_to_projects.rb deleted file mode 100644 index d4f84b066a3..00000000000 --- a/db/migrate/20191017094449_add_remove_source_branch_after_merge_to_projects.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddRemoveSourceBranchAfterMergeToProjects < ActiveRecord::Migration[5.1] - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def up - add_column :projects, :remove_source_branch_after_merge, :boolean # rubocop:disable Migration/AddColumnsToWideTables - end - - def down - remove_column :projects, :remove_source_branch_after_merge - end -end diff --git a/db/migrate/20191017134513_add_deployment_merge_requests.rb b/db/migrate/20191017134513_add_deployment_merge_requests.rb deleted file mode 100644 index dbe09463d22..00000000000 --- a/db/migrate/20191017134513_add_deployment_merge_requests.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -class AddDeploymentMergeRequests < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - create_table :deployment_merge_requests, id: false do |t| - t.references( - :deployment, - foreign_key: { on_delete: :cascade }, - type: :integer, - index: false, - null: false - ) - - t.references( - :merge_request, - foreign_key: { on_delete: :cascade }, - type: :integer, - index: true, - null: false - ) - - t.index( - [:deployment_id, :merge_request_id], - unique: true, - name: 'idx_deployment_merge_requests_unique_index' - ) - end - end -end diff --git a/db/migrate/20191017191341_create_clusters_applications_crossplane.rb b/db/migrate/20191017191341_create_clusters_applications_crossplane.rb deleted file mode 100644 index 42f980ed99d..00000000000 --- a/db/migrate/20191017191341_create_clusters_applications_crossplane.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class CreateClustersApplicationsCrossplane < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :clusters_applications_crossplane do |t| - t.timestamps_with_timezone null: false - t.references :cluster, null: false, index: false, foreign_key: { on_delete: :cascade } - t.integer :status, null: false - t.string :version, null: false, limit: 255 - t.string :stack, null: false, limit: 255 - t.text :status_reason # rubocop:disable Migration/AddLimitToTextColumns - t.index :cluster_id, unique: true - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191023093207_add_comment_actions_to_services.rb b/db/migrate/20191023093207_add_comment_actions_to_services.rb deleted file mode 100644 index 46d4bdf9500..00000000000 --- a/db/migrate/20191023093207_add_comment_actions_to_services.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddCommentActionsToServices < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - # rubocop:disable Migration/AddColumnWithDefault - # rubocop:disable Migration/UpdateLargeTable - def up - add_column_with_default(:services, :comment_on_event_enabled, :boolean, default: true) - end - # rubocop:enable Migration/AddColumnWithDefault - # rubocop:enable Migration/UpdateLargeTable - - def down - remove_column(:services, :comment_on_event_enabled) - end -end diff --git a/db/migrate/20191023132005_add_merge_requests_index_on_target_project_and_branch.rb b/db/migrate/20191023132005_add_merge_requests_index_on_target_project_and_branch.rb deleted file mode 100644 index a3de3f34c44..00000000000 --- a/db/migrate/20191023132005_add_merge_requests_index_on_target_project_and_branch.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddMergeRequestsIndexOnTargetProjectAndBranch < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :merge_requests, [:target_project_id, :target_branch], - where: "state_id = 1 AND merge_when_pipeline_succeeds = true" - end - - def down - remove_concurrent_index :merge_requests, [:target_project_id, :target_branch] - end -end diff --git a/db/migrate/20191023152913_add_default_and_free_plans.rb b/db/migrate/20191023152913_add_default_and_free_plans.rb deleted file mode 100644 index 4f5f8000386..00000000000 --- a/db/migrate/20191023152913_add_default_and_free_plans.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class AddDefaultAndFreePlans < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - class Plan < ApplicationRecord - end - - def up - plan_names.each do |plan_name| - Plan.create_with(title: plan_name.titleize).find_or_create_by(name: plan_name) - end - end - - def down - Plan.where(name: plan_names).delete_all - end - - private - - def plan_names - [ - ('free' if Gitlab.com?), - 'default' - ].compact - end -end diff --git a/db/migrate/20191024134020_add_index_to_zoom_meetings.rb b/db/migrate/20191024134020_add_index_to_zoom_meetings.rb deleted file mode 100644 index ef3657b6a5e..00000000000 --- a/db/migrate/20191024134020_add_index_to_zoom_meetings.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToZoomMeetings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :zoom_meetings, :issue_status - end - - def down - remove_concurrent_index :zoom_meetings, :issue_status if index_exists?(:zoom_meetings, :issue_status) - end -end diff --git a/db/migrate/20191025092748_add_secret_token_to_snippet.rb b/db/migrate/20191025092748_add_secret_token_to_snippet.rb deleted file mode 100644 index c43c1fbe2b7..00000000000 --- a/db/migrate/20191025092748_add_secret_token_to_snippet.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class AddSecretTokenToSnippet < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :snippets, :encrypted_secret_token, :string, limit: 255 - add_column :snippets, :encrypted_secret_token_iv, :string, limit: 255 - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191026041447_change_default_value_of_throttle_protected_paths.rb b/db/migrate/20191026041447_change_default_value_of_throttle_protected_paths.rb deleted file mode 100644 index dd79fb217ef..00000000000 --- a/db/migrate/20191026041447_change_default_value_of_throttle_protected_paths.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -class ChangeDefaultValueOfThrottleProtectedPaths < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - change_column_default :application_settings, :throttle_protected_paths_enabled, false - - # Because we already set the value to true in the previous - # migration, this feature was switched on inadvertently in GitLab - # 12.4. This migration toggles it back off to ensure we don't - # inadvertently block legitimate users. The admin will have to - # re-enable it in the application settings. - unless omnibus_protected_paths_present? - execute "UPDATE application_settings SET throttle_protected_paths_enabled = #{false_value}" - end - end - - def down - change_column_default :application_settings, :throttle_protected_paths_enabled, true - - execute "UPDATE application_settings SET throttle_protected_paths_enabled = #{true_value}" - end - - private - - def omnibus_protected_paths_present? - Rack::Attack.throttles.key?('protected paths') - rescue e - say "Error while checking if Omnibus protected paths were already enabled: #{e.message}" - say 'Continuing. Protected paths will remain enabled.' - - # Return true so we don't take a risk - true - end -end diff --git a/db/migrate/20191026120008_add_promoted_to_epic_to_issues.rb b/db/migrate/20191026120008_add_promoted_to_epic_to_issues.rb deleted file mode 100644 index 158dbf69bcc..00000000000 --- a/db/migrate/20191026120008_add_promoted_to_epic_to_issues.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddPromotedToEpicToIssues < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - add_column :issues, :promoted_to_epic_id, :integer - end - - def down - remove_column :issues, :promoted_to_epic_id - end -end diff --git a/db/migrate/20191026120112_add_promoted_to_epic_to_issues_index.rb b/db/migrate/20191026120112_add_promoted_to_epic_to_issues_index.rb deleted file mode 100644 index 649c2f7abe5..00000000000 --- a/db/migrate/20191026120112_add_promoted_to_epic_to_issues_index.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddPromotedToEpicToIssuesIndex < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :issues, :epics, column: :promoted_to_epic_id, on_delete: :nullify - add_concurrent_index :issues, :promoted_to_epic_id, where: 'promoted_to_epic_id IS NOT NULL' - end - - def down - remove_concurrent_index(:issues, :promoted_to_epic_id) - remove_foreign_key :issues, column: :promoted_to_epic_id - end -end diff --git a/db/migrate/20191026124116_set_application_settings_default_project_and_snippet_visibility.rb b/db/migrate/20191026124116_set_application_settings_default_project_and_snippet_visibility.rb deleted file mode 100644 index 9d19279510a..00000000000 --- a/db/migrate/20191026124116_set_application_settings_default_project_and_snippet_visibility.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class SetApplicationSettingsDefaultProjectAndSnippetVisibility < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - change_column_null :application_settings, :default_project_visibility, false, 0 - change_column_default :application_settings, :default_project_visibility, from: nil, to: 0 - - change_column_null :application_settings, :default_snippet_visibility, false, 0 - change_column_default :application_settings, :default_snippet_visibility, from: nil, to: 0 - end -end diff --git a/db/migrate/20191028130054_add_max_issue_weight_to_list.rb b/db/migrate/20191028130054_add_max_issue_weight_to_list.rb deleted file mode 100644 index f15b65067f6..00000000000 --- a/db/migrate/20191028130054_add_max_issue_weight_to_list.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddMaxIssueWeightToList < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - def up - add_column_with_default :lists, :max_issue_weight, :integer, default: 0 # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :lists, :max_issue_weight - end -end diff --git a/db/migrate/20191028162543_add_setup_for_company_to_user_preferences.rb b/db/migrate/20191028162543_add_setup_for_company_to_user_preferences.rb deleted file mode 100644 index 18a8a2306e2..00000000000 --- a/db/migrate/20191028162543_add_setup_for_company_to_user_preferences.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddSetupForCompanyToUserPreferences < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :user_preferences, :setup_for_company, :boolean - end -end diff --git a/db/migrate/20191028184740_rename_snowplow_site_id_to_snowplow_app_id.rb b/db/migrate/20191028184740_rename_snowplow_site_id_to_snowplow_app_id.rb deleted file mode 100644 index 4e3b2da670e..00000000000 --- a/db/migrate/20191028184740_rename_snowplow_site_id_to_snowplow_app_id.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RenameSnowplowSiteIdToSnowplowAppId < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - rename_column_concurrently :application_settings, :snowplow_site_id, :snowplow_app_id - end - - def down - undo_rename_column_concurrently :application_settings, :snowplow_site_id, :snowplow_app_id - end -end diff --git a/db/migrate/20191029125305_create_packages_conan_metadata.rb b/db/migrate/20191029125305_create_packages_conan_metadata.rb deleted file mode 100644 index fa14b73e19b..00000000000 --- a/db/migrate/20191029125305_create_packages_conan_metadata.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreatePackagesConanMetadata < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :packages_conan_metadata do |t| - t.references :package, index: { unique: true }, null: false, foreign_key: { to_table: :packages_packages, on_delete: :cascade }, type: :bigint - t.timestamps_with_timezone - t.string "package_username", null: false, limit: 255 - t.string "package_channel", null: false, limit: 255 - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191029191901_add_enabled_to_grafana_integrations.rb b/db/migrate/20191029191901_add_enabled_to_grafana_integrations.rb deleted file mode 100644 index 40e361e2150..00000000000 --- a/db/migrate/20191029191901_add_enabled_to_grafana_integrations.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class AddEnabledToGrafanaIntegrations < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default( # rubocop:disable Migration/AddColumnWithDefault - :grafana_integrations, - :enabled, - :boolean, - allow_null: false, - default: false - ) - end - - def down - remove_column(:grafana_integrations, :enabled) - end -end diff --git a/db/migrate/20191030135044_create_plan_limits.rb b/db/migrate/20191030135044_create_plan_limits.rb deleted file mode 100644 index 291d9824f6d..00000000000 --- a/db/migrate/20191030135044_create_plan_limits.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class CreatePlanLimits < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :plan_limits, id: false do |t| - t.references :plan, foreign_key: { on_delete: :cascade }, null: false, index: { unique: true } - t.integer :ci_active_pipelines, null: false, default: 0 - t.integer :ci_pipeline_size, null: false, default: 0 - t.integer :ci_active_jobs, null: false, default: 0 - end - end -end diff --git a/db/migrate/20191030152934_move_limits_from_plans.rb b/db/migrate/20191030152934_move_limits_from_plans.rb deleted file mode 100644 index 020a028f648..00000000000 --- a/db/migrate/20191030152934_move_limits_from_plans.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class MoveLimitsFromPlans < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - execute <<~SQL - INSERT INTO plan_limits (plan_id, ci_active_pipelines, ci_pipeline_size, ci_active_jobs) - SELECT id, COALESCE(active_pipelines_limit, 0), COALESCE(pipeline_size_limit, 0), COALESCE(active_jobs_limit, 0) - FROM plans - SQL - end - - def down - execute 'DELETE FROM plan_limits' - end -end diff --git a/db/migrate/20191031095636_create_project_settings.rb b/db/migrate/20191031095636_create_project_settings.rb deleted file mode 100644 index 0263eceb3c1..00000000000 --- a/db/migrate/20191031095636_create_project_settings.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class CreateProjectSettings < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :project_settings, id: false do |t| - t.timestamps_with_timezone null: false - t.references :project, primary_key: true, default: nil, type: :integer, index: false, foreign_key: { on_delete: :cascade } - end - end -end diff --git a/db/migrate/20191101092917_replace_index_on_metrics_merged_at.rb b/db/migrate/20191101092917_replace_index_on_metrics_merged_at.rb deleted file mode 100644 index b2baaee2b76..00000000000 --- a/db/migrate/20191101092917_replace_index_on_metrics_merged_at.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class ReplaceIndexOnMetricsMergedAt < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :merge_request_metrics, :merged_at - remove_concurrent_index :merge_request_metrics, [:merged_at, :id] - end - - def down - add_concurrent_index :merge_request_metrics, [:merged_at, :id] - remove_concurrent_index :merge_request_metrics, :merged_at - end -end diff --git a/db/migrate/20191103202505_add_eks_credentials_to_application_settings.rb b/db/migrate/20191103202505_add_eks_credentials_to_application_settings.rb deleted file mode 100644 index 5ed3e7edb3c..00000000000 --- a/db/migrate/20191103202505_add_eks_credentials_to_application_settings.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddEksCredentialsToApplicationSettings < ActiveRecord::Migration[5.2] - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - # rubocop:disable Migration/AddLimitToTextColumns - def change - add_column :application_settings, :eks_integration_enabled, :boolean, null: false, default: false - add_column :application_settings, :eks_account_id, :string, limit: 128 - add_column :application_settings, :eks_access_key_id, :string, limit: 128 - add_column :application_settings, :encrypted_eks_secret_access_key_iv, :string, limit: 255 - add_column :application_settings, :encrypted_eks_secret_access_key, :text - end - # rubocop:enable Migration/AddLimitToTextColumns - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191104205020_add_license_details_to_application_settings.rb b/db/migrate/20191104205020_add_license_details_to_application_settings.rb deleted file mode 100644 index f951ae6492d..00000000000 --- a/db/migrate/20191104205020_add_license_details_to_application_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddLicenseDetailsToApplicationSettings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :application_settings, :license_trial_ends_on, :date, null: true - end -end diff --git a/db/migrate/20191105094558_add_report_type_to_vulnerabilities.rb b/db/migrate/20191105094558_add_report_type_to_vulnerabilities.rb deleted file mode 100644 index 8fb657bf9e7..00000000000 --- a/db/migrate/20191105094558_add_report_type_to_vulnerabilities.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddReportTypeToVulnerabilities < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :vulnerabilities, :report_type, :integer, limit: 2 - end -end diff --git a/db/migrate/20191105134413_create_service_desk_settings.rb b/db/migrate/20191105134413_create_service_desk_settings.rb deleted file mode 100644 index dc8268f1c90..00000000000 --- a/db/migrate/20191105134413_create_service_desk_settings.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class CreateServiceDeskSettings < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :service_desk_settings, id: false do |t| - t.references :project, - primary_key: true, - default: nil, - null: false, - index: false, - foreign_key: { on_delete: :cascade } - - t.string :issue_template_key, limit: 255 - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191105155113_add_secret_to_snippet.rb b/db/migrate/20191105155113_add_secret_to_snippet.rb deleted file mode 100644 index 8f0a330238b..00000000000 --- a/db/migrate/20191105155113_add_secret_to_snippet.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class AddSecretToSnippet < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - unless column_exists?(:snippets, :secret) - add_column_with_default :snippets, :secret, :boolean, default: false # rubocop:disable Migration/AddColumnWithDefault - end - - add_concurrent_index :snippets, [:visibility_level, :secret] - remove_concurrent_index :snippets, :visibility_level - end - - def down - add_concurrent_index :snippets, :visibility_level - remove_concurrent_index :snippets, [:visibility_level, :secret] - - if column_exists?(:snippets, :secret) - remove_column :snippets, :secret - end - end -end diff --git a/db/migrate/20191105193652_add_index_on_deployments_updated_at.rb b/db/migrate/20191105193652_add_index_on_deployments_updated_at.rb deleted file mode 100644 index 10371c26dcc..00000000000 --- a/db/migrate/20191105193652_add_index_on_deployments_updated_at.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnDeploymentsUpdatedAt < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_COLUMNS = [:project_id, :updated_at] - - disable_ddl_transaction! - - def up - add_concurrent_index(:deployments, INDEX_COLUMNS) - end - - def down - remove_concurrent_index(:deployments, INDEX_COLUMNS) - end -end diff --git a/db/migrate/20191106144901_add_state_to_merge_trains.rb b/db/migrate/20191106144901_add_state_to_merge_trains.rb deleted file mode 100644 index 64a70575c91..00000000000 --- a/db/migrate/20191106144901_add_state_to_merge_trains.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddStateToMergeTrains < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - MERGE_TRAIN_STATUS_CREATED = 0 # Equivalent to MergeTrain.statuses[:created] - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :merge_trains, :status, :integer, limit: 2, default: MERGE_TRAIN_STATUS_CREATED # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :merge_trains, :status - end -end diff --git a/db/migrate/20191106150931_add_timelog_spent_at_index.rb b/db/migrate/20191106150931_add_timelog_spent_at_index.rb deleted file mode 100644 index 2412b77d0bf..00000000000 --- a/db/migrate/20191106150931_add_timelog_spent_at_index.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddTimelogSpentAtIndex < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :timelogs, :spent_at, where: 'spent_at IS NOT NULL' - end - - def down - remove_concurrent_index :timelogs, :spent_at, where: 'spent_at IS NOT NULL' - end -end diff --git a/db/migrate/20191107064946_update_oauth_open_id_requests_foreign_keys.rb b/db/migrate/20191107064946_update_oauth_open_id_requests_foreign_keys.rb deleted file mode 100644 index 439610758a6..00000000000 --- a/db/migrate/20191107064946_update_oauth_open_id_requests_foreign_keys.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class UpdateOauthOpenIdRequestsForeignKeys < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key(:oauth_openid_requests, :oauth_access_grants, column: :access_grant_id, on_delete: :cascade, name: new_foreign_key_name) - remove_foreign_key_if_exists(:oauth_openid_requests, name: existing_foreign_key_name) - end - - def down - add_concurrent_foreign_key(:oauth_openid_requests, :oauth_access_grants, column: :access_grant_id, on_delete: false, name: existing_foreign_key_name) - remove_foreign_key_if_exists(:oauth_openid_requests, name: new_foreign_key_name) - end - - private - - def new_foreign_key_name - concurrent_foreign_key_name(:oauth_openid_requests, :access_grant_id) - end - - def existing_foreign_key_name - 'fk_oauth_openid_requests_oauth_access_grants_access_grant_id' - end -end diff --git a/db/migrate/20191107173446_add_sourcegraph_admin_and_user_preferences.rb b/db/migrate/20191107173446_add_sourcegraph_admin_and_user_preferences.rb deleted file mode 100644 index 731ed82c999..00000000000 --- a/db/migrate/20191107173446_add_sourcegraph_admin_and_user_preferences.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddSourcegraphAdminAndUserPreferences < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - add_column(:application_settings, :sourcegraph_public_only, :boolean, default: true, null: false) - add_column(:user_preferences, :sourcegraph_enabled, :boolean) - end - - def down - remove_column(:application_settings, :sourcegraph_public_only) - remove_column(:user_preferences, :sourcegraph_enabled) - end -end diff --git a/db/migrate/20191107220314_add_index_to_projects_on_marked_for_deletion.rb b/db/migrate/20191107220314_add_index_to_projects_on_marked_for_deletion.rb deleted file mode 100644 index 06849cf9bfd..00000000000 --- a/db/migrate/20191107220314_add_index_to_projects_on_marked_for_deletion.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToProjectsOnMarkedForDeletion < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :projects, :marked_for_deletion_at, where: 'marked_for_deletion_at IS NOT NULL' - end - - def down - remove_concurrent_index :projects, :marked_for_deletion_at - end -end diff --git a/db/migrate/20191108031900_create_package_build_info.rb b/db/migrate/20191108031900_create_package_build_info.rb deleted file mode 100644 index d0c85e2fb3f..00000000000 --- a/db/migrate/20191108031900_create_package_build_info.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class CreatePackageBuildInfo < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :packages_build_infos do |t| - t.references :package, null: false, foreign_key: { to_table: :packages_packages, on_delete: :cascade }, type: :integer, index: { unique: true } - t.references :pipeline, index: true, null: true, foreign_key: { to_table: :ci_pipelines, on_delete: :nullify }, type: :integer - end - end -end diff --git a/db/migrate/20191111115229_add_group_id_to_import_export_uploads.rb b/db/migrate/20191111115229_add_group_id_to_import_export_uploads.rb deleted file mode 100644 index 74ef0f27b3e..00000000000 --- a/db/migrate/20191111115229_add_group_id_to_import_export_uploads.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddGroupIdToImportExportUploads < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :import_export_uploads, :group_id, :bigint - end -end diff --git a/db/migrate/20191111115431_add_group_fk_to_import_export_uploads.rb b/db/migrate/20191111115431_add_group_fk_to_import_export_uploads.rb deleted file mode 100644 index 403de3f33ed..00000000000 --- a/db/migrate/20191111115431_add_group_fk_to_import_export_uploads.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddGroupFkToImportExportUploads < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :import_export_uploads, :namespaces, column: :group_id, on_delete: :cascade - add_concurrent_index :import_export_uploads, :group_id, unique: true, where: 'group_id IS NOT NULL' - end - - def down - remove_foreign_key_without_error(:import_export_uploads, column: :group_id) - remove_concurrent_index(:import_export_uploads, :group_id) - end -end diff --git a/db/migrate/20191111121500_default_ci_config_path.rb b/db/migrate/20191111121500_default_ci_config_path.rb deleted file mode 100644 index 3914058d35b..00000000000 --- a/db/migrate/20191111121500_default_ci_config_path.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class DefaultCiConfigPath < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def up - add_column :application_settings, :default_ci_config_path, :string, limit: 255 - end - # rubocop:enable Migration/PreventStrings - - def down - remove_column :application_settings, :default_ci_config_path - end -end diff --git a/db/migrate/20191111165017_add_fixed_pipeline_to_notification_settings.rb b/db/migrate/20191111165017_add_fixed_pipeline_to_notification_settings.rb deleted file mode 100644 index 7a857807468..00000000000 --- a/db/migrate/20191111165017_add_fixed_pipeline_to_notification_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddFixedPipelineToNotificationSettings < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :notification_settings, :fixed_pipeline, :boolean - end -end diff --git a/db/migrate/20191111175230_add_index_on_ci_pipelines_updated_at.rb b/db/migrate/20191111175230_add_index_on_ci_pipelines_updated_at.rb deleted file mode 100644 index 566bb16ac65..00000000000 --- a/db/migrate/20191111175230_add_index_on_ci_pipelines_updated_at.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnCiPipelinesUpdatedAt < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_COLUMNS = [:project_id, :status, :updated_at] - - disable_ddl_transaction! - - def up - add_concurrent_index(:ci_pipelines, INDEX_COLUMNS) - end - - def down - remove_concurrent_index(:ci_pipelines, INDEX_COLUMNS) - end -end diff --git a/db/migrate/20191112090226_add_artifacts_to_ci_build_need.rb b/db/migrate/20191112090226_add_artifacts_to_ci_build_need.rb deleted file mode 100644 index b868e0b44a8..00000000000 --- a/db/migrate/20191112090226_add_artifacts_to_ci_build_need.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddArtifactsToCiBuildNeed < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default(:ci_build_needs, :artifacts, # rubocop:disable Migration/AddColumnWithDefault - :boolean, - default: true, - allow_null: false) - end - - def down - remove_column(:ci_build_needs, :artifacts) - end -end diff --git a/db/migrate/20191112105448_add_index_on_personal_access_tokens_user_id_and_expires_at.rb b/db/migrate/20191112105448_add_index_on_personal_access_tokens_user_id_and_expires_at.rb deleted file mode 100644 index 1c1dc31ff23..00000000000 --- a/db/migrate/20191112105448_add_index_on_personal_access_tokens_user_id_and_expires_at.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnPersonalAccessTokensUserIdAndExpiresAt < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_pat_on_user_id_and_expires_at' - - disable_ddl_transaction! - - def up - add_concurrent_index :personal_access_tokens, [:user_id, :expires_at], name: INDEX_NAME, using: :btree - end - - def down - remove_concurrent_index_by_name :personal_access_tokens, INDEX_NAME - end -end diff --git a/db/migrate/20191112115247_add_cached_markdown_version_to_vulnerabilities.rb b/db/migrate/20191112115247_add_cached_markdown_version_to_vulnerabilities.rb deleted file mode 100644 index b0c513737e8..00000000000 --- a/db/migrate/20191112115247_add_cached_markdown_version_to_vulnerabilities.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddCachedMarkdownVersionToVulnerabilities < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :vulnerabilities, :cached_markdown_version, :integer - end -end diff --git a/db/migrate/20191112212815_create_web_authn_table.rb b/db/migrate/20191112212815_create_web_authn_table.rb deleted file mode 100644 index 72895f955df..00000000000 --- a/db/migrate/20191112212815_create_web_authn_table.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class CreateWebAuthnTable < ActiveRecord::Migration[6.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # disable_ddl_transaction! - - # rubocop:disable Migration/AddLimitToTextColumns - # limits are added in subsequent migration - def change - create_table :webauthn_registrations do |t| - t.bigint :user_id, null: false, index: true - - t.bigint :counter, default: 0, null: false - t.timestamps_with_timezone - t.text :credential_xid, null: false, index: { unique: true } - t.text :name, null: false - # The length of the public key is determined by the device - # and not specified. Thus we can't set a limit - t.text :public_key, null: false # rubocop:disable Migration/AddLimitToTextColumns - end - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20191112214305_add_indexes_for_projects_api_default_params.rb b/db/migrate/20191112214305_add_indexes_for_projects_api_default_params.rb deleted file mode 100644 index 3893c0422c7..00000000000 --- a/db/migrate/20191112214305_add_indexes_for_projects_api_default_params.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexesForProjectsApiDefaultParams < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :projects, %i(visibility_level created_at id) - remove_concurrent_index_by_name :projects, 'index_projects_on_visibility_level' - end - - def down - add_concurrent_index :projects, :visibility_level - remove_concurrent_index :projects, %i(visibility_level created_at id) - end -end diff --git a/db/migrate/20191112221821_add_indexes_for_projects_api_default_params_authenticated.rb b/db/migrate/20191112221821_add_indexes_for_projects_api_default_params_authenticated.rb deleted file mode 100644 index 6ebc6a72854..00000000000 --- a/db/migrate/20191112221821_add_indexes_for_projects_api_default_params_authenticated.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexesForProjectsApiDefaultParamsAuthenticated < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :projects, %i(created_at id) - remove_concurrent_index_by_name :projects, 'index_projects_on_created_at' - end - - def down - add_concurrent_index :projects, :created_at - remove_concurrent_index_by_name :projects, 'index_projects_on_created_at_and_id' - end -end diff --git a/db/migrate/20191112232338_ensure_no_empty_milestone_titles.rb b/db/migrate/20191112232338_ensure_no_empty_milestone_titles.rb deleted file mode 100644 index 76cb511424e..00000000000 --- a/db/migrate/20191112232338_ensure_no_empty_milestone_titles.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class EnsureNoEmptyMilestoneTitles < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - loop do - rows_updated = exec_update <<~SQL - UPDATE milestones SET title = '%BLANK' WHERE id IN (SELECT id FROM milestones WHERE title = '' LIMIT 500) - SQL - break if rows_updated < 500 - end - end - - def down; end -end diff --git a/db/migrate/20191114132259_add_mentions_disabled_to_namespaces.rb b/db/migrate/20191114132259_add_mentions_disabled_to_namespaces.rb deleted file mode 100644 index a67d032795d..00000000000 --- a/db/migrate/20191114132259_add_mentions_disabled_to_namespaces.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddMentionsDisabledToNamespaces < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :namespaces, :mentions_disabled, :boolean # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20191114173508_add_resolved_attributes_to_vulnerabilities.rb b/db/migrate/20191114173508_add_resolved_attributes_to_vulnerabilities.rb deleted file mode 100644 index ec45a729ebb..00000000000 --- a/db/migrate/20191114173508_add_resolved_attributes_to_vulnerabilities.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddResolvedAttributesToVulnerabilities < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - add_column :vulnerabilities, :resolved_by_id, :bigint - add_column :vulnerabilities, :resolved_at, :datetime_with_timezone - end - - def down - remove_column :vulnerabilities, :resolved_at - remove_column :vulnerabilities, :resolved_by_id - end -end diff --git a/db/migrate/20191114173602_add_foreign_key_on_resolved_by_id_to_vulnerabilities.rb b/db/migrate/20191114173602_add_foreign_key_on_resolved_by_id_to_vulnerabilities.rb deleted file mode 100644 index e0a125ca756..00000000000 --- a/db/migrate/20191114173602_add_foreign_key_on_resolved_by_id_to_vulnerabilities.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyOnResolvedByIdToVulnerabilities < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :vulnerabilities, :resolved_by_id - add_concurrent_foreign_key :vulnerabilities, :users, column: :resolved_by_id, on_delete: :nullify - end - - def down - remove_foreign_key :vulnerabilities, column: :resolved_by_id - remove_concurrent_index :vulnerabilities, :resolved_by_id - end -end diff --git a/db/migrate/20191114201118_make_created_at_not_null_in_design_management_versions.rb b/db/migrate/20191114201118_make_created_at_not_null_in_design_management_versions.rb deleted file mode 100644 index 7b9d70c1a50..00000000000 --- a/db/migrate/20191114201118_make_created_at_not_null_in_design_management_versions.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class MakeCreatedAtNotNullInDesignManagementVersions < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - change_column_null :design_management_versions, :created_at, false, Time.now.to_s(:db) - end - - def down - change_column_null :design_management_versions, :created_at, true - end -end diff --git a/db/migrate/20191115001123_add_index_to_mod_sec_ci_variables.rb b/db/migrate/20191115001123_add_index_to_mod_sec_ci_variables.rb deleted file mode 100644 index 169ecf5ea41..00000000000 --- a/db/migrate/20191115001123_add_index_to_mod_sec_ci_variables.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToModSecCiVariables < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_variables, :project_id, where: "key = 'AUTO_DEVOPS_MODSECURITY_SEC_RULE_ENGINE'" - end - - def down - remove_concurrent_index :ci_variables, :project_id - end -end diff --git a/db/migrate/20191115001843_add_index_to_mod_sec_ci_pipeline_variables.rb b/db/migrate/20191115001843_add_index_to_mod_sec_ci_pipeline_variables.rb deleted file mode 100644 index 6b13f565a11..00000000000 --- a/db/migrate/20191115001843_add_index_to_mod_sec_ci_pipeline_variables.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToModSecCiPipelineVariables < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_pipeline_variables, :pipeline_id, where: "key = 'AUTO_DEVOPS_MODSECURITY_SEC_RULE_ENGINE'" - end - - def down - remove_concurrent_index :ci_pipeline_variables, :pipeline_id - end -end diff --git a/db/migrate/20191115091425_create_vulnerability_issue_links.rb b/db/migrate/20191115091425_create_vulnerability_issue_links.rb deleted file mode 100644 index 8398b6357c4..00000000000 --- a/db/migrate/20191115091425_create_vulnerability_issue_links.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class CreateVulnerabilityIssueLinks < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :vulnerability_issue_links do |t| - # index: false because idx_vulnerability_issue_links_on_vulnerability_id_and_issue_id refers the same column - t.references :vulnerability, null: false, index: false, foreign_key: { on_delete: :cascade } - # index: true is implied - t.references :issue, null: false, foreign_key: { on_delete: :cascade } - t.integer 'link_type', limit: 2, null: false, default: 1 # 'related' - t.index %i[vulnerability_id issue_id], - name: 'idx_vulnerability_issue_links_on_vulnerability_id_and_issue_id', - unique: true # only one link (and of only one type) is allowed - t.index %i[vulnerability_id link_type], - name: 'idx_vulnerability_issue_links_on_vulnerability_id_and_link_type', - where: 'link_type = 2', - unique: true # only one 'created' link per vulnerability is allowed - t.timestamps_with_timezone - end - end -end diff --git a/db/migrate/20191115114032_add_processed_to_ci_builds.rb b/db/migrate/20191115114032_add_processed_to_ci_builds.rb deleted file mode 100644 index 6fece99cb02..00000000000 --- a/db/migrate/20191115114032_add_processed_to_ci_builds.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddProcessedToCiBuilds < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :ci_builds, :processed, :boolean # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20191118053631_add_group_deletion_schedules.rb b/db/migrate/20191118053631_add_group_deletion_schedules.rb deleted file mode 100644 index 6f3ed27e156..00000000000 --- a/db/migrate/20191118053631_add_group_deletion_schedules.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class AddGroupDeletionSchedules < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - create_table :group_deletion_schedules, id: false do |t| - t.references :group, - foreign_key: { on_delete: :cascade, to_table: :namespaces }, - default: nil, - index: false, - primary_key: true - - t.references :user, - index: true, - foreign_key: { on_delete: :nullify }, - null: false - - t.date :marked_for_deletion_on, - index: true, - null: false - end - end - - def down - drop_table :group_deletion_schedules - end -end diff --git a/db/migrate/20191118155702_add_index_on_status_to_merge_trains.rb b/db/migrate/20191118155702_add_index_on_status_to_merge_trains.rb deleted file mode 100644 index 9b5238045f8..00000000000 --- a/db/migrate/20191118155702_add_index_on_status_to_merge_trains.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnStatusToMergeTrains < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_for_status_per_branch_per_project' - - disable_ddl_transaction! - - def up - add_concurrent_index :merge_trains, [:target_project_id, :target_branch, :status], name: INDEX_NAME - remove_concurrent_index :merge_trains, :target_project_id - end - - def down - add_concurrent_index :merge_trains, :target_project_id - remove_concurrent_index :merge_trains, [:target_project_id, :target_branch, :status], name: INDEX_NAME - end -end diff --git a/db/migrate/20191118173522_add_snippet_size_limit_to_application_settings.rb b/db/migrate/20191118173522_add_snippet_size_limit_to_application_settings.rb deleted file mode 100644 index b6b30febbd6..00000000000 --- a/db/migrate/20191118173522_add_snippet_size_limit_to_application_settings.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddSnippetSizeLimitToApplicationSettings < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - add_column :application_settings, :snippet_size_limit, :bigint, default: 50.megabytes, null: false - end - - def down - remove_column :application_settings, :snippet_size_limit - end -end diff --git a/db/migrate/20191118182722_add_index_to_environments_on_project_id_state_environment_type.rb b/db/migrate/20191118182722_add_index_to_environments_on_project_id_state_environment_type.rb deleted file mode 100644 index 01272dfad44..00000000000 --- a/db/migrate/20191118182722_add_index_to_environments_on_project_id_state_environment_type.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToEnvironmentsOnProjectIdStateEnvironmentType < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - OLD_INDEX_NAME = 'index_environments_on_project_id_and_state' - NEW_INDEX_NAME = 'index_environments_on_project_id_state_environment_type' - - disable_ddl_transaction! - - def up - add_concurrent_index(:environments, [:project_id, :state, :environment_type], name: NEW_INDEX_NAME) - remove_concurrent_index_by_name(:environments, OLD_INDEX_NAME) - end - - def down - add_concurrent_index(:environments, [:project_id, :state], name: OLD_INDEX_NAME) - remove_concurrent_index_by_name(:environments, NEW_INDEX_NAME) - end -end diff --git a/db/migrate/20191119023952_add_created_at_index_to_snippets.rb b/db/migrate/20191119023952_add_created_at_index_to_snippets.rb deleted file mode 100644 index 226af5f9e6d..00000000000 --- a/db/migrate/20191119023952_add_created_at_index_to_snippets.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddCreatedAtIndexToSnippets < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :snippets, :created_at - end - - def down - remove_concurrent_index :snippets, :created_at - end -end diff --git a/db/migrate/20191119220425_rename_software_license_policies_approval_status_to_classification.rb b/db/migrate/20191119220425_rename_software_license_policies_approval_status_to_classification.rb deleted file mode 100644 index 98c14f42558..00000000000 --- a/db/migrate/20191119220425_rename_software_license_policies_approval_status_to_classification.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RenameSoftwareLicensePoliciesApprovalStatusToClassification < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - rename_column_concurrently :software_license_policies, :approval_status, :classification - end - - def down - undo_rename_column_concurrently :software_license_policies, :approval_status, :classification - end -end diff --git a/db/migrate/20191119231621_create_container_expiration_policies.rb b/db/migrate/20191119231621_create_container_expiration_policies.rb deleted file mode 100644 index d06ae659f41..00000000000 --- a/db/migrate/20191119231621_create_container_expiration_policies.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class CreateContainerExpirationPolicies < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :container_expiration_policies, id: false, primary_key: :project_id do |t| - t.timestamps_with_timezone null: false - t.datetime_with_timezone :next_run_at - t.references :project, primary_key: true, default: nil, index: false, foreign_key: { on_delete: :cascade } - t.string :name_regex, limit: 255 - t.string :cadence, null: false, limit: 12, default: '7d' - t.string :older_than, limit: 12 - t.integer :keep_n - t.boolean :enabled, null: false, default: false - end - - add_index :container_expiration_policies, [:next_run_at, :enabled], - name: 'index_container_expiration_policies_on_next_run_at_and_enabled' - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191120084627_add_encrypted_fields_to_application_settings.rb b/db/migrate/20191120084627_add_encrypted_fields_to_application_settings.rb deleted file mode 100644 index 7bb2d9c6301..00000000000 --- a/db/migrate/20191120084627_add_encrypted_fields_to_application_settings.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -class AddEncryptedFieldsToApplicationSettings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - PLAINTEXT_ATTRIBUTES = %w[ - akismet_api_key - elasticsearch_aws_secret_access_key - recaptcha_private_key - recaptcha_site_key - slack_app_secret - slack_app_verification_token - ].freeze - - # rubocop:disable Migration/PreventStrings - # rubocop:disable Migration/AddLimitToTextColumns - def up - PLAINTEXT_ATTRIBUTES.each do |plaintext_attribute| - add_column :application_settings, "encrypted_#{plaintext_attribute}", :text - add_column :application_settings, "encrypted_#{plaintext_attribute}_iv", :string, limit: 255 - end - end - # rubocop:enable Migration/AddLimitToTextColumns - # rubocop:enable Migration/PreventStrings - - def down - PLAINTEXT_ATTRIBUTES.each do |plaintext_attribute| - remove_column :application_settings, "encrypted_#{plaintext_attribute}" - remove_column :application_settings, "encrypted_#{plaintext_attribute}_iv" - end - end -end diff --git a/db/migrate/20191120115530_encrypt_plaintext_attributes_on_application_settings.rb b/db/migrate/20191120115530_encrypt_plaintext_attributes_on_application_settings.rb deleted file mode 100644 index 3ae5e3265e8..00000000000 --- a/db/migrate/20191120115530_encrypt_plaintext_attributes_on_application_settings.rb +++ /dev/null @@ -1,87 +0,0 @@ -# frozen_string_literal: true - -class EncryptPlaintextAttributesOnApplicationSettings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - PLAINTEXT_ATTRIBUTES = %w[ - akismet_api_key - elasticsearch_aws_secret_access_key - recaptcha_private_key - recaptcha_site_key - slack_app_secret - slack_app_verification_token - ].freeze - - class ApplicationSetting < ActiveRecord::Base - self.table_name = 'application_settings' - - def self.encryption_options_base_32_aes_256_gcm - { - mode: :per_attribute_iv, - key: Gitlab::Utils.ensure_utf8_size(Rails.application.secrets.db_key_base, bytes: 32.bytes), - algorithm: 'aes-256-gcm', - encode: true - } - end - - attr_encrypted :akismet_api_key, encryption_options_base_32_aes_256_gcm - attr_encrypted :elasticsearch_aws_secret_access_key, encryption_options_base_32_aes_256_gcm - attr_encrypted :recaptcha_private_key, encryption_options_base_32_aes_256_gcm - attr_encrypted :recaptcha_site_key, encryption_options_base_32_aes_256_gcm - attr_encrypted :slack_app_secret, encryption_options_base_32_aes_256_gcm - attr_encrypted :slack_app_verification_token, encryption_options_base_32_aes_256_gcm - - def akismet_api_key - decrypt(:akismet_api_key, self[:encrypted_akismet_api_key]) || self[:akismet_api_key] - end - - def elasticsearch_aws_secret_access_key - decrypt(:elasticsearch_aws_secret_access_key, self[:encrypted_elasticsearch_aws_secret_access_key]) || self[:elasticsearch_aws_secret_access_key] - end - - def recaptcha_private_key - decrypt(:recaptcha_private_key, self[:encrypted_recaptcha_private_key]) || self[:recaptcha_private_key] - end - - def recaptcha_site_key - decrypt(:recaptcha_site_key, self[:encrypted_recaptcha_site_key]) || self[:recaptcha_site_key] - end - - def slack_app_secret - decrypt(:slack_app_secret, self[:encrypted_slack_app_secret]) || self[:slack_app_secret] - end - - def slack_app_verification_token - decrypt(:slack_app_verification_token, self[:encrypted_slack_app_verification_token]) || self[:slack_app_verification_token] - end - end - - def up - ApplicationSetting.find_each do |application_setting| - # We are using the setter from attr_encrypted gem to encrypt the data. - # The gem updates the two columns needed to decrypt the value: - # - "encrypted_#{plaintext_attribute}" - # - "encrypted_#{plaintext_attribute}_iv" - application_setting.assign_attributes( - PLAINTEXT_ATTRIBUTES.each_with_object({}) do |plaintext_attribute, attributes| - attributes[plaintext_attribute] = application_setting.send(plaintext_attribute) - end - ) - application_setting.save(validate: false) - end - end - - def down - ApplicationSetting.find_each do |application_setting| - application_setting.update_columns( - PLAINTEXT_ATTRIBUTES.each_with_object({}) do |plaintext_attribute, attributes| - attributes[plaintext_attribute] = application_setting.send(plaintext_attribute) - attributes["encrypted_#{plaintext_attribute}"] = nil - attributes["encrypted_#{plaintext_attribute}_iv"] = nil - end - ) - end - end -end diff --git a/db/migrate/20191120200015_add_index_to_grafana_integrations.rb b/db/migrate/20191120200015_add_index_to_grafana_integrations.rb deleted file mode 100644 index c67f6850baf..00000000000 --- a/db/migrate/20191120200015_add_index_to_grafana_integrations.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToGrafanaIntegrations < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :grafana_integrations, :enabled, where: 'enabled IS TRUE' - end - - def down - remove_concurrent_index :grafana_integrations, :enabled - end -end diff --git a/db/migrate/20191121111621_create_packages_dependencies.rb b/db/migrate/20191121111621_create_packages_dependencies.rb deleted file mode 100644 index 29a8434514e..00000000000 --- a/db/migrate/20191121111621_create_packages_dependencies.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class CreatePackagesDependencies < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :packages_dependencies do |t| - t.string :name, null: false, limit: 255 - t.string :version_pattern, null: false, limit: 255 - end - - add_index :packages_dependencies, [:name, :version_pattern], unique: true - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191121121947_create_packages_dependency_links.rb b/db/migrate/20191121121947_create_packages_dependency_links.rb deleted file mode 100644 index 0907ed8f16c..00000000000 --- a/db/migrate/20191121121947_create_packages_dependency_links.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class CreatePackagesDependencyLinks < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :packages_dependency_links do |t| - t.references :package, index: false, null: false, foreign_key: { to_table: :packages_packages, on_delete: :cascade }, type: :bigint - t.references :dependency, null: false, foreign_key: { to_table: :packages_dependencies, on_delete: :cascade }, type: :bigint - t.integer :dependency_type, limit: 2, null: false - end - - add_index :packages_dependency_links, [:package_id, :dependency_id, :dependency_type], unique: true, name: 'idx_pkgs_dep_links_on_pkg_id_dependency_id_dependency_type' - end -end diff --git a/db/migrate/20191121161018_add_project_id_name_version_package_type_index_to_packages_packages.rb b/db/migrate/20191121161018_add_project_id_name_version_package_type_index_to_packages_packages.rb deleted file mode 100644 index 4a34b9e791e..00000000000 --- a/db/migrate/20191121161018_add_project_id_name_version_package_type_index_to_packages_packages.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class AddProjectIdNameVersionPackageTypeIndexToPackagesPackages < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'idx_packages_packages_on_project_id_name_version_package_type' - - disable_ddl_transaction! - - def up - add_concurrent_index :packages_packages, - [:project_id, :name, :version, :package_type], - name: INDEX_NAME - end - - def down - remove_concurrent_index :packages_packages, - [:project_id, :name, :version, :package_type], - name: INDEX_NAME - end -end diff --git a/db/migrate/20191121193110_add_issue_links_type.rb b/db/migrate/20191121193110_add_issue_links_type.rb deleted file mode 100644 index 86bfd41b916..00000000000 --- a/db/migrate/20191121193110_add_issue_links_type.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIssueLinksType < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :issue_links, :link_type, :integer, default: 0, limit: 2 # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :issue_links, :link_type - end -end diff --git a/db/migrate/20191122161519_create_sentry_issues_table.rb b/db/migrate/20191122161519_create_sentry_issues_table.rb deleted file mode 100644 index 753286b6025..00000000000 --- a/db/migrate/20191122161519_create_sentry_issues_table.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class CreateSentryIssuesTable < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :sentry_issues do |t| - t.references :issue, - foreign_key: { on_delete: :cascade }, - index: { unique: true }, - null: false - t.bigint :sentry_issue_identifier, null: false - end - end -end diff --git a/db/migrate/20191123062354_add_minimum_password_length_to_application_settings.rb b/db/migrate/20191123062354_add_minimum_password_length_to_application_settings.rb deleted file mode 100644 index 0a7ad9d81a9..00000000000 --- a/db/migrate/20191123062354_add_minimum_password_length_to_application_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddMinimumPasswordLengthToApplicationSettings < ActiveRecord::Migration[5.2] - DOWNTIME = false - - DEFAULT_MINIMUM_PASSWORD_LENGTH = 8 - - def change - add_column(:application_settings, :minimum_password_length, :integer, default: DEFAULT_MINIMUM_PASSWORD_LENGTH, null: false) - end -end diff --git a/db/migrate/20191123081456_add_dismissable_to_broadcast_messages.rb b/db/migrate/20191123081456_add_dismissable_to_broadcast_messages.rb deleted file mode 100644 index 40235771d80..00000000000 --- a/db/migrate/20191123081456_add_dismissable_to_broadcast_messages.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddDismissableToBroadcastMessages < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :broadcast_messages, :dismissable, :boolean - end -end diff --git a/db/migrate/20191124150431_change_label_id_index_to_include_action_on_label_events.rb b/db/migrate/20191124150431_change_label_id_index_to_include_action_on_label_events.rb deleted file mode 100644 index bd138adc5fa..00000000000 --- a/db/migrate/20191124150431_change_label_id_index_to_include_action_on_label_events.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class ChangeLabelIdIndexToIncludeActionOnLabelEvents < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index(:resource_label_events, %I[label_id action]) - - remove_concurrent_index(:resource_label_events, :label_id) - end - - def down - add_concurrent_index(:resource_label_events, :label_id) - - remove_concurrent_index(:resource_label_events, %I[label_id action]) - end -end diff --git a/db/migrate/20191125114345_add_admin_mode_protected_path.rb b/db/migrate/20191125114345_add_admin_mode_protected_path.rb deleted file mode 100644 index 7e9b0d5a285..00000000000 --- a/db/migrate/20191125114345_add_admin_mode_protected_path.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -class AddAdminModeProtectedPath < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - ADMIN_MODE_ENDPOINT = '/admin/session' - - OLD_DEFAULT_PROTECTED_PATHS = [ - '/users/password', - '/users/sign_in', - '/api/v3/session.json', - '/api/v3/session', - '/api/v4/session.json', - '/api/v4/session', - '/users', - '/users/confirmation', - '/unsubscribes/', - '/import/github/personal_access_token' - ] - - NEW_DEFAULT_PROTECTED_PATHS = OLD_DEFAULT_PROTECTED_PATHS.dup << ADMIN_MODE_ENDPOINT - - class ApplicationSetting < ActiveRecord::Base - self.table_name = 'application_settings' - end - - def up - change_column_default :application_settings, :protected_paths, NEW_DEFAULT_PROTECTED_PATHS - - # schema allows nulls for protected_paths - ApplicationSetting.where.not(protected_paths: nil).each do |application_setting| - unless application_setting.protected_paths.include?(ADMIN_MODE_ENDPOINT) - updated_protected_paths = application_setting.protected_paths << ADMIN_MODE_ENDPOINT - - application_setting.update(protected_paths: updated_protected_paths) - end - end - end - - def down - change_column_default :application_settings, :protected_paths, OLD_DEFAULT_PROTECTED_PATHS - - # schema allows nulls for protected_paths - ApplicationSetting.where.not(protected_paths: nil).each do |application_setting| - if application_setting.protected_paths.include?(ADMIN_MODE_ENDPOINT) - updated_protected_paths = application_setting.protected_paths - [ADMIN_MODE_ENDPOINT] - - application_setting.update(protected_paths: updated_protected_paths) - end - end - end -end diff --git a/db/migrate/20191125133353_add_target_path_to_broadcast_message.rb b/db/migrate/20191125133353_add_target_path_to_broadcast_message.rb deleted file mode 100644 index 8597cce5b19..00000000000 --- a/db/migrate/20191125133353_add_target_path_to_broadcast_message.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddTargetPathToBroadcastMessage < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :broadcast_messages, :target_path, :string, limit: 255 - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191125140458_create_import_failures.rb b/db/migrate/20191125140458_create_import_failures.rb deleted file mode 100644 index e5dbcf5d41d..00000000000 --- a/db/migrate/20191125140458_create_import_failures.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CreateImportFailures < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :import_failures do |t| - t.integer :relation_index - t.references :project, null: false, index: true - t.datetime_with_timezone :created_at, null: false - t.string :relation_key, limit: 64 - t.string :exception_class, limit: 128 - t.string :correlation_id_value, limit: 128, index: true - t.string :exception_message, limit: 255 - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191126134210_rename_packages_package_tags.rb b/db/migrate/20191126134210_rename_packages_package_tags.rb deleted file mode 100644 index 75cb53802ab..00000000000 --- a/db/migrate/20191126134210_rename_packages_package_tags.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class RenamePackagesPackageTags < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - rename_table(:packages_package_tags, :packages_tags) - end -end diff --git a/db/migrate/20191127030005_create_serverless_domain_cluster.rb b/db/migrate/20191127030005_create_serverless_domain_cluster.rb deleted file mode 100644 index c65301bf133..00000000000 --- a/db/migrate/20191127030005_create_serverless_domain_cluster.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CreateServerlessDomainCluster < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - create_table :serverless_domain_cluster, id: false, primary_key: :uuid do |t| - t.references :pages_domain, null: false, foreign_key: { on_delete: :cascade } - t.references :clusters_applications_knative, null: false, - foreign_key: { to_table: :clusters_applications_knative, on_delete: :cascade }, - index: { name: :idx_serverless_domain_cluster_on_clusters_applications_knative, unique: true } - t.references :creator, name: :created_by, foreign_key: { to_table: :users, on_delete: :nullify } - t.timestamps_with_timezone null: false - t.string :uuid, null: false, limit: 14, primary_key: true - end - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191127151619_create_gitlab_subscription_histories.rb b/db/migrate/20191127151619_create_gitlab_subscription_histories.rb deleted file mode 100644 index 718f2c1b313..00000000000 --- a/db/migrate/20191127151619_create_gitlab_subscription_histories.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class CreateGitlabSubscriptionHistories < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - create_table :gitlab_subscription_histories do |t| - t.datetime_with_timezone :gitlab_subscription_created_at - t.datetime_with_timezone :gitlab_subscription_updated_at - t.date :start_date - t.date :end_date - t.date :trial_ends_on - t.integer :namespace_id, null: true - t.integer :hosted_plan_id, null: true - t.integer :max_seats_used - t.integer :seats - t.boolean :trial - t.integer :change_type, limit: 2 - t.bigint :gitlab_subscription_id, null: false - t.datetime_with_timezone :created_at - end - add_index :gitlab_subscription_histories, :gitlab_subscription_id - end - - def down - drop_table :gitlab_subscription_histories - end -end diff --git a/db/migrate/20191127151629_add_trial_starts_on_to_gitlab_subscriptions.rb b/db/migrate/20191127151629_add_trial_starts_on_to_gitlab_subscriptions.rb deleted file mode 100644 index 2528aa9c2c8..00000000000 --- a/db/migrate/20191127151629_add_trial_starts_on_to_gitlab_subscriptions.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -class AddTrialStartsOnToGitlabSubscriptions < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :gitlab_subscriptions, :trial_starts_on, :date, null: true - add_column :gitlab_subscription_histories, :trial_starts_on, :date, null: true - end -end diff --git a/db/migrate/20191127163053_add_confidential_to_doorkeeper_application.rb b/db/migrate/20191127163053_add_confidential_to_doorkeeper_application.rb deleted file mode 100644 index 12e22b4744c..00000000000 --- a/db/migrate/20191127163053_add_confidential_to_doorkeeper_application.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class AddConfidentialToDoorkeeperApplication < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default( # rubocop:disable Migration/AddColumnWithDefault - :oauth_applications, - :confidential, - :boolean, - default: false, # assume all existing applications are non-confidential - allow_null: false - ) - - # set the default to true so that all future applications are confidential by default - change_column_default(:oauth_applications, :confidential, true) - end - - def down - remove_column :oauth_applications, :confidential - end -end diff --git a/db/migrate/20191127221608_add_wildcard_and_domain_type_to_pages_domains.rb b/db/migrate/20191127221608_add_wildcard_and_domain_type_to_pages_domains.rb deleted file mode 100644 index 96a2e8275c6..00000000000 --- a/db/migrate/20191127221608_add_wildcard_and_domain_type_to_pages_domains.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddWildcardAndDomainTypeToPagesDomains < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - PROJECT_TYPE = 2 - - disable_ddl_transaction! - - def up - add_column_with_default :pages_domains, :wildcard, :boolean, default: false # rubocop:disable Migration/AddColumnWithDefault - add_column_with_default :pages_domains, :domain_type, :integer, limit: 2, default: PROJECT_TYPE # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :pages_domains, :wildcard - remove_column :pages_domains, :domain_type - end -end diff --git a/db/migrate/20191128145231_add_ci_resource_groups.rb b/db/migrate/20191128145231_add_ci_resource_groups.rb deleted file mode 100644 index 77975120f72..00000000000 --- a/db/migrate/20191128145231_add_ci_resource_groups.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class AddCiResourceGroups < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :ci_resource_groups do |t| - t.timestamps_with_timezone - t.bigint :project_id, null: false - t.string :key, null: false, limit: 255 # rubocop:disable Migration/PreventStrings - t.index %i[project_id key], unique: true - end - - create_table :ci_resources do |t| - t.timestamps_with_timezone - t.references :resource_group, null: false, index: false, foreign_key: { to_table: :ci_resource_groups, on_delete: :cascade } - t.bigint :build_id, null: true - t.index %i[build_id] - t.index %i[resource_group_id build_id], unique: true - end - end -end diff --git a/db/migrate/20191128145232_add_fk_to_ci_resources_build_id.rb b/db/migrate/20191128145232_add_fk_to_ci_resources_build_id.rb deleted file mode 100644 index a13513de3b2..00000000000 --- a/db/migrate/20191128145232_add_fk_to_ci_resources_build_id.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddFkToCiResourcesBuildId < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :ci_resources, :ci_builds, column: :build_id, on_delete: :nullify - end - - def down - remove_foreign_key_if_exists :ci_resources, column: :build_id - end -end diff --git a/db/migrate/20191128145233_add_fk_to_ci_resource_groups_project_id.rb b/db/migrate/20191128145233_add_fk_to_ci_resource_groups_project_id.rb deleted file mode 100644 index bb23012ea9b..00000000000 --- a/db/migrate/20191128145233_add_fk_to_ci_resource_groups_project_id.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddFkToCiResourceGroupsProjectId < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :ci_resource_groups, :projects, column: :project_id, on_delete: :cascade - end - - def down - remove_foreign_key_if_exists :ci_resource_groups, column: :project_id - end -end diff --git a/db/migrate/20191129134844_add_broadcast_type_to_broadcast_message.rb b/db/migrate/20191129134844_add_broadcast_type_to_broadcast_message.rb deleted file mode 100644 index 884d9ac6d7f..00000000000 --- a/db/migrate/20191129134844_add_broadcast_type_to_broadcast_message.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddBroadcastTypeToBroadcastMessage < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - BROADCAST_MESSAGE_BANNER_TYPE = 1 - - disable_ddl_transaction! - - def up - add_column_with_default(:broadcast_messages, :broadcast_type, :smallint, default: BROADCAST_MESSAGE_BANNER_TYPE) # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column(:broadcast_messages, :broadcast_type) - end -end diff --git a/db/migrate/20191129144630_add_resource_group_id_to_ci_builds.rb b/db/migrate/20191129144630_add_resource_group_id_to_ci_builds.rb deleted file mode 100644 index 245df7fdcf3..00000000000 --- a/db/migrate/20191129144630_add_resource_group_id_to_ci_builds.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class AddResourceGroupIdToCiBuilds < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/AddColumnsToWideTables - def up - unless column_exists?(:ci_builds, :resource_group_id) - add_column :ci_builds, :resource_group_id, :bigint - end - - unless column_exists?(:ci_builds, :waiting_for_resource_at) - add_column :ci_builds, :waiting_for_resource_at, :datetime_with_timezone - end - end - # rubocop:enable Migration/AddColumnsToWideTables - - def down - if column_exists?(:ci_builds, :resource_group_id) - remove_column :ci_builds, :resource_group_id, :bigint - end - - if column_exists?(:ci_builds, :waiting_for_resource_at) - remove_column :ci_builds, :waiting_for_resource_at, :datetime_with_timezone - end - end -end diff --git a/db/migrate/20191129144631_add_index_to_resource_group_id.rb b/db/migrate/20191129144631_add_index_to_resource_group_id.rb deleted file mode 100644 index 01d56f417b5..00000000000 --- a/db/migrate/20191129144631_add_index_to_resource_group_id.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToResourceGroupId < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_for_resource_group' - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_builds, %i[resource_group_id id], where: 'resource_group_id IS NOT NULL', name: INDEX_NAME - add_concurrent_foreign_key :ci_builds, :ci_resource_groups, column: :resource_group_id, on_delete: :nullify - end - - def down - remove_foreign_key_if_exists :ci_builds, column: :resource_group_id - remove_concurrent_index_by_name :ci_builds, INDEX_NAME - end -end diff --git a/db/migrate/20191202181924_add_environment_auto_stop_in_to_ci_builds_metadata.rb b/db/migrate/20191202181924_add_environment_auto_stop_in_to_ci_builds_metadata.rb deleted file mode 100644 index c09196da91b..00000000000 --- a/db/migrate/20191202181924_add_environment_auto_stop_in_to_ci_builds_metadata.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddEnvironmentAutoStopInToCiBuildsMetadata < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def up - add_column :ci_builds_metadata, :environment_auto_stop_in, :string, limit: 255 - end - # rubocop:enable Migration/PreventStrings - - def down - remove_column :ci_builds_metadata, :environment_auto_stop_in - end -end diff --git a/db/migrate/20191203121729_update_group_deletion_schedules_foreign_keys.rb b/db/migrate/20191203121729_update_group_deletion_schedules_foreign_keys.rb deleted file mode 100644 index 99531a1e93e..00000000000 --- a/db/migrate/20191203121729_update_group_deletion_schedules_foreign_keys.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class UpdateGroupDeletionSchedulesForeignKeys < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key(:group_deletion_schedules, :users, column: :user_id, on_delete: :cascade, name: new_foreign_key_name) - remove_foreign_key_if_exists(:group_deletion_schedules, column: :user_id, on_delete: :nullify) - end - - def down - add_concurrent_foreign_key(:group_deletion_schedules, :users, column: :user_id, on_delete: :nullify, name: existing_foreign_key_name) - remove_foreign_key_if_exists(:group_deletion_schedules, column: :user_id, on_delete: :cascade) - end - - private - - def new_foreign_key_name - concurrent_foreign_key_name(:group_deletion_schedules, :user_id) - end - - def existing_foreign_key_name - 'fk_group_deletion_schedules_users_user_id' - end -end diff --git a/db/migrate/20191204070713_change_updated_at_index_and_add_index_to_id_on_deployments.rb b/db/migrate/20191204070713_change_updated_at_index_and_add_index_to_id_on_deployments.rb deleted file mode 100644 index 450b276e689..00000000000 --- a/db/migrate/20191204070713_change_updated_at_index_and_add_index_to_id_on_deployments.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class ChangeUpdatedAtIndexAndAddIndexToIdOnDeployments < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - PROJECT_ID_INDEX_PARAMS = [[:project_id, :id], order: { id: :desc }] - OLD_UPDATED_AT_INDEX_PARAMS = [[:project_id, :updated_at]] - NEW_UPDATED_AT_INDEX_PARAMS = [[:project_id, :updated_at, :id], order: { updated_at: :desc, id: :desc }] - - def up - add_concurrent_index :deployments, *NEW_UPDATED_AT_INDEX_PARAMS - - remove_concurrent_index :deployments, *OLD_UPDATED_AT_INDEX_PARAMS - - add_concurrent_index :deployments, *PROJECT_ID_INDEX_PARAMS - end - - def down - add_concurrent_index :deployments, *OLD_UPDATED_AT_INDEX_PARAMS - - remove_concurrent_index :deployments, *NEW_UPDATED_AT_INDEX_PARAMS - - remove_concurrent_index :deployments, *PROJECT_ID_INDEX_PARAMS - end -end diff --git a/db/migrate/20191204093410_add_label_project_group_partial_indexes.rb b/db/migrate/20191204093410_add_label_project_group_partial_indexes.rb deleted file mode 100644 index 85666144856..00000000000 --- a/db/migrate/20191204093410_add_label_project_group_partial_indexes.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddLabelProjectGroupPartialIndexes < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - PROJECT_AND_TITLE = [:project_id, :title] - GROUP_AND_TITLE = [:group_id, :title] - - def up - add_concurrent_index :labels, PROJECT_AND_TITLE, unique: false, where: "labels.group_id = null" - add_concurrent_index :labels, GROUP_AND_TITLE, unique: false, where: "labels.project_id = null" - end - - def down - remove_concurrent_index :labels, PROJECT_AND_TITLE - remove_concurrent_index :labels, GROUP_AND_TITLE - end -end diff --git a/db/migrate/20191204192726_add_design_disk_path_to_geo_hashed_storage_migrated_events.rb b/db/migrate/20191204192726_add_design_disk_path_to_geo_hashed_storage_migrated_events.rb deleted file mode 100644 index 8631502ded8..00000000000 --- a/db/migrate/20191204192726_add_design_disk_path_to_geo_hashed_storage_migrated_events.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class AddDesignDiskPathToGeoHashedStorageMigratedEvents < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # rubocop:disable Migration/AddLimitToTextColumns - def change - add_column :geo_hashed_storage_migrated_events, :old_design_disk_path, :text - add_column :geo_hashed_storage_migrated_events, :new_design_disk_path, :text - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20191205060723_add_index_to_keys.rb b/db/migrate/20191205060723_add_index_to_keys.rb deleted file mode 100644 index 8e8c725f62e..00000000000 --- a/db/migrate/20191205060723_add_index_to_keys.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToKeys < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :keys, :last_used_at, order: { last_used_at: 'DESC NULLS LAST' } - end - - def down - remove_concurrent_index :keys, :last_used_at - end -end diff --git a/db/migrate/20191205094702_add_index_for_cross_projects_dependencies_to_ci_builds.rb b/db/migrate/20191205094702_add_index_for_cross_projects_dependencies_to_ci_builds.rb deleted file mode 100644 index 023414fb4bb..00000000000 --- a/db/migrate/20191205094702_add_index_for_cross_projects_dependencies_to_ci_builds.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexForCrossProjectsDependenciesToCiBuilds < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_builds, [:project_id, :name, :ref], - where: "type = 'Ci::Build' AND status = 'success' AND (retried = FALSE OR retried IS NULL)" - end - - def down - remove_concurrent_index :ci_builds, [:project_id, :name, :ref], - where: "type = 'Ci::Build' AND status = 'success' AND (retried = FALSE OR retried IS NULL)" - end -end diff --git a/db/migrate/20191205145647_add_index_to_projects_deploy_keys_deploy_key.rb b/db/migrate/20191205145647_add_index_to_projects_deploy_keys_deploy_key.rb deleted file mode 100644 index f9cdc226e4d..00000000000 --- a/db/migrate/20191205145647_add_index_to_projects_deploy_keys_deploy_key.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToProjectsDeployKeysDeployKey < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - def up - add_concurrent_index :deploy_keys_projects, :deploy_key_id - end - - def down - remove_concurrent_index :deploy_keys_projects, :deploy_key_id - end -end diff --git a/db/migrate/20191205212923_support_multiple_milestones_for_issues.rb b/db/migrate/20191205212923_support_multiple_milestones_for_issues.rb deleted file mode 100644 index e0edd76c4b9..00000000000 --- a/db/migrate/20191205212923_support_multiple_milestones_for_issues.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class SupportMultipleMilestonesForIssues < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :issue_milestones, id: false do |t| - t.references :issue, foreign_key: { on_delete: :cascade }, index: { unique: true }, null: false - t.references :milestone, foreign_key: { on_delete: :cascade }, index: true, null: false - end - - add_index :issue_milestones, [:issue_id, :milestone_id], unique: true - end -end diff --git a/db/migrate/20191205212924_support_multiple_milestones_for_merge_requests.rb b/db/migrate/20191205212924_support_multiple_milestones_for_merge_requests.rb deleted file mode 100644 index 85ad1a748e9..00000000000 --- a/db/migrate/20191205212924_support_multiple_milestones_for_merge_requests.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class SupportMultipleMilestonesForMergeRequests < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :merge_request_milestones, id: false do |t| - t.references :merge_request, foreign_key: { on_delete: :cascade }, index: { unique: true }, null: false - t.references :milestone, foreign_key: { on_delete: :cascade }, index: true, null: false - end - - add_index :merge_request_milestones, [:merge_request_id, :milestone_id], name: 'index_mrs_milestones_on_mr_id_and_milestone_id', unique: true - end -end diff --git a/db/migrate/20191206014412_add_image_to_design_management_designs_versions.rb b/db/migrate/20191206014412_add_image_to_design_management_designs_versions.rb deleted file mode 100644 index 54ef9b74f29..00000000000 --- a/db/migrate/20191206014412_add_image_to_design_management_designs_versions.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddImageToDesignManagementDesignsVersions < ActiveRecord::Migration[6.0] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :design_management_designs_versions, :image_v432x230, :string, limit: 255 - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191206022133_add_indexes_to_pages_domains_on_wildcard_and_domain_type.rb b/db/migrate/20191206022133_add_indexes_to_pages_domains_on_wildcard_and_domain_type.rb deleted file mode 100644 index 3c1704a3377..00000000000 --- a/db/migrate/20191206022133_add_indexes_to_pages_domains_on_wildcard_and_domain_type.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexesToPagesDomainsOnWildcardAndDomainType < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :pages_domains, :wildcard - add_concurrent_index :pages_domains, :domain_type - end - - def down - remove_concurrent_index :pages_domains, :wildcard - remove_concurrent_index :pages_domains, :domain_type - end -end diff --git a/db/migrate/20191206122926_update_index_for_pool_repositories.rb b/db/migrate/20191206122926_update_index_for_pool_repositories.rb deleted file mode 100644 index f88e8e94ee1..00000000000 --- a/db/migrate/20191206122926_update_index_for_pool_repositories.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class UpdateIndexForPoolRepositories < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - # This index is less restrictive then the one we already have, no need to - # update data. - add_concurrent_index :pool_repositories, [:source_project_id, :shard_id], unique: true - remove_concurrent_index :pool_repositories, :source_project_id - end - - def down - # Not adding this index as a unique one, since while the new index existed - # we could have created multiple pool repositories for a project. In that - # case this rollback would fail. - add_concurrent_index :pool_repositories, :source_project_id - remove_concurrent_index :pool_repositories, [:source_project_id, :shard_id], unique: true - end -end diff --git a/db/migrate/20191207104000_add_render_whitespace_in_code_to_user_preference.rb b/db/migrate/20191207104000_add_render_whitespace_in_code_to_user_preference.rb deleted file mode 100644 index 83b44b98c67..00000000000 --- a/db/migrate/20191207104000_add_render_whitespace_in_code_to_user_preference.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddRenderWhitespaceInCodeToUserPreference < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column(:user_preferences, :render_whitespace_in_code, :boolean) - end - - def down - remove_column(:user_preferences, :render_whitespace_in_code) - end -end diff --git a/db/migrate/20191208071111_add_fingerprint_sha256_to_key.rb b/db/migrate/20191208071111_add_fingerprint_sha256_to_key.rb deleted file mode 100644 index 1bc87357f7d..00000000000 --- a/db/migrate/20191208071111_add_fingerprint_sha256_to_key.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddFingerprintSha256ToKey < ActiveRecord::Migration[5.0] - DOWNTIME = false - - def up - add_column(:keys, :fingerprint_sha256, :binary) - end - - def down - remove_column(:keys, :fingerprint_sha256) if column_exists?(:keys, :fingerprint_sha256) - end -end diff --git a/db/migrate/20191208071112_add_fingerprint_sha256_index_to_key.rb b/db/migrate/20191208071112_add_fingerprint_sha256_index_to_key.rb deleted file mode 100644 index 6f0c4bcd321..00000000000 --- a/db/migrate/20191208071112_add_fingerprint_sha256_index_to_key.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddFingerprintSha256IndexToKey < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index(:keys, "fingerprint_sha256") - end - - def down - remove_concurrent_index(:keys, "fingerprint_sha256") - end -end diff --git a/db/migrate/20191208110214_add_suggestion_commit_message_to_projects.rb b/db/migrate/20191208110214_add_suggestion_commit_message_to_projects.rb deleted file mode 100644 index 3c96a1737c2..00000000000 --- a/db/migrate/20191208110214_add_suggestion_commit_message_to_projects.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddSuggestionCommitMessageToProjects < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/AddColumnsToWideTables - # rubocop:disable Migration/PreventStrings - def change - add_column :projects, :suggestion_commit_message, :string, limit: 255 - end - # rubocop:enable Migration/PreventStrings - # rubocop:enable Migration/AddColumnsToWideTables -end diff --git a/db/migrate/20191209143606_add_deleted_at_to_description_versions.rb b/db/migrate/20191209143606_add_deleted_at_to_description_versions.rb deleted file mode 100644 index 02a3d1271c2..00000000000 --- a/db/migrate/20191209143606_add_deleted_at_to_description_versions.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddDeletedAtToDescriptionVersions < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :description_versions, :deleted_at, :datetime_with_timezone - end -end diff --git a/db/migrate/20191210211253_create_resource_weight_event.rb b/db/migrate/20191210211253_create_resource_weight_event.rb deleted file mode 100644 index b458c5f169f..00000000000 --- a/db/migrate/20191210211253_create_resource_weight_event.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreateResourceWeightEvent < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :resource_weight_events do |t| - t.references :user, null: false, foreign_key: { on_delete: :nullify }, - index: { name: 'index_resource_weight_events_on_user_id' } - t.references :issue, null: false, foreign_key: { on_delete: :cascade }, - index: false - t.integer :weight - t.datetime_with_timezone :created_at, null: false - - t.index [:issue_id, :weight], name: 'index_resource_weight_events_on_issue_id_and_weight' - end - end -end diff --git a/db/migrate/20191212140117_change_commit_user_mentions_commit_id_column_type.rb b/db/migrate/20191212140117_change_commit_user_mentions_commit_id_column_type.rb deleted file mode 100644 index f205de3587e..00000000000 --- a/db/migrate/20191212140117_change_commit_user_mentions_commit_id_column_type.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -class ChangeCommitUserMentionsCommitIdColumnType < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - OLD_INDEX = 'commit_user_mentions_on_commit_id_and_note_id_index' - OLD_TMP_INDEX = 'temp_commit_id_and_note_id_index' - NEW_TMP_INDEX = 'temp_commit_id_for_type_change_and_note_id_index' - NEW_INDEX = 'commit_id_and_note_id_index' - - # rubocop:disable Migration/PreventStrings - def up - # the initial index name is too long and fails during migration. Renaming the index first. - add_concurrent_index :commit_user_mentions, [:commit_id, :note_id], name: OLD_TMP_INDEX - remove_concurrent_index_by_name :commit_user_mentions, OLD_INDEX - - change_column_type_concurrently :commit_user_mentions, :commit_id, :string - - # change_column_type_concurrently creates a new index for new column `commit_id_for_type` based on existing - # `temp_commit_id_and_note_id_index` naming it `temp_commit_id_for_type_change_and_note_id_index`, yet keeping - # `temp_commit_id_and_note_id_index` for `commit_id`, that will be cleaned - # by `cleanup_concurrent_column_type_change :commit_user_mentions, :commit_id` in a later migration. - # - # So we'll rename `temp_commit_id_for_type_change_and_note_id_index` to initialy intended name: `commit_id_and_note_id_index`. - - add_concurrent_index :commit_user_mentions, [:commit_id_for_type_change, :note_id], name: NEW_INDEX - remove_concurrent_index_by_name :commit_user_mentions, NEW_TMP_INDEX - end - # rubocop:enable Migration/PreventStrings - - def down - cleanup_concurrent_column_type_change :commit_user_mentions, :commit_id - end -end diff --git a/db/migrate/20191213104838_add_service_desk_username.rb b/db/migrate/20191213104838_add_service_desk_username.rb deleted file mode 100644 index d50de4c362c..00000000000 --- a/db/migrate/20191213104838_add_service_desk_username.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddServiceDeskUsername < ActiveRecord::Migration[5.2] - DOWNTIME = false - - # rubocop:disable Migration/PreventStrings - def change - add_column :service_desk_settings, :outgoing_name, :string, limit: 255 - end - # rubocop:enable Migration/PreventStrings -end diff --git a/db/migrate/20191213120427_fix_max_pages_size.rb b/db/migrate/20191213120427_fix_max_pages_size.rb deleted file mode 100644 index 498ea91b773..00000000000 --- a/db/migrate/20191213120427_fix_max_pages_size.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class FixMaxPagesSize < ActiveRecord::Migration[5.2] - DOWNTIME = false - MAX_SIZE = 1.terabyte / 1.megabyte - - class ApplicationSetting < ActiveRecord::Base - self.table_name = 'application_settings' - self.inheritance_column = :_type_disabled - end - - def up - table = ApplicationSetting.arel_table - ApplicationSetting.where(table[:max_pages_size].gt(MAX_SIZE)).update_all(max_pages_size: MAX_SIZE) - end - - def down - # no-op - end -end diff --git a/db/migrate/20191213143656_create_ci_pipelines_config.rb b/db/migrate/20191213143656_create_ci_pipelines_config.rb deleted file mode 100644 index a1821ee9f66..00000000000 --- a/db/migrate/20191213143656_create_ci_pipelines_config.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class CreateCiPipelinesConfig < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - create_table :ci_pipelines_config, id: false do |t| - t.references :pipeline, - primary_key: true, - foreign_key: { to_table: :ci_pipelines, on_delete: :cascade } - t.text :content, null: false # rubocop:disable Migration/AddLimitToTextColumns - end - end -end diff --git a/db/migrate/20191213184609_backfill_operations_feature_flags_active.rb b/db/migrate/20191213184609_backfill_operations_feature_flags_active.rb deleted file mode 100644 index cc61b30acae..00000000000 --- a/db/migrate/20191213184609_backfill_operations_feature_flags_active.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class BackfillOperationsFeatureFlagsActive < ActiveRecord::Migration[5.2] - DOWNTIME = false - - disable_ddl_transaction! - - class OperationsFeatureFlag < ActiveRecord::Base - self.table_name = 'operations_feature_flags' - self.inheritance_column = :_type_disabled - end - - def up - OperationsFeatureFlag.where(active: false).update_all(active: true) - end - - def down - # no-op - end -end diff --git a/db/migrate/20191214175727_add_indexes_to_deployments_on_project_id_and_ref.rb b/db/migrate/20191214175727_add_indexes_to_deployments_on_project_id_and_ref.rb deleted file mode 100644 index ea92f9cfd32..00000000000 --- a/db/migrate/20191214175727_add_indexes_to_deployments_on_project_id_and_ref.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddIndexesToDeploymentsOnProjectIdAndRef < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'partial_index_deployments_for_project_id_and_tag' - - disable_ddl_transaction! - - def up - add_concurrent_index :deployments, [:project_id, :ref] - add_concurrent_index :deployments, [:project_id], where: 'tag IS TRUE', name: INDEX_NAME - end - - def down - remove_concurrent_index :deployments, [:project_id, :ref] - remove_concurrent_index :deployments, [:project_id], where: 'tag IS TRUE', name: INDEX_NAME - end -end diff --git a/db/migrate/20191216074800_add_epic_date_sourcing_milestone_indexes.rb b/db/migrate/20191216074800_add_epic_date_sourcing_milestone_indexes.rb deleted file mode 100644 index 72fd5937331..00000000000 --- a/db/migrate/20191216074800_add_epic_date_sourcing_milestone_indexes.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class AddEpicDateSourcingMilestoneIndexes < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :epics, due_date_column - add_concurrent_index :epics, start_date_column - end - - def down - remove_concurrent_index :epics, start_date_column - remove_concurrent_index :epics, due_date_column - end - - private - - def due_date_column - :due_date_sourcing_milestone_id - end - - def start_date_column - :start_date_sourcing_milestone_id - end -end diff --git a/db/migrate/20191216074802_add_epic_start_date_sourcing_milestone_id_foreign_key.rb b/db/migrate/20191216074802_add_epic_start_date_sourcing_milestone_id_foreign_key.rb deleted file mode 100644 index 1c0713ec586..00000000000 --- a/db/migrate/20191216074802_add_epic_start_date_sourcing_milestone_id_foreign_key.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class AddEpicStartDateSourcingMilestoneIdForeignKey < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :epics, :milestones, column: start_date_column, on_delete: :nullify, validate: false - end - - def down - remove_foreign_key_if_exists :epics, column: start_date_column - end - - private - - def start_date_column - :start_date_sourcing_milestone_id - end -end diff --git a/db/migrate/20191216074803_add_epic_due_date_sourcing_milestone_id_foreign_key.rb b/db/migrate/20191216074803_add_epic_due_date_sourcing_milestone_id_foreign_key.rb deleted file mode 100644 index 51202e358cc..00000000000 --- a/db/migrate/20191216074803_add_epic_due_date_sourcing_milestone_id_foreign_key.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class AddEpicDueDateSourcingMilestoneIdForeignKey < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :epics, :milestones, column: due_date_column, on_delete: :nullify, validate: false - end - - def down - remove_foreign_key_if_exists :epics, column: due_date_column - end - - private - - def due_date_column - :due_date_sourcing_milestone_id - end -end diff --git a/db/migrate/20191216094119_add_id_to_plan_limits.rb b/db/migrate/20191216094119_add_id_to_plan_limits.rb deleted file mode 100644 index 05ebd900df3..00000000000 --- a/db/migrate/20191216094119_add_id_to_plan_limits.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddIdToPlanLimits < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - add_column(:plan_limits, :id, :primary_key) unless column_exists?(:plan_limits, :id) - end - - def down - remove_column(:plan_limits, :id) - end -end diff --git a/db/migrate/20191216183531_add_project_hooks_to_plan_limits.rb b/db/migrate/20191216183531_add_project_hooks_to_plan_limits.rb deleted file mode 100644 index c56b6edf029..00000000000 --- a/db/migrate/20191216183531_add_project_hooks_to_plan_limits.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddProjectHooksToPlanLimits < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column(:plan_limits, :project_hooks, :integer, default: 0, null: false) - end -end diff --git a/db/migrate/20191216183532_insert_project_hooks_plan_limits.rb b/db/migrate/20191216183532_insert_project_hooks_plan_limits.rb deleted file mode 100644 index b2c0121dd24..00000000000 --- a/db/migrate/20191216183532_insert_project_hooks_plan_limits.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class InsertProjectHooksPlanLimits < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - return unless Gitlab.com? - - create_or_update_plan_limit('project_hooks', 'free', 10) - create_or_update_plan_limit('project_hooks', 'bronze', 20) - create_or_update_plan_limit('project_hooks', 'silver', 30) - create_or_update_plan_limit('project_hooks', 'gold', 100) - end - - def down - return unless Gitlab.com? - - create_or_update_plan_limit('project_hooks', 'free', 0) - create_or_update_plan_limit('project_hooks', 'bronze', 0) - create_or_update_plan_limit('project_hooks', 'silver', 0) - create_or_update_plan_limit('project_hooks', 'gold', 0) - end -end diff --git a/db/migrate/20191217165641_add_saml_provider_prohibited_outer_forks.rb b/db/migrate/20191217165641_add_saml_provider_prohibited_outer_forks.rb deleted file mode 100644 index 4b528578848..00000000000 --- a/db/migrate/20191217165641_add_saml_provider_prohibited_outer_forks.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddSamlProviderProhibitedOuterForks < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default :saml_providers, :prohibited_outer_forks, :boolean, default: false, allow_null: true # rubocop:disable Migration/AddColumnWithDefault - end - - def down - remove_column :saml_providers, :prohibited_outer_forks - end -end diff --git a/db/migrate/20191217212348_add_modsecurity_enabled_to_ingress_application.rb b/db/migrate/20191217212348_add_modsecurity_enabled_to_ingress_application.rb deleted file mode 100644 index 2690a5762dd..00000000000 --- a/db/migrate/20191217212348_add_modsecurity_enabled_to_ingress_application.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddModsecurityEnabledToIngressApplication < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - add_column :clusters_applications_ingress, :modsecurity_enabled, :boolean - end - - def down - remove_column :clusters_applications_ingress, :modsecurity_enabled - end -end diff --git a/db/migrate/20191218084115_add_updating_name_disabled_for_users_to_application_settings.rb b/db/migrate/20191218084115_add_updating_name_disabled_for_users_to_application_settings.rb deleted file mode 100644 index d0b2e53650b..00000000000 --- a/db/migrate/20191218084115_add_updating_name_disabled_for_users_to_application_settings.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddUpdatingNameDisabledForUsersToApplicationSettings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_column_with_default(:application_settings, :updating_name_disabled_for_users, # rubocop:disable Migration/AddColumnWithDefault - :boolean, - default: false, - allow_null: false) - end - - def down - remove_column(:application_settings, :updating_name_disabled_for_users) - end -end diff --git a/db/migrate/20191218122457_add_force_pages_access_control_to_application_settings.rb b/db/migrate/20191218122457_add_force_pages_access_control_to_application_settings.rb deleted file mode 100644 index 97352fc98ff..00000000000 --- a/db/migrate/20191218122457_add_force_pages_access_control_to_application_settings.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddForcePagesAccessControlToApplicationSettings < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column :application_settings, :force_pages_access_control, :boolean, null: false, default: false - end -end diff --git a/db/migrate/20191218124915_add_repository_storage_to_snippets.rb b/db/migrate/20191218124915_add_repository_storage_to_snippets.rb deleted file mode 100644 index e2ba11aef20..00000000000 --- a/db/migrate/20191218124915_add_repository_storage_to_snippets.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class AddRepositoryStorageToSnippets < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - # rubocop:disable Migration/PreventStrings - def up - add_column_with_default( # rubocop:disable Migration/AddColumnWithDefault - :snippets, - :repository_storage, - :string, - default: 'default', - limit: 255, - allow_null: false - ) - end - # rubocop:enable Migration/PreventStrings - - def down - remove_column(:snippets, :repository_storage) - end -end diff --git a/db/migrate/20191218125015_add_storage_version_to_snippets.rb b/db/migrate/20191218125015_add_storage_version_to_snippets.rb deleted file mode 100644 index b1bd3589692..00000000000 --- a/db/migrate/20191218125015_add_storage_version_to_snippets.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class AddStorageVersionToSnippets < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - disable_ddl_transaction! - - def up - add_column_with_default( # rubocop:disable Migration/AddColumnWithDefault - :snippets, - :storage_version, - :integer, - default: 2, - allow_null: false - ) - end - - def down - remove_column(:snippets, :storage_version) - end -end diff --git a/db/migrate/20191218190253_add_tab_width_to_user_preferences.rb b/db/migrate/20191218190253_add_tab_width_to_user_preferences.rb deleted file mode 100644 index b03dd8f76b9..00000000000 --- a/db/migrate/20191218190253_add_tab_width_to_user_preferences.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddTabWidthToUserPreferences < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - add_column(:user_preferences, :tab_width, :integer, limit: 2) - end -end diff --git a/db/migrate/20191223124940_add_scheduling_type_to_ci_builds.rb b/db/migrate/20191223124940_add_scheduling_type_to_ci_builds.rb deleted file mode 100644 index bb849aa8a95..00000000000 --- a/db/migrate/20191223124940_add_scheduling_type_to_ci_builds.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddSchedulingTypeToCiBuilds < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - add_column :ci_builds, :scheduling_type, :integer, limit: 2 # rubocop:disable Migration/AddColumnsToWideTables - end -end diff --git a/db/migrate/20191225071320_add_index_to_elasticsearch_indexed_namespaces.rb b/db/migrate/20191225071320_add_index_to_elasticsearch_indexed_namespaces.rb deleted file mode 100644 index 758838cb775..00000000000 --- a/db/migrate/20191225071320_add_index_to_elasticsearch_indexed_namespaces.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToElasticsearchIndexedNamespaces < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index(:elasticsearch_indexed_namespaces, :created_at) - end - - def down - remove_concurrent_index(:elasticsearch_indexed_namespaces, :created_at) - end -end diff --git a/db/migrate/20191227140254_update_personal_access_tokens_user_id_foreign_key.rb b/db/migrate/20191227140254_update_personal_access_tokens_user_id_foreign_key.rb deleted file mode 100644 index fbf17b28274..00000000000 --- a/db/migrate/20191227140254_update_personal_access_tokens_user_id_foreign_key.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class UpdatePersonalAccessTokensUserIdForeignKey < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - CONSTRAINT_NAME = 'fk_personal_access_tokens_user_id' - - disable_ddl_transaction! - - def up - add_concurrent_foreign_key(:personal_access_tokens, :users, column: :user_id, on_delete: :cascade, name: CONSTRAINT_NAME) - remove_foreign_key_if_exists(:personal_access_tokens, column: :user_id, on_delete: nil) - end - - def down - add_concurrent_foreign_key(:personal_access_tokens, :users, column: :user_id, on_delete: nil) - remove_foreign_key_if_exists(:personal_access_tokens, column: :user_id, on_delete: :cascade, name: CONSTRAINT_NAME) - end -end diff --git a/db/migrate/20191229140154_drop_index_ci_pipelines_on_project_id.rb b/db/migrate/20191229140154_drop_index_ci_pipelines_on_project_id.rb deleted file mode 100644 index 9e78457b007..00000000000 --- a/db/migrate/20191229140154_drop_index_ci_pipelines_on_project_id.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class DropIndexCiPipelinesOnProjectId < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name :ci_pipelines, 'index_ci_pipelines_on_project_id' - - # extra (duplicate) index that already existed on some installs - remove_concurrent_index_by_name :ci_pipelines, 'ci_pipelines_project_id_idx' - end - - def down - add_concurrent_index :ci_pipelines, :project_id, name: 'index_ci_pipelines_on_project_id' - end -end diff --git a/db/post_migrate/20190102152410_delete_inconsistent_internal_id_records2.rb b/db/post_migrate/20190102152410_delete_inconsistent_internal_id_records2.rb deleted file mode 100644 index ddcddcf72a3..00000000000 --- a/db/post_migrate/20190102152410_delete_inconsistent_internal_id_records2.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true -class DeleteInconsistentInternalIdRecords2 < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - # This migration cleans up any inconsistent records in internal_ids. - # - # That is, it deletes records that track a `last_value` that is - # smaller than the maximum internal id (usually `iid`) found in - # the corresponding model records. - - def up - disable_statement_timeout do - delete_internal_id_records('milestones', 'project_id') - delete_internal_id_records('milestones', 'namespace_id', 'group_id') - end - end - - class InternalId < ActiveRecord::Base - self.table_name = 'internal_ids' - enum usage: { issues: 0, merge_requests: 1, deployments: 2, milestones: 3, epics: 4, ci_pipelines: 5 } - end - - private - - def delete_internal_id_records(base_table, scope_column_name, base_scope_column_name = scope_column_name) - sql = <<~SQL - SELECT id FROM ( -- workaround for MySQL - SELECT internal_ids.id FROM ( - SELECT #{base_scope_column_name} AS #{scope_column_name}, max(iid) as maximum_iid from #{base_table} GROUP BY #{scope_column_name} - ) maxima JOIN internal_ids USING (#{scope_column_name}) - WHERE internal_ids.usage=#{InternalId.usages.fetch(base_table)} AND maxima.maximum_iid > internal_ids.last_value - ) internal_ids - SQL - - InternalId.where("id IN (#{sql})").tap do |ids| # rubocop:disable GitlabSecurity/SqlInjection - say "Deleting internal_id records for #{base_table}: #{ids.map { |i| [i.project_id, i.last_value] }}" unless ids.empty? - end.delete_all - end -end diff --git a/db/post_migrate/20190115054215_migrate_delete_container_repository_worker.rb b/db/post_migrate/20190115054215_migrate_delete_container_repository_worker.rb deleted file mode 100644 index 4fcee326b7e..00000000000 --- a/db/post_migrate/20190115054215_migrate_delete_container_repository_worker.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class MigrateDeleteContainerRepositoryWorker < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - sidekiq_queue_migrate('delete_container_repository', to: 'container_repository:delete_container_repository') - end - - def down - sidekiq_queue_migrate('container_repository:delete_container_repository', to: 'delete_container_repository') - end -end diff --git a/db/post_migrate/20190124200344_migrate_storage_migrator_sidekiq_queue.rb b/db/post_migrate/20190124200344_migrate_storage_migrator_sidekiq_queue.rb deleted file mode 100644 index 193bd571831..00000000000 --- a/db/post_migrate/20190124200344_migrate_storage_migrator_sidekiq_queue.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class MigrateStorageMigratorSidekiqQueue < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - sidekiq_queue_migrate 'storage_migrator', to: 'hashed_storage:hashed_storage_migrator' - end - - def down - sidekiq_queue_migrate 'hashed_storage:hashed_storage_migrator', to: 'storage_migrator' - end -end diff --git a/db/post_migrate/20190131122559_fix_null_type_labels.rb b/db/post_migrate/20190131122559_fix_null_type_labels.rb deleted file mode 100644 index 83bb613990c..00000000000 --- a/db/post_migrate/20190131122559_fix_null_type_labels.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class FixNullTypeLabels < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - update_column_in_batches(:labels, :type, 'ProjectLabel') do |table, query| - query.where( - table[:project_id].not_eq(nil) - .and(table[:template].eq(false)) - .and(table[:type].eq(nil)) - ) - end - end - - def down - # no action - end -end diff --git a/db/post_migrate/20190204115450_migrate_auto_dev_ops_domain_to_cluster_domain.rb b/db/post_migrate/20190204115450_migrate_auto_dev_ops_domain_to_cluster_domain.rb deleted file mode 100644 index 036b0b64b48..00000000000 --- a/db/post_migrate/20190204115450_migrate_auto_dev_ops_domain_to_cluster_domain.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class MigrateAutoDevOpsDomainToClusterDomain < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - execute(update_clusters_domain_query) - end - - def down - # no-op - end - - private - - def update_clusters_domain_query - <<~HEREDOC - UPDATE clusters - SET domain = project_auto_devops.domain - FROM cluster_projects, project_auto_devops - WHERE - cluster_projects.cluster_id = clusters.id - AND project_auto_devops.project_id = cluster_projects.project_id - AND project_auto_devops.domain != '' - HEREDOC - end -end diff --git a/db/post_migrate/20190214112022_schedule_sync_issuables_state_id.rb b/db/post_migrate/20190214112022_schedule_sync_issuables_state_id.rb deleted file mode 100644 index de062937fbe..00000000000 --- a/db/post_migrate/20190214112022_schedule_sync_issuables_state_id.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -class ScheduleSyncIssuablesStateId < ActiveRecord::Migration[5.0] - # This migration schedules the sync of state_id for issues and merge requests - # which are converting the state column from string to integer. - # For more information check: https://gitlab.com/gitlab-org/gitlab-foss/issues/51789 - - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # 2019-02-12 gitlab.com issuable numbers - # issues count: 13587305 - # merge requests count: 18925274 - # - # Using 5000 as batch size and 115 seconds interval will give: - # 2718 jobs for issues - taking ~86 hours - # 3786 jobs for merge requests - taking ~120 hours - # - BATCH_SIZE = 5000 - DELAY_INTERVAL = 120.seconds.to_i - ISSUES_MIGRATION = 'SyncIssuesStateId' - MERGE_REQUESTS_MIGRATION = 'SyncMergeRequestsStateId' - - disable_ddl_transaction! - - class Issue < ActiveRecord::Base - include EachBatch - - self.table_name = 'issues' - end - - class MergeRequest < ActiveRecord::Base - include EachBatch - - self.table_name = 'merge_requests' - end - - def up - queue_background_migration_jobs_by_range_at_intervals( - Issue.all, - ISSUES_MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE - ) - - queue_background_migration_jobs_by_range_at_intervals( - MergeRequest.all, - MERGE_REQUESTS_MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE - ) - end - - def down - # No op - end -end diff --git a/db/post_migrate/20190301081611_migrate_project_migrate_sidekiq_queue.rb b/db/post_migrate/20190301081611_migrate_project_migrate_sidekiq_queue.rb deleted file mode 100644 index 46108d142b5..00000000000 --- a/db/post_migrate/20190301081611_migrate_project_migrate_sidekiq_queue.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class MigrateProjectMigrateSidekiqQueue < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - sidekiq_queue_migrate 'project_migrate_hashed_storage', to: 'hashed_storage:hashed_storage_project_migrate' - end - - def down - sidekiq_queue_migrate 'hashed_storage:hashed_storage_project_migrate', to: 'project_migrate_hashed_storage' - end -end diff --git a/db/post_migrate/20190313092516_clean_up_noteable_id_for_notes_on_commits.rb b/db/post_migrate/20190313092516_clean_up_noteable_id_for_notes_on_commits.rb deleted file mode 100644 index fcd63f42b0e..00000000000 --- a/db/post_migrate/20190313092516_clean_up_noteable_id_for_notes_on_commits.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class CleanUpNoteableIdForNotesOnCommits < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - TEMP_INDEX_NAME = 'index_notes_on_commit_with_null_noteable_id' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name(:notes, TEMP_INDEX_NAME) - - add_concurrent_index(:notes, :id, where: "noteable_type = 'Commit' AND noteable_id IS NOT NULL", name: TEMP_INDEX_NAME) - - # rubocop:disable Migration/UpdateLargeTable - update_column_in_batches(:notes, :noteable_id, nil, batch_size: 300) do |table, query| - query.where( - table[:noteable_type].eq('Commit').and(table[:noteable_id].not_eq(nil)) - ) - end - - remove_concurrent_index_by_name(:notes, TEMP_INDEX_NAME) - end - - def down - end -end diff --git a/db/post_migrate/20190322132835_schedule_populate_merge_request_assignees_table.rb b/db/post_migrate/20190322132835_schedule_populate_merge_request_assignees_table.rb deleted file mode 100644 index 1ecb38e1a86..00000000000 --- a/db/post_migrate/20190322132835_schedule_populate_merge_request_assignees_table.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class SchedulePopulateMergeRequestAssigneesTable < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - BATCH_SIZE = 10_000 - MIGRATION = 'PopulateMergeRequestAssigneesTable' - DELAY_INTERVAL = 8.minutes.to_i - - disable_ddl_transaction! - - def up - say 'Scheduling `PopulateMergeRequestAssigneesTable` jobs' - # We currently have ~4_500_000 merge request records on GitLab.com. - # This means it'll schedule ~450 jobs (10k MRs each) with a 8 minutes gap, - # so this should take ~60 hours for all background migrations to complete. - queue_background_migration_jobs_by_range_at_intervals(MergeRequest, MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) - end -end diff --git a/db/post_migrate/20190325111602_rename_v2_root_namespaces.rb b/db/post_migrate/20190325111602_rename_v2_root_namespaces.rb deleted file mode 100644 index 8571bb82fa0..00000000000 --- a/db/post_migrate/20190325111602_rename_v2_root_namespaces.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class RenameV2RootNamespaces < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - include Gitlab::Database::RenameReservedPathsMigration::V1 - - DOWNTIME = false - - disable_ddl_transaction! - - # We're taking over the /v2 namespace as it necessary for Docker client to - # work with GitLab as Dependency proxy for containers. - def up - disable_statement_timeout do - rename_root_paths 'v2' - end - end - - def down - disable_statement_timeout do - revert_renames - end - end -end diff --git a/db/post_migrate/20190404143330_add_unique_constraint_to_approvals_user_id_and_merge_request_id.rb b/db/post_migrate/20190404143330_add_unique_constraint_to_approvals_user_id_and_merge_request_id.rb deleted file mode 100644 index dd85ebc8001..00000000000 --- a/db/post_migrate/20190404143330_add_unique_constraint_to_approvals_user_id_and_merge_request_id.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -class AddUniqueConstraintToApprovalsUserIdAndMergeRequestId < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - remove_duplicates - add_concurrent_index :approvals, [:user_id, :merge_request_id], unique: true - end - - def down - remove_concurrent_index :approvals, [:user_id, :merge_request_id] - end - - private - - def remove_duplicates - add_concurrent_index :approvals, [:user_id, :merge_request_id, :id] - - execute <<-SQL - DELETE FROM approvals - USING ( - SELECT user_id, merge_request_id, MIN(id) as min_id - FROM approvals - GROUP BY user_id, merge_request_id - HAVING COUNT(id) > 1 - ) as approvals_with_duplicates - WHERE approvals_with_duplicates.user_id = approvals.user_id - AND approvals_with_duplicates.merge_request_id = approvals.merge_request_id - AND approvals_with_duplicates.min_id <> approvals.id; - SQL - - remove_concurrent_index :approvals, [:user_id, :merge_request_id, :id] - end -end diff --git a/db/post_migrate/20190404231137_remove_alternate_url_from_geo_nodes.rb b/db/post_migrate/20190404231137_remove_alternate_url_from_geo_nodes.rb deleted file mode 100644 index 785ceb2fb28..00000000000 --- a/db/post_migrate/20190404231137_remove_alternate_url_from_geo_nodes.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -# We are reverting the feature that created this column. This is for anyone who -# migrated while the feature still existed in master. -class RemoveAlternateUrlFromGeoNodes < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def up - remove_column(:geo_nodes, :alternate_url) if column_exists?(:geo_nodes, :alternate_url) - end - - def down - add_column :geo_nodes, :alternate_url, :string - end -end diff --git a/db/post_migrate/20190418132125_populate_project_statistics_packages_size.rb b/db/post_migrate/20190418132125_populate_project_statistics_packages_size.rb deleted file mode 100644 index a6bee3453c1..00000000000 --- a/db/post_migrate/20190418132125_populate_project_statistics_packages_size.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -class PopulateProjectStatisticsPackagesSize < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - class ProjectStatistics < ActiveRecord::Base - self.table_name = 'project_statistics' - end - - def up - stats_ids = ProjectStatistics.joins( - <<~SQL.strip_heredoc - INNER JOIN projects ON projects.id = project_statistics.project_id - INNER JOIN packages_packages ON packages_packages.project_id = projects.id - INNER JOIN packages_package_files ON packages_package_files.package_id = packages_packages.id - SQL - ).distinct.select(:id) - - packages_size = Arel.sql( - '(SELECT SUM(size) FROM packages_package_files ' \ - 'JOIN packages_packages ON packages_packages.id = packages_package_files.package_id ' \ - 'WHERE packages_packages.project_id = project_statistics.project_id)' - ) - update_column_in_batches(:project_statistics, :packages_size, packages_size) do |table, query| - query.where(table[:id].in(stats_ids)) - end - - storage_size = Arel.sql('(repository_size + lfs_objects_size + build_artifacts_size + COALESCE(packages_size, 0))') - update_column_in_batches(:project_statistics, :storage_size, storage_size) do |table, query| - query.where(table[:id].in(stats_ids)) - end - end - - def down - storage_size = Arel.sql('(repository_size + lfs_objects_size + build_artifacts_size)') - update_column_in_batches(:project_statistics, :storage_size, storage_size) do |table, query| - query.where(table[:packages_size].gt(0)) - end - - update_column_in_batches(:project_statistics, :packages_size, nil) - end -end diff --git a/db/post_migrate/20190424134256_drop_projects_ci_id.rb b/db/post_migrate/20190424134256_drop_projects_ci_id.rb deleted file mode 100644 index 223e9fd4a94..00000000000 --- a/db/post_migrate/20190424134256_drop_projects_ci_id.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class DropProjectsCiId < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - def up - if index_exists?(:projects, :ci_id) - remove_concurrent_index :projects, :ci_id - end - - if column_exists?(:projects, :ci_id) - remove_column :projects, :ci_id - end - end - - def down - unless column_exists?(:projects, :ci_id) - add_column :projects, :ci_id, :integer # rubocop:disable Migration/AddColumnsToWideTables - end - - unless index_exists?(:projects, :ci_id) - add_concurrent_index :projects, :ci_id - end - end -end diff --git a/db/post_migrate/20190506135400_schedule_sync_issuables_state_id_where_nil.rb b/db/post_migrate/20190506135400_schedule_sync_issuables_state_id_where_nil.rb deleted file mode 100644 index 845c855358b..00000000000 --- a/db/post_migrate/20190506135400_schedule_sync_issuables_state_id_where_nil.rb +++ /dev/null @@ -1,63 +0,0 @@ -# frozen_string_literal: true - -class ScheduleSyncIssuablesStateIdWhereNil < ActiveRecord::Migration[5.1] - # Issues and MergeRequests imported by GitHub are being created with - # state_id = null, this fixes them. - # - # Part of a bigger plan: https://gitlab.com/gitlab-org/gitlab-foss/issues/51789 - - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - # 2019-05-02 gitlab.com issuable numbers - # issues with state_id nil: ~40000 - # merge requests with state_id nil: ~200000 - # - # Using 5000 as batch size and 120 seconds interval will create: - # ~8 jobs for issues - taking ~16 minutes - # ~40 jobs for merge requests - taking ~1.34 hours - # - BATCH_SIZE = 5000 - DELAY_INTERVAL = 120.seconds.to_i - ISSUES_MIGRATION = 'SyncIssuesStateId' - MERGE_REQUESTS_MIGRATION = 'SyncMergeRequestsStateId' - - disable_ddl_transaction! - - class Issue < ActiveRecord::Base - include EachBatch - - self.table_name = 'issues' - end - - class MergeRequest < ActiveRecord::Base - include EachBatch - - self.table_name = 'merge_requests' - end - - def up - queue_background_migration_jobs_by_range_at_intervals( - Issue.where(state_id: nil), - ISSUES_MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE - ) - - queue_background_migration_jobs_by_range_at_intervals( - MergeRequest.where(state_id: nil), - MERGE_REQUESTS_MIGRATION, - DELAY_INTERVAL, - batch_size: BATCH_SIZE - ) - - # Remove temporary indexes added on "AddTemporaryIndexesToStateId" - remove_concurrent_index_by_name(:issues, "idx_on_issues_where_state_id_is_null") - remove_concurrent_index_by_name(:merge_requests, "idx_on_merge_requests_where_state_id_is_null") - end - - def down - # No op - end -end diff --git a/db/post_migrate/20190511144331_remove_users_support_type.rb b/db/post_migrate/20190511144331_remove_users_support_type.rb deleted file mode 100644 index e72fbb229b8..00000000000 --- a/db/post_migrate/20190511144331_remove_users_support_type.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class RemoveUsersSupportType < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - INDEX_STATE_INTERNAL_ATTRS = 'index_users_on_state_and_internal_attrs' - - disable_ddl_transaction! - - def up - remove_concurrent_index :users, :state, name: INDEX_STATE_INTERNAL_ATTRS - remove_concurrent_index :users, :support_bot - - remove_column :users, :support_bot - end - - def down - add_column :users, :support_bot, :boolean # rubocop:disable Migration/AddColumnsToWideTables - - add_concurrent_index :users, :support_bot - add_concurrent_index :users, :state, - name: INDEX_STATE_INTERNAL_ATTRS, - where: 'ghost <> true AND support_bot <> true' - end -end diff --git a/db/post_migrate/20190517153211_migrate_k8s_service_integration.rb b/db/post_migrate/20190517153211_migrate_k8s_service_integration.rb deleted file mode 100644 index 0b409cd2866..00000000000 --- a/db/post_migrate/20190517153211_migrate_k8s_service_integration.rb +++ /dev/null @@ -1,104 +0,0 @@ -# frozen_string_literal: true - -class MigrateK8sServiceIntegration < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - class Cluster < ActiveRecord::Base - self.table_name = 'clusters' - - has_one :platform_kubernetes, class_name: 'MigrateK8sServiceIntegration::PlatformsKubernetes' - - accepts_nested_attributes_for :platform_kubernetes - - enum cluster_type: { - instance_type: 1, - group_type: 2, - project_type: 3 - } - - enum platform_type: { - kubernetes: 1 - } - - enum provider_type: { - user: 0, - gcp: 1 - } - end - - class PlatformsKubernetes < ActiveRecord::Base - self.table_name = 'cluster_platforms_kubernetes' - - belongs_to :cluster, class_name: 'MigrateK8sServiceIntegration::Cluster' - - attr_encrypted :token, - mode: :per_attribute_iv, - key: Settings.attr_encrypted_db_key_base_truncated, - algorithm: 'aes-256-cbc' - end - - class Service < ActiveRecord::Base - include EachBatch - - self.table_name = 'services' - self.inheritance_column = :_type_disabled # Disable STI, otherwise KubernetesModel will be looked up - - belongs_to :project, class_name: 'MigrateK8sServiceIntegration::Project', foreign_key: :project_id - - scope :kubernetes_service_templates, -> do - where(category: 'deployment', type: 'KubernetesService', template: true) - end - - def api_url - parsed_properties['api_url'].presence - end - - def ca_pem - parsed_properties['ca_pem'] - end - - def namespace - parsed_properties['namespace'].presence - end - - def token - parsed_properties['token'].presence - end - - private - - def parsed_properties - @parsed_properties ||= JSON.parse(self.properties) # rubocop:disable Gitlab/Json - end - end - - def up - has_instance_cluster = Cluster.instance_type.where(enabled: true).exists? - - MigrateK8sServiceIntegration::Service.kubernetes_service_templates.find_each do |service| - next unless service.api_url && service.token - - MigrateK8sServiceIntegration::Cluster.create!( - enabled: !has_instance_cluster && service.active, - managed: false, - name: 'KubernetesService', - cluster_type: 'instance_type', - provider_type: 'user', - platform_type: 'kubernetes', - platform_kubernetes_attributes: { - api_url: service.api_url, - ca_cert: service.ca_pem, - namespace: service.namespace, - token: service.token - } - ) - end - end - - def down - # It is not possible to tell which instance-level clusters were created by - # this migration. The original data is intentionally left intact. - end -end diff --git a/db/post_migrate/20190520201748_populate_rule_type_on_approval_merge_request_rules.rb b/db/post_migrate/20190520201748_populate_rule_type_on_approval_merge_request_rules.rb deleted file mode 100644 index 0f0df456134..00000000000 --- a/db/post_migrate/20190520201748_populate_rule_type_on_approval_merge_request_rules.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class PopulateRuleTypeOnApprovalMergeRequestRules < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - class ApprovalMergeRequestRule < ActiveRecord::Base - include EachBatch - - enum rule_types: { - regular: 1, - code_owner: 2 - } - end - - def up - # On Gitlab.com, this should update about 17k rows. Since our updates are - # small and we are populating prior to indexing, the overhead should be small - ApprovalMergeRequestRule.where(code_owner: true).each_batch do |batch| - batch.update_all(rule_type: ApprovalMergeRequestRule.rule_types[:code_owner]) - end - end - - def down - # code_owner is already kept in sync with `rule_type`, so no changes are needed - end -end diff --git a/db/post_migrate/20190522143720_drop_project_auto_devops_domain.rb b/db/post_migrate/20190522143720_drop_project_auto_devops_domain.rb deleted file mode 100644 index 36278d83927..00000000000 --- a/db/post_migrate/20190522143720_drop_project_auto_devops_domain.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class DropProjectAutoDevopsDomain < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def change - remove_column :project_auto_devops, :domain, :string - end -end diff --git a/db/post_migrate/20190524073827_schedule_fill_valid_time_for_pages_domain_certificates.rb b/db/post_migrate/20190524073827_schedule_fill_valid_time_for_pages_domain_certificates.rb deleted file mode 100644 index 1d8510e4514..00000000000 --- a/db/post_migrate/20190524073827_schedule_fill_valid_time_for_pages_domain_certificates.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class ScheduleFillValidTimeForPagesDomainCertificates < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - MIGRATION = 'FillValidTimeForPagesDomainCertificate' - BATCH_SIZE = 500 - BATCH_TIME = 5.minutes - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - disable_ddl_transaction! - - class PagesDomain < ActiveRecord::Base - include ::EachBatch - - self.table_name = 'pages_domains' - end - - def up - queue_background_migration_jobs_by_range_at_intervals( - PagesDomain.where.not(certificate: [nil, '']), - MIGRATION, - BATCH_TIME, - batch_size: BATCH_SIZE) - end - - def down - end -end diff --git a/db/post_migrate/20190527194900_schedule_calculate_wiki_sizes.rb b/db/post_migrate/20190527194900_schedule_calculate_wiki_sizes.rb deleted file mode 100644 index f337390f10c..00000000000 --- a/db/post_migrate/20190527194900_schedule_calculate_wiki_sizes.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class ScheduleCalculateWikiSizes < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - MIGRATION = 'CalculateWikiSizes' - BATCH_SIZE = 100000 - BATCH_TIME = 5.minutes - - class ProjectStatistics < ActiveRecord::Base - self.table_name = 'project_statistics' - - scope :without_wiki_size, -> { where(wiki_size: nil) } - - include ::EachBatch - end - - disable_ddl_transaction! - - # Disabling this old migration because it should already run - # in 14.0. This will allow us to remove some `technical debt` - # in ProjectStatistics model, because of some columns - # not present by the time the migration is run. - def up - # no-op - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20190528180441_enqueue_reset_merge_status.rb b/db/post_migrate/20190528180441_enqueue_reset_merge_status.rb deleted file mode 100644 index a3d2f497806..00000000000 --- a/db/post_migrate/20190528180441_enqueue_reset_merge_status.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class EnqueueResetMergeStatus < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - BATCH_SIZE = 10_000 - MIGRATION = 'ResetMergeStatus' - DELAY_INTERVAL = 5.minutes.to_i - - disable_ddl_transaction! - - def up - say 'Scheduling `ResetMergeStatus` jobs' - - # We currently have more than ~5_000_000 merge request records on GitLab.com. - # This means it'll schedule ~500 jobs (10k MRs each) with a 5 minutes gap, - # so this should take ~41 hours for all background migrations to complete. - # ((5_000_000 / 10_000) * 5) / 60 => 41.6666.. - queue_background_migration_jobs_by_range_at_intervals(MergeRequest, MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) - end -end diff --git a/db/post_migrate/20190606163724_migrate_legacy_managed_clusters_to_unmanaged.rb b/db/post_migrate/20190606163724_migrate_legacy_managed_clusters_to_unmanaged.rb deleted file mode 100644 index 759ab939f7d..00000000000 --- a/db/post_migrate/20190606163724_migrate_legacy_managed_clusters_to_unmanaged.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class MigrateLegacyManagedClustersToUnmanaged < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - class Cluster < ActiveRecord::Base - include EachBatch - - self.table_name = 'clusters' - - has_many :kubernetes_namespaces, class_name: 'MigrateLegacyManagedClustersToUnmanaged::KubernetesNamespace' - - scope :managed, -> { where(managed: true) } - - enum cluster_type: { - instance_type: 1, - group_type: 2, - project_type: 3 - } - end - - class KubernetesNamespace < ActiveRecord::Base - self.table_name = 'clusters_kubernetes_namespaces' - - belongs_to :cluster, class_name: 'MigrateLegacyManagedClustersToUnmanaged::Cluster' - end - - def up - Cluster.managed - .project_type - .left_joins(:kubernetes_namespaces) - .where(clusters_kubernetes_namespaces: { cluster_id: nil }) - .where('clusters.created_at < ?', 5.minutes.ago) - .each_batch do |batch| - batch.update_all(managed: false) - end - end - - def down - end -end diff --git a/db/post_migrate/20190606175050_encrypt_feature_flags_clients_tokens.rb b/db/post_migrate/20190606175050_encrypt_feature_flags_clients_tokens.rb deleted file mode 100644 index b8df41767f0..00000000000 --- a/db/post_migrate/20190606175050_encrypt_feature_flags_clients_tokens.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class EncryptFeatureFlagsClientsTokens < ActiveRecord::Migration[5.1] - DOWNTIME = false - - class FeatureFlagsClient < ActiveRecord::Base - self.table_name = 'operations_feature_flags_clients' - end - - def up - say_with_time("Encrypting tokens from operations_feature_flags_clients") do - FeatureFlagsClient.where('token_encrypted is NULL AND token IS NOT NULL').find_each do |feature_flags_client| - token_encrypted = Gitlab::CryptoHelper.aes256_gcm_encrypt(feature_flags_client.token, nonce: Gitlab::CryptoHelper::AES256_GCM_IV_STATIC) - feature_flags_client.update!(token_encrypted: token_encrypted) - end - end - end - - def down - say_with_time("Decrypting tokens from operations_feature_flags_clients") do - FeatureFlagsClient.where('token_encrypted IS NOT NULL AND token IS NULL').find_each do |feature_flags_client| - token = Gitlab::CryptoHelper.aes256_gcm_decrypt(feature_flags_client.token_encrypted) - feature_flags_client.update!(token: token) - end - end - end -end diff --git a/db/post_migrate/20190611161642_add_index_to_events_and_audit_events_created_at_author_id.rb b/db/post_migrate/20190611161642_add_index_to_events_and_audit_events_created_at_author_id.rb deleted file mode 100644 index 5b9afbe128c..00000000000 --- a/db/post_migrate/20190611161642_add_index_to_events_and_audit_events_created_at_author_id.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class AddIndexToEventsAndAuditEventsCreatedAtAuthorId < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'analytics_index_%s_on_created_at_and_author_id' - EVENTS_INDEX_NAME = (INDEX_NAME % 'events') - AUDIT_EVENTS_INDEX_NAME = (INDEX_NAME % 'audit_events') - - disable_ddl_transaction! - - def up - add_concurrent_index :events, [:created_at, :author_id], name: EVENTS_INDEX_NAME - add_concurrent_index :audit_events, [:created_at, :author_id], name: AUDIT_EVENTS_INDEX_NAME - end - - def down - remove_concurrent_index_by_name :events, EVENTS_INDEX_NAME - remove_concurrent_index_by_name :audit_events, AUDIT_EVENTS_INDEX_NAME - end -end diff --git a/db/post_migrate/20190613231640_migrate_managed_clusters_with_no_token_to_unmanaged.rb b/db/post_migrate/20190613231640_migrate_managed_clusters_with_no_token_to_unmanaged.rb deleted file mode 100644 index b2914afe2cd..00000000000 --- a/db/post_migrate/20190613231640_migrate_managed_clusters_with_no_token_to_unmanaged.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class MigrateManagedClustersWithNoTokenToUnmanaged < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - class Cluster < ActiveRecord::Base - include EachBatch - - self.table_name = 'clusters' - - has_many :kubernetes_namespaces, class_name: 'MigrateManagedClustersWithNoTokenToUnmanaged::KubernetesNamespace' - - scope :managed, -> { where(managed: true) } - - enum cluster_type: { - instance_type: 1, - group_type: 2, - project_type: 3 - } - end - - class KubernetesNamespace < ActiveRecord::Base - self.table_name = 'clusters_kubernetes_namespaces' - - belongs_to :cluster, class_name: 'MigrateManagedClustersWithNoTokenToUnmanaged::Cluster' - end - - def up - Cluster.managed - .project_type - .joins(:kubernetes_namespaces) - .where(clusters_kubernetes_namespaces: { encrypted_service_account_token: nil }) - .where('clusters.created_at < ?', Date.new(2018, 12, 1).midnight) - .each_batch do |batch| - batch.update_all(managed: false) - end - end - - def down - end -end diff --git a/db/post_migrate/20190618171120_update_geo_nodes_primary.rb b/db/post_migrate/20190618171120_update_geo_nodes_primary.rb deleted file mode 100644 index dc9cfbda177..00000000000 --- a/db/post_migrate/20190618171120_update_geo_nodes_primary.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class UpdateGeoNodesPrimary < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - change_column_default(:geo_nodes, :primary, false) - change_column_null(:geo_nodes, :primary, false, false) - end - - def down - change_column_default(:geo_nodes, :primary, nil) - change_column_null(:geo_nodes, :primary, true) - end -end diff --git a/db/post_migrate/20190619175843_remove_import_columns_from_projects.rb b/db/post_migrate/20190619175843_remove_import_columns_from_projects.rb deleted file mode 100644 index 85f776ac99c..00000000000 --- a/db/post_migrate/20190619175843_remove_import_columns_from_projects.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class RemoveImportColumnsFromProjects < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - # Set this constant to true if this migration requires downtime. - DOWNTIME = false - - def change - remove_column :projects, :import_status, :string - remove_column :projects, :import_jid, :string - remove_column :projects, :import_error, :text - end -end diff --git a/db/post_migrate/20190620112608_enqueue_reset_merge_status_second_run.rb b/db/post_migrate/20190620112608_enqueue_reset_merge_status_second_run.rb deleted file mode 100644 index 2d096a2a39c..00000000000 --- a/db/post_migrate/20190620112608_enqueue_reset_merge_status_second_run.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class EnqueueResetMergeStatusSecondRun < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - BATCH_SIZE = 10_000 - MIGRATION = 'ResetMergeStatus' - DELAY_INTERVAL = 5.minutes.to_i - - disable_ddl_transaction! - - def up - say 'Scheduling `ResetMergeStatus` jobs' - - # We currently have more than ~5_000_000 merge request records on GitLab.com. - # This means it'll schedule ~500 jobs (10k MRs each) with a 5 minutes gap, - # so this should take ~41 hours for all background migrations to complete. - # ((5_000_000 / 10_000) * 5) / 60 => 41.6666.. - queue_background_migration_jobs_by_range_at_intervals(MergeRequest, MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) - end -end diff --git a/db/post_migrate/20190625184066_remove_sentry_from_application_settings.rb b/db/post_migrate/20190625184066_remove_sentry_from_application_settings.rb deleted file mode 100644 index 7a0923aabd8..00000000000 --- a/db/post_migrate/20190625184066_remove_sentry_from_application_settings.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class RemoveSentryFromApplicationSettings < ActiveRecord::Migration[5.0] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - SENTRY_ENABLED_COLUMNS = [ - :sentry_enabled, - :clientside_sentry_enabled - ].freeze - - SENTRY_DSN_COLUMNS = [ - :sentry_dsn, - :clientside_sentry_dsn - ].freeze - - disable_ddl_transaction! - - def up - (SENTRY_ENABLED_COLUMNS + SENTRY_DSN_COLUMNS).each do |column| - remove_column(:application_settings, column) if column_exists?(:application_settings, column) - end - end - - def down - SENTRY_ENABLED_COLUMNS.each do |column| - # rubocop:disable Migration/AddColumnWithDefault - add_column_with_default(:application_settings, column, :boolean, default: false, allow_null: false) unless column_exists?(:application_settings, column) - # rubocop:enable Migration/AddColumnWithDefault - end - - SENTRY_DSN_COLUMNS.each do |column| - add_column(:application_settings, column, :string) unless column_exists?(:application_settings, column) - end - end -end diff --git a/db/post_migrate/20190628191740_schedule_fixing_names_of_user_namespaces.rb b/db/post_migrate/20190628191740_schedule_fixing_names_of_user_namespaces.rb deleted file mode 100644 index 8fa7068b957..00000000000 --- a/db/post_migrate/20190628191740_schedule_fixing_names_of_user_namespaces.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class ScheduleFixingNamesOfUserNamespaces < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - class Namespace < ActiveRecord::Base - include ::EachBatch - - self.table_name = 'namespaces' - - scope :user_namespaces, -> { where(type: nil) } - end - - class Route < ActiveRecord::Base - include ::EachBatch - - self.table_name = 'routes' - - scope :project_routes, -> { where(source_type: 'Project') } - end - - disable_ddl_transaction! - - def up - queue_background_migration_jobs_by_range_at_intervals( - ScheduleFixingNamesOfUserNamespaces::Namespace.user_namespaces, - 'FixUserNamespaceNames', - 60.seconds, - batch_size: 5000 - ) - - queue_background_migration_jobs_by_range_at_intervals( - ScheduleFixingNamesOfUserNamespaces::Route.project_routes, - 'FixUserProjectRouteNames', - 60.seconds, - batch_size: 5000 - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20190702173936_populate_remaining_merge_request_assignees.rb b/db/post_migrate/20190702173936_populate_remaining_merge_request_assignees.rb deleted file mode 100644 index c435b94015d..00000000000 --- a/db/post_migrate/20190702173936_populate_remaining_merge_request_assignees.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class PopulateRemainingMergeRequestAssignees < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - BATCH_SIZE = 10_000 - MIGRATION = 'PopulateMergeRequestAssigneesTable' - - disable_ddl_transaction! - - def up - Gitlab::BackgroundMigration.steal(MIGRATION) - - Gitlab::BackgroundMigration::PopulateMergeRequestAssigneesTable.new.perform_all_sync(batch_size: BATCH_SIZE) - end -end diff --git a/db/post_migrate/20190703185326_fix_wrong_pages_access_level.rb b/db/post_migrate/20190703185326_fix_wrong_pages_access_level.rb deleted file mode 100644 index e5981956cf5..00000000000 --- a/db/post_migrate/20190703185326_fix_wrong_pages_access_level.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class FixWrongPagesAccessLevel < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - MIGRATION = 'FixPagesAccessLevel' - BATCH_SIZE = 20_000 - BATCH_TIME = 2.minutes - - disable_ddl_transaction! - - class ProjectFeature < ActiveRecord::Base - include ::EachBatch - - self.table_name = 'project_features' - self.inheritance_column = :_type_disabled - end - - def up - queue_background_migration_jobs_by_range_at_intervals( - ProjectFeature, - MIGRATION, - BATCH_TIME, - batch_size: BATCH_SIZE) - end -end diff --git a/db/post_migrate/20190711201818_encrypt_deploy_tokens_tokens.rb b/db/post_migrate/20190711201818_encrypt_deploy_tokens_tokens.rb deleted file mode 100644 index b2de98118b7..00000000000 --- a/db/post_migrate/20190711201818_encrypt_deploy_tokens_tokens.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class EncryptDeployTokensTokens < ActiveRecord::Migration[5.1] - DOWNTIME = false - - class DeploymentTokens < ActiveRecord::Base - self.table_name = 'deploy_tokens' - end - - def up - say_with_time("Encrypting tokens from deploy_tokens") do - DeploymentTokens.where('token_encrypted is NULL AND token IS NOT NULL').find_each(batch_size: 10000) do |deploy_token| - token_encrypted = Gitlab::CryptoHelper.aes256_gcm_encrypt(deploy_token.token, nonce: Gitlab::CryptoHelper::AES256_GCM_IV_STATIC) - deploy_token.update!(token_encrypted: token_encrypted) - end - end - end - - def down - say_with_time("Decrypting tokens from deploy_tokens") do - DeploymentTokens.where('token_encrypted IS NOT NULL AND token IS NULL').find_each(batch_size: 10000) do |deploy_token| - token = Gitlab::CryptoHelper.aes256_gcm_decrypt(deploy_token.token_encrypted) - deploy_token.update!(token: token) - end - end - end -end diff --git a/db/post_migrate/20190715043944_remove_sha_index_from_versions.rb b/db/post_migrate/20190715043944_remove_sha_index_from_versions.rb deleted file mode 100644 index b23abb80dda..00000000000 --- a/db/post_migrate/20190715043944_remove_sha_index_from_versions.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RemoveShaIndexFromVersions < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - remove_concurrent_index :design_management_versions, :sha - end - - def down - add_concurrent_index :design_management_versions, :sha, unique: true, using: :btree - end -end diff --git a/db/post_migrate/20190715044501_add_unique_issue_id_sha_index_to_versions.rb b/db/post_migrate/20190715044501_add_unique_issue_id_sha_index_to_versions.rb deleted file mode 100644 index 27b0c9648f9..00000000000 --- a/db/post_migrate/20190715044501_add_unique_issue_id_sha_index_to_versions.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddUniqueIssueIdShaIndexToVersions < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :design_management_versions, [:sha, :issue_id], unique: true, using: :btree - end - - def down - remove_concurrent_index :design_management_versions, [:sha, :issue_id] - end -end diff --git a/db/post_migrate/20190715114644_drop_project_features_pages_access_level_default.rb b/db/post_migrate/20190715114644_drop_project_features_pages_access_level_default.rb deleted file mode 100644 index 2fb0aa0f460..00000000000 --- a/db/post_migrate/20190715114644_drop_project_features_pages_access_level_default.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class DropProjectFeaturesPagesAccessLevelDefault < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - ENABLED_VALUE = 20 - - def change - change_column_default :project_features, :pages_access_level, from: ENABLED_VALUE, to: nil - end -end diff --git a/db/post_migrate/20190715193142_migrate_discussion_id_on_promoted_epics.rb b/db/post_migrate/20190715193142_migrate_discussion_id_on_promoted_epics.rb deleted file mode 100644 index 13f8477f3ea..00000000000 --- a/db/post_migrate/20190715193142_migrate_discussion_id_on_promoted_epics.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class MigrateDiscussionIdOnPromotedEpics < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - # We have ~5000 unique discussion_ids -> this migration will take about 102 minutes - # (5000/100 * 2 minutes + 2 minutes initial delay) on gitlab.com. - DOWNTIME = false - BATCH_SIZE = 100 - DELAY_INTERVAL = 2.minutes - MIGRATION = 'FixPromotedEpicsDiscussionIds' - - disable_ddl_transaction! - - class SystemNoteMetadata < ActiveRecord::Base - self.table_name = 'system_note_metadata' - self.inheritance_column = :_type_disabled - end - - class Note < ActiveRecord::Base - include EachBatch - - has_one :system_note_metadata, class_name: 'MigrateDiscussionIdOnPromotedEpics::SystemNoteMetadata' - - self.table_name = 'notes' - self.inheritance_column = :_type_disabled - - def self.fetch_discussion_ids_query - promoted_epics_query = Note - .joins(:system_note_metadata) - .where(system: true) - .where(noteable_type: 'Epic') - .where(system_note_metadata: { action: 'moved' }) - .select("DISTINCT noteable_id") - - Note.where(noteable_type: 'Epic') - .where(noteable_id: promoted_epics_query) - .distinct.pluck(:discussion_id) - end - end - - def up - add_concurrent_index(:system_note_metadata, :note_id, where: "action='moved'", name: 'temp_index_system_note_metadata_on_moved_note_id') - add_concurrent_index(:notes, [:id, :noteable_id], where: "noteable_type='Epic' AND system", name: 'temp_index_notes_on_id_and_noteable_id' ) - - all_discussion_ids = Note.fetch_discussion_ids_query - all_discussion_ids.in_groups_of(BATCH_SIZE, false).each_with_index do |ids, index| - delay = DELAY_INTERVAL * (index + 1) - BackgroundMigrationWorker.perform_in(delay, MIGRATION, [ids]) - end - - remove_concurrent_index(:system_note_metadata, :note_id, where: "action='moved'", name: 'temp_index_system_note_metadata_on_moved_note_id') - remove_concurrent_index(:notes, [:id, :noteable_id], where: "noteable_type='Epic' AND system", name: 'temp_index_notes_on_id_and_noteable_id') - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20190723105753_add_index_on_identities_lower_extern_uid_and_provider.rb b/db/post_migrate/20190723105753_add_index_on_identities_lower_extern_uid_and_provider.rb deleted file mode 100644 index 36ecca4821f..00000000000 --- a/db/post_migrate/20190723105753_add_index_on_identities_lower_extern_uid_and_provider.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnIdentitiesLowerExternUidAndProvider < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_NAME = "index_on_identities_lower_extern_uid_and_provider" - - def up - add_concurrent_index(:identities, 'lower(extern_uid), provider', name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:identities, INDEX_NAME) - end -end diff --git a/db/post_migrate/20190725080128_set_not_null_on_users_private_profile.rb b/db/post_migrate/20190725080128_set_not_null_on_users_private_profile.rb deleted file mode 100644 index db42e949d3f..00000000000 --- a/db/post_migrate/20190725080128_set_not_null_on_users_private_profile.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class SetNotNullOnUsersPrivateProfile < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - Gitlab::BackgroundMigration.steal('MigrateNullPrivateProfileToFalse') - - # rubocop:disable Migration/UpdateLargeTable - # rubocop:disable Migration/UpdateColumnInBatches - # Data has been migrated previously, count should be close to 0 - update_column_in_batches(:users, :private_profile, false) do |table, query| - query.where(table[:private_profile].eq(nil)) - end - - change_column_null :users, :private_profile, false - end - - def down - change_column_null :users, :private_profile, true - end -end diff --git a/db/post_migrate/20190801114109_cleanup_allow_local_requests_from_hooks_and_services_application_setting_rename.rb b/db/post_migrate/20190801114109_cleanup_allow_local_requests_from_hooks_and_services_application_setting_rename.rb deleted file mode 100644 index cb86f843f9c..00000000000 --- a/db/post_migrate/20190801114109_cleanup_allow_local_requests_from_hooks_and_services_application_setting_rename.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CleanupAllowLocalRequestsFromHooksAndServicesApplicationSettingRename < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - cleanup_concurrent_column_rename :application_settings, :allow_local_requests_from_hooks_and_services, :allow_local_requests_from_web_hooks_and_services - end - - def down - undo_cleanup_concurrent_column_rename :application_settings, :allow_local_requests_from_hooks_and_services, :allow_local_requests_from_web_hooks_and_services - end -end diff --git a/db/post_migrate/20190802091750_cleanup_application_settings_snowplow_collector_uri_rename.rb b/db/post_migrate/20190802091750_cleanup_application_settings_snowplow_collector_uri_rename.rb deleted file mode 100644 index 77472585512..00000000000 --- a/db/post_migrate/20190802091750_cleanup_application_settings_snowplow_collector_uri_rename.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CleanupApplicationSettingsSnowplowCollectorUriRename < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - cleanup_concurrent_column_rename :application_settings, :snowplow_collector_uri, :snowplow_collector_hostname - end - - def down - undo_cleanup_concurrent_column_rename :application_settings, :snowplow_collector_uri, :snowplow_collector_hostname - end -end diff --git a/db/post_migrate/20190802235445_add_index_on_id_and_type_and_public_to_keys.rb b/db/post_migrate/20190802235445_add_index_on_id_and_type_and_public_to_keys.rb deleted file mode 100644 index 9b4d74b4bea..00000000000 --- a/db/post_migrate/20190802235445_add_index_on_id_and_type_and_public_to_keys.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnIdAndTypeAndPublicToKeys < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - INDEX_NAME = "index_on_deploy_keys_id_and_type_and_public" - - def up - add_concurrent_index(:keys, - [:id, :type], - where: "public = 't'", - unique: true, - name: INDEX_NAME) - end - - def down - remove_concurrent_index_by_name(:keys, INDEX_NAME) - end -end diff --git a/db/post_migrate/20190809072552_set_self_monitoring_project_alerting_token.rb b/db/post_migrate/20190809072552_set_self_monitoring_project_alerting_token.rb deleted file mode 100644 index d10887fb5d5..00000000000 --- a/db/post_migrate/20190809072552_set_self_monitoring_project_alerting_token.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class SetSelfMonitoringProjectAlertingToken < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - # no-op - # Converted to no-op in https://gitlab.com/gitlab-org/gitlab/merge_requests/17049. - - # This migration has been made a no-op because the pre-requisite migration - # which creates the self-monitoring project has already been removed in - # https://gitlab.com/gitlab-org/gitlab/merge_requests/16864. As - # such, this migration would do nothing. - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20190812070645_migrate_private_profile_nulls.rb b/db/post_migrate/20190812070645_migrate_private_profile_nulls.rb deleted file mode 100644 index 063c1e16c27..00000000000 --- a/db/post_migrate/20190812070645_migrate_private_profile_nulls.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class MigratePrivateProfileNulls < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - DELAY = 5.minutes.to_i - BATCH_SIZE = 1_000 - - disable_ddl_transaction! - - class User < ActiveRecord::Base - self.table_name = 'users' - - include ::EachBatch - end - - def up - # Migration will take about 7 hours - User.where(private_profile: nil).each_batch(of: BATCH_SIZE) do |batch, index| - range = batch.pluck(Arel.sql("MIN(id)"), Arel.sql("MAX(id)")).first - delay = index * DELAY - - BackgroundMigrationWorker.perform_in(delay.seconds, 'MigrateNullPrivateProfileToFalse', [*range]) - end - end - - def down - # noop - end -end diff --git a/db/post_migrate/20190819231552_update_knative_prometheus_query_for_invocation_count.rb b/db/post_migrate/20190819231552_update_knative_prometheus_query_for_invocation_count.rb deleted file mode 100644 index 828f551baf6..00000000000 --- a/db/post_migrate/20190819231552_update_knative_prometheus_query_for_invocation_count.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class UpdateKnativePrometheusQueryForInvocationCount < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20190822185441_cleanup_epics_state_id_rename.rb b/db/post_migrate/20190822185441_cleanup_epics_state_id_rename.rb deleted file mode 100644 index 471b2ab9ca2..00000000000 --- a/db/post_migrate/20190822185441_cleanup_epics_state_id_rename.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CleanupEpicsStateIdRename < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - cleanup_concurrent_column_rename :epics, :state, :state_id - end - - def down - rename_column_concurrently :epics, :state_id, :state - end -end diff --git a/db/post_migrate/20190827102026_migrate_code_owner_approval_status_to_protected_branches_in_batches.rb b/db/post_migrate/20190827102026_migrate_code_owner_approval_status_to_protected_branches_in_batches.rb deleted file mode 100644 index b109f582909..00000000000 --- a/db/post_migrate/20190827102026_migrate_code_owner_approval_status_to_protected_branches_in_batches.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true - -class MigrateCodeOwnerApprovalStatusToProtectedBranchesInBatches < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - BATCH_SIZE = 200 - - class Project < ActiveRecord::Base - include EachBatch - - self.table_name = 'projects' - self.inheritance_column = :_type_disabled - - has_many :protected_branches - end - - class ProtectedBranch < ActiveRecord::Base - include EachBatch - - self.table_name = 'protected_branches' - self.inheritance_column = :_type_disabled - - belongs_to :project - end - - def up - add_concurrent_index :projects, :id, name: "temp_active_projects_with_prot_branches", where: 'archived = false and pending_delete = false and merge_requests_require_code_owner_approval = true' - - ProtectedBranch - .joins(:project) - .where(projects: { archived: false, pending_delete: false, merge_requests_require_code_owner_approval: true }) - .each_batch(of: BATCH_SIZE) do |batch| - batch.update_all(code_owner_approval_required: true) - end - - remove_concurrent_index_by_name(:projects, "temp_active_projects_with_prot_branches") - end - - def down - # noop - # - end -end diff --git a/db/post_migrate/20190902160015_remove_support_bot_column_from_users.rb b/db/post_migrate/20190902160015_remove_support_bot_column_from_users.rb deleted file mode 100644 index 80d69b57f5d..00000000000 --- a/db/post_migrate/20190902160015_remove_support_bot_column_from_users.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemoveSupportBotColumnFromUsers < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - return unless column_exists?(:users, :support_bot) - - remove_column :users, :support_bot - end - - def down - # no-op because the column should not exist in the previous version - end -end diff --git a/db/post_migrate/20190904205212_remove_id_column_from_intermediate_release_milestones.rb b/db/post_migrate/20190904205212_remove_id_column_from_intermediate_release_milestones.rb deleted file mode 100644 index e4b65d26db6..00000000000 --- a/db/post_migrate/20190904205212_remove_id_column_from_intermediate_release_milestones.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class RemoveIdColumnFromIntermediateReleaseMilestones < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - remove_column :milestone_releases, :id, :bigint - end -end diff --git a/db/post_migrate/20190905091812_schedule_project_any_approval_rule_migration.rb b/db/post_migrate/20190905091812_schedule_project_any_approval_rule_migration.rb deleted file mode 100644 index be47e4dfdf5..00000000000 --- a/db/post_migrate/20190905091812_schedule_project_any_approval_rule_migration.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class ScheduleProjectAnyApprovalRuleMigration < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - BATCH_SIZE = 5_000 - MIGRATION = 'PopulateAnyApprovalRuleForProjects' - DELAY_INTERVAL = 8.minutes.to_i - - disable_ddl_transaction! - - class Project < ActiveRecord::Base - include EachBatch - - self.table_name = 'projects' - - scope :with_approvals_before_merge, -> { where('approvals_before_merge <> 0') } - end - - def up - return unless Gitlab.ee? - - add_concurrent_index :projects, :id, - name: 'tmp_projects_with_approvals_before_merge', - where: 'approvals_before_merge <> 0' - - say "Scheduling `#{MIGRATION}` jobs" - - # We currently have ~43k project records with non-zero approvals_before_merge on GitLab.com. - # This means it'll schedule ~9 jobs (5k projects each) with a 8 minutes gap, - # so this should take ~1 hour for all background migrations to complete. - # - # The approximate expected number of affected rows is: 18k - - queue_background_migration_jobs_by_range_at_intervals( - ScheduleProjectAnyApprovalRuleMigration::Project.with_approvals_before_merge, - MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) - - remove_concurrent_index_by_name(:projects, 'tmp_projects_with_approvals_before_merge') - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20190905091831_schedule_merge_request_any_approval_rule_migration.rb b/db/post_migrate/20190905091831_schedule_merge_request_any_approval_rule_migration.rb deleted file mode 100644 index cdec87270f0..00000000000 --- a/db/post_migrate/20190905091831_schedule_merge_request_any_approval_rule_migration.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class ScheduleMergeRequestAnyApprovalRuleMigration < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - BATCH_SIZE = 5_000 - MIGRATION = 'PopulateAnyApprovalRuleForMergeRequests' - DELAY_INTERVAL = 8.minutes.to_i - - disable_ddl_transaction! - - class MergeRequest < ActiveRecord::Base - include EachBatch - - self.table_name = 'merge_requests' - - scope :with_approvals_before_merge, -> { where('approvals_before_merge <> 0') } - end - - def up - return unless Gitlab.ee? - - add_concurrent_index :merge_requests, :id, - name: 'tmp_merge_requests_with_approvals_before_merge', - where: 'approvals_before_merge <> 0' - - say "Scheduling `#{MIGRATION}` jobs" - - # We currently have ~440_000 merge request records with non-zero approvals_before_merge on GitLab.com. - # This means it'll schedule ~88 jobs (5k merge requests each) with a 8 minutes gap, - # so this should take ~12 hours for all background migrations to complete. - # - # The approximate expected number of affected rows is: 190k - - queue_background_migration_jobs_by_range_at_intervals( - ScheduleMergeRequestAnyApprovalRuleMigration::MergeRequest.with_approvals_before_merge, - MIGRATION, DELAY_INTERVAL, batch_size: BATCH_SIZE) - - remove_concurrent_index_by_name(:merge_requests, 'tmp_merge_requests_with_approvals_before_merge') - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20190909141517_update_cs_vulnerability_confidence_column.rb b/db/post_migrate/20190909141517_update_cs_vulnerability_confidence_column.rb deleted file mode 100644 index befa08e0cb6..00000000000 --- a/db/post_migrate/20190909141517_update_cs_vulnerability_confidence_column.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. -class UpdateCsVulnerabilityConfidenceColumn < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - BATCH_SIZE = 1_000 - INTERVAL = 5.minutes - - # 137_424 records to be updated on GitLab.com, - # giving us an estimated runtime of 12 hours. - def up - # no-op in CE - return unless Gitlab.ee? - - migration = Gitlab::BackgroundMigration::UpdateVulnerabilityConfidence - migration_name = migration.to_s.demodulize - relation = migration::Occurrence.container_scanning_reports_with_medium_confidence - queue_background_migration_jobs_by_range_at_intervals(relation, - migration_name, - INTERVAL, - batch_size: BATCH_SIZE) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20190910000130_add_index_on_application_id_on_oauth_access_tokens.rb b/db/post_migrate/20190910000130_add_index_on_application_id_on_oauth_access_tokens.rb deleted file mode 100644 index 78f7c0ecf0f..00000000000 --- a/db/post_migrate/20190910000130_add_index_on_application_id_on_oauth_access_tokens.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnApplicationIdOnOauthAccessTokens < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :oauth_access_tokens, :application_id - end - - def down - remove_concurrent_index :oauth_access_tokens, :application_id - end -end diff --git a/db/post_migrate/20190911251732_sync_issuables_state_id.rb b/db/post_migrate/20190911251732_sync_issuables_state_id.rb deleted file mode 100644 index 031837122fb..00000000000 --- a/db/post_migrate/20190911251732_sync_issuables_state_id.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -# Sync remaining records for issues/merge_requests tables where state_id -# is still null. -# For more information check: https://gitlab.com/gitlab-org/gitlab/issues/26823 -# It creates a temporary index before performing the UPDATES to sync values. -# -# In 09-11-2019 we have the following numbers for records with state_id == nil: -# -# 1348 issues - default batch size for each update 67 -# 10247 merge requests - default batch size for each update 511 - -class SyncIssuablesStateId < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - %i(issues merge_requests).each do |table| - temp_index_name = index_name_for(table) - - add_concurrent_index( - table, - 'id', - name: temp_index_name, - where: 'state_id IS NULL' - ) - - update_value = update_condition_for(table) - - update_column_in_batches(table, :state_id, update_value) do |table, query| - query.where(table[:state_id].eq(nil)) - end - ensure - remove_concurrent_index_by_name(table, temp_index_name) - end - end - - def down - # NO OP - end - - def update_condition_for(table) - value_expresson = - if table == :issues - issues_state_id_condition - else - merge_requests_state_id_condition - end - - Arel.sql(value_expresson) - end - - def index_name_for(table) - "idx_tmp_on_#{table}_where_state_id_is_null" - end - - def issues_state_id_condition - <<~SQL - CASE state - WHEN 'opened' THEN 1 - WHEN 'closed' THEN 2 - ELSE 2 - END - SQL - end - - def merge_requests_state_id_condition - <<~SQL - CASE state - WHEN 'opened' THEN 1 - WHEN 'closed' THEN 2 - WHEN 'merged' THEN 3 - WHEN 'locked' THEN 4 - ELSE 2 - END - SQL - end -end diff --git a/db/post_migrate/20190917173107_backfill_software_licenses_spdx_identifiers.rb b/db/post_migrate/20190917173107_backfill_software_licenses_spdx_identifiers.rb deleted file mode 100644 index 09492f5f99e..00000000000 --- a/db/post_migrate/20190917173107_backfill_software_licenses_spdx_identifiers.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -class BackfillSoftwareLicensesSpdxIdentifiers < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - CURRENT_LICENSES = { - 'AGPL-1.0' => 'AGPL-1.0', - 'AGPL-3.0' => 'AGPL-3.0', - 'Apache 2.0' => 'Apache-2.0', - 'Artistic-2.0' => 'Artistic-2.0', - 'BSD' => 'BSD-4-Clause', - 'CC0 1.0 Universal' => 'CC0-1.0', - 'CDDL-1.0' => 'CDDL-1.0', - 'CDDL-1.1' => 'CDDL-1.1', - 'EPL-1.0' => 'EPL-1.0', - 'EPL-2.0' => 'EPL-2.0', - 'GPLv2' => 'GPL-2.0', - 'GPLv3' => 'GPL-3.0', - 'ISC' => 'ISC', - 'LGPL' => 'LGPL-3.0-only', - 'LGPL-2.1' => 'LGPL-2.1', - 'MIT' => 'MIT', - 'Mozilla Public License 2.0' => 'MPL-2.0', - 'MS-PL' => 'MS-PL', - 'MS-RL' => 'MS-RL', - 'New BSD' => 'BSD-3-Clause', - 'Python Software Foundation License' => 'Python-2.0', - 'ruby' => 'Ruby', - 'Simplified BSD' => 'BSD-2-Clause', - 'WTFPL' => 'WTFPL', - 'Zlib' => 'Zlib' - }.freeze - - disable_ddl_transaction! - - # 25 records to be updated on GitLab.com - def up - return unless Gitlab.ee? - - say "Expect #{CURRENT_LICENSES.count} updates to the software_licenses table to occur" - CURRENT_LICENSES.each do |name, spdx_identifier| - # The following cop is disabled because of https://gitlab.com/gitlab-org/gitlab/issues/33470 - # For more context see https://gitlab.com/gitlab-org/gitlab/merge_requests/17004#note_226264823 - # rubocop:disable Migration/UpdateColumnInBatches - update_column_in_batches(:software_licenses, :spdx_identifier, spdx_identifier) do |table, query| - query.where(table[:name].eq(name)) - end - end - end - - def down - return unless Gitlab.ee? - - update_column_in_batches(:software_licenses, :spdx_identifier, nil) - end -end diff --git a/db/post_migrate/20190918104222_schedule_productivity_analytics_backfill.rb b/db/post_migrate/20190918104222_schedule_productivity_analytics_backfill.rb deleted file mode 100644 index cd759735f00..00000000000 --- a/db/post_migrate/20190918104222_schedule_productivity_analytics_backfill.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class ScheduleProductivityAnalyticsBackfill < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - def up - # no-op since the migration was removed - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20190924152703_migrate_issue_trackers_data.rb b/db/post_migrate/20190924152703_migrate_issue_trackers_data.rb deleted file mode 100644 index 93ea501e7e0..00000000000 --- a/db/post_migrate/20190924152703_migrate_issue_trackers_data.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class MigrateIssueTrackersData < ActiveRecord::Migration[5.1] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INTERVAL = 3.minutes.to_i - BATCH_SIZE = 5_000 - MIGRATION = 'MigrateIssueTrackersSensitiveData' - - disable_ddl_transaction! - - class Service < ActiveRecord::Base - self.table_name = 'services' - self.inheritance_column = :_type_disabled - - include ::EachBatch - end - - def up - relation = Service.where(category: 'issue_tracker').where("properties IS NOT NULL AND properties != '{}' AND properties != ''") - queue_background_migration_jobs_by_range_at_intervals(relation, - MIGRATION, - INTERVAL, - batch_size: BATCH_SIZE) - end - - def down - # no need - end -end diff --git a/db/post_migrate/20190926180443_schedule_epic_issues_after_epics_move.rb b/db/post_migrate/20190926180443_schedule_epic_issues_after_epics_move.rb deleted file mode 100644 index 113b7104209..00000000000 --- a/db/post_migrate/20190926180443_schedule_epic_issues_after_epics_move.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class ScheduleEpicIssuesAfterEpicsMove < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INTERVAL = 5.minutes.to_i - BATCH_SIZE = 100 - MIGRATION = 'MoveEpicIssuesAfterEpics' - - disable_ddl_transaction! - - class Epic < ActiveRecord::Base - self.table_name = 'epics' - - include ::EachBatch - end - - def up - return unless ::Gitlab.ee? - - Epic.each_batch(of: BATCH_SIZE) do |batch, index| - range = batch.pluck('MIN(id)', 'MAX(id)').first - delay = index * INTERVAL - BackgroundMigrationWorker.perform_in(delay, MIGRATION, range) - end - end - - def down - # no need - end -end diff --git a/db/post_migrate/20191002031332_schedule_pages_metadata_migration.rb b/db/post_migrate/20191002031332_schedule_pages_metadata_migration.rb deleted file mode 100644 index 0cd24da50d0..00000000000 --- a/db/post_migrate/20191002031332_schedule_pages_metadata_migration.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -class SchedulePagesMetadataMigration < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - BATCH_SIZE = 10_000 - MIGRATION = 'MigratePagesMetadata' - - disable_ddl_transaction! - - class Project < ActiveRecord::Base - include ::EachBatch - - self.table_name = 'projects' - end - - def up - say "Scheduling `#{MIGRATION}` jobs" - - # At the time of writing there are ~10_669_292 records to be inserted for GitLab.com, - # batches of 10_000 with delay interval of 2 minutes gives us an estimate of close to 36 hours. - queue_background_migration_jobs_by_range_at_intervals(Project, MIGRATION, 2.minutes, batch_size: BATCH_SIZE) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20191007163701_populate_remaining_any_approver_rules_for_merge_requests.rb b/db/post_migrate/20191007163701_populate_remaining_any_approver_rules_for_merge_requests.rb deleted file mode 100644 index e1c0f1d6c0c..00000000000 --- a/db/post_migrate/20191007163701_populate_remaining_any_approver_rules_for_merge_requests.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class PopulateRemainingAnyApproverRulesForMergeRequests < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - BATCH_SIZE = 10_000 - MIGRATION = 'PopulateAnyApprovalRuleForMergeRequests' - - disable_ddl_transaction! - - class MergeRequest < ActiveRecord::Base - include EachBatch - - self.table_name = 'merge_requests' - - scope :with_approvals_before_merge, -> { where.not(approvals_before_merge: 0) } - end - - def up - return unless Gitlab.ee? - - add_concurrent_index :merge_requests, :id, - name: 'tmp_merge_requests_with_approvals_before_merge', - where: 'approvals_before_merge != 0' - - Gitlab::BackgroundMigration.steal(MIGRATION) - - PopulateRemainingAnyApproverRulesForMergeRequests::MergeRequest.with_approvals_before_merge.each_batch(of: BATCH_SIZE) do |batch| - range = batch.pluck('MIN(id)', 'MAX(id)').first - - Gitlab::BackgroundMigration::PopulateAnyApprovalRuleForMergeRequests.new.perform(*range) - end - - remove_concurrent_index_by_name(:merge_requests, 'tmp_merge_requests_with_approvals_before_merge') - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20191007163736_populate_remaining_any_approver_rules_for_projects.rb b/db/post_migrate/20191007163736_populate_remaining_any_approver_rules_for_projects.rb deleted file mode 100644 index fce17ffcf16..00000000000 --- a/db/post_migrate/20191007163736_populate_remaining_any_approver_rules_for_projects.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class PopulateRemainingAnyApproverRulesForProjects < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - BATCH_SIZE = 5_000 - MIGRATION = 'PopulateAnyApprovalRuleForProjects' - - disable_ddl_transaction! - - class Project < ActiveRecord::Base - include EachBatch - - self.table_name = 'projects' - - scope :with_approvals_before_merge, -> { where.not(approvals_before_merge: 0) } - end - - def up - return unless Gitlab.ee? - - add_concurrent_index :projects, :id, - name: 'tmp_projects_with_approvals_before_merge', - where: 'approvals_before_merge != 0' - - Gitlab::BackgroundMigration.steal(MIGRATION) - - PopulateRemainingAnyApproverRulesForProjects::Project.with_approvals_before_merge.each_batch(of: BATCH_SIZE) do |batch| - range = batch.pluck('MIN(id)', 'MAX(id)').first - - Gitlab::BackgroundMigration::PopulateAnyApprovalRuleForProjects.new.perform(*range) - end - - remove_concurrent_index_by_name(:projects, 'tmp_projects_with_approvals_before_merge') - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20191008143850_fix_any_approver_rule_for_projects.rb b/db/post_migrate/20191008143850_fix_any_approver_rule_for_projects.rb deleted file mode 100644 index c1f4b7e42ab..00000000000 --- a/db/post_migrate/20191008143850_fix_any_approver_rule_for_projects.rb +++ /dev/null @@ -1,51 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class FixAnyApproverRuleForProjects < ActiveRecord::Migration[5.2] - DOWNTIME = false - BATCH_SIZE = 1000 - - disable_ddl_transaction! - - class ApprovalProjectRule < ActiveRecord::Base - NON_EXISTENT_RULE_TYPE = 4 - ANY_APPROVER_RULE_TYPE = 3 - - include EachBatch - - self.table_name = 'approval_project_rules' - - scope :any_approver, -> { where(rule_type: ANY_APPROVER_RULE_TYPE) } - scope :non_existent_rule_type, -> { where(rule_type: NON_EXISTENT_RULE_TYPE) } - end - - def up - return unless Gitlab.ee? - - # Remove approval project rule with rule type 4 if the project has a rule with rule_type 3 - # - # Currently, there is no projects on gitlab.com which have both rules with 3 and 4 rule type - # There's a code-level validation for a rule, which doesn't allow to create rules with the same names - # - # But in order to avoid failing the update query due to uniqueness constraint - # Let's run the delete query to be sure - project_ids = FixAnyApproverRuleForProjects::ApprovalProjectRule.any_approver.select(:project_id) - FixAnyApproverRuleForProjects::ApprovalProjectRule - .non_existent_rule_type - .where(project_id: project_ids) - .delete_all - - # Set approval project rule types to 3 - # Currently there are 18_445 records to be updated - FixAnyApproverRuleForProjects::ApprovalProjectRule.non_existent_rule_type.each_batch(of: BATCH_SIZE) do |rules| - rules.update_all(rule_type: FixAnyApproverRuleForProjects::ApprovalProjectRule::ANY_APPROVER_RULE_TYPE) - end - end - - def down - # The migration doesn't leave the database in an inconsistent state - # And can be run multiple times - end -end diff --git a/db/post_migrate/20191014030134_cleanup_design_management_version_user_to_author_rename.rb b/db/post_migrate/20191014030134_cleanup_design_management_version_user_to_author_rename.rb deleted file mode 100644 index e7132cbeeb7..00000000000 --- a/db/post_migrate/20191014030134_cleanup_design_management_version_user_to_author_rename.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CleanupDesignManagementVersionUserToAuthorRename < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - cleanup_concurrent_column_rename :design_management_versions, :user_id, :author_id - end - - def down - undo_cleanup_concurrent_column_rename :design_management_versions, :user_id, :author_id - end -end diff --git a/db/post_migrate/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects.rb b/db/post_migrate/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects.rb deleted file mode 100644 index f31471c2891..00000000000 --- a/db/post_migrate/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -class DropMergeRequestsRequireCodeOwnerApprovalFromProjects < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - remove_column :projects, :merge_requests_require_code_owner_approval, :boolean - end - - def down - add_column :projects, :merge_requests_require_code_owner_approval, :boolean # rubocop:disable Migration/AddColumnsToWideTables - - add_concurrent_index( - :projects, - %i[archived pending_delete merge_requests_require_code_owner_approval], - name: 'projects_requiring_code_owner_approval', - where: '((pending_delete = false) AND (archived = false) AND (merge_requests_require_code_owner_approval = true))' - ) - end -end diff --git a/db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb b/db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb deleted file mode 100644 index fc44568ea17..00000000000 --- a/db/post_migrate/20191017045817_schedule_fix_gitlab_com_pages_access_level.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -# See http://doc.gitlab.com/ce/development/migration_style_guide.html -# for more information on how to write migrations for GitLab. - -# Code of this migration was removed after execution on gitlab.com -# https://gitlab.com/gitlab-org/gitlab/issues/34018 -# Empty migration is left here to avoid any problems with rolling back -class ScheduleFixGitlabComPagesAccessLevel < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - end - - def down - end -end diff --git a/db/post_migrate/20191017180026_drop_ci_build_trace_sections_id.rb b/db/post_migrate/20191017180026_drop_ci_build_trace_sections_id.rb deleted file mode 100644 index 0405e23b465..00000000000 --- a/db/post_migrate/20191017180026_drop_ci_build_trace_sections_id.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class DropCiBuildTraceSectionsId < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - ## - # This column has already been ignored since 12.4 - # See https://gitlab.com/gitlab-org/gitlab/issues/32569 - remove_column :ci_build_trace_sections, :id - end - - def down - ## - # We don't backfill serial ids as it's not used in application code - # and quite expensive process. - add_column :ci_build_trace_sections, :id, :bigint - end -end diff --git a/db/post_migrate/20191021101942_remove_empty_github_service_templates.rb b/db/post_migrate/20191021101942_remove_empty_github_service_templates.rb deleted file mode 100644 index 64abe93b3e8..00000000000 --- a/db/post_migrate/20191021101942_remove_empty_github_service_templates.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -## It's expected to delete one record on GitLab.com -# -class RemoveEmptyGithubServiceTemplates < ActiveRecord::Migration[5.2] - DOWNTIME = false - - class Service < ActiveRecord::Base - self.table_name = 'services' - self.inheritance_column = :_type_disabled - - serialize :properties, JSON - end - - def up - relationship.where(properties: {}).delete_all - end - - def down - relationship.find_or_create_by!(properties: {}) - end - - private - - def relationship - RemoveEmptyGithubServiceTemplates::Service.where(template: true, type: 'GithubService') - end -end diff --git a/db/post_migrate/20191022113635_nullify_feature_flag_plaintext_tokens.rb b/db/post_migrate/20191022113635_nullify_feature_flag_plaintext_tokens.rb deleted file mode 100644 index 9ade1454844..00000000000 --- a/db/post_migrate/20191022113635_nullify_feature_flag_plaintext_tokens.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -class NullifyFeatureFlagPlaintextTokens < ActiveRecord::Migration[5.2] - DOWNTIME = false - - class FeatureFlagsClient < ActiveRecord::Base - include EachBatch - - self.table_name = 'operations_feature_flags_clients' - - scope :with_encrypted_token, -> { where.not(token_encrypted: nil) } - scope :with_plaintext_token, -> { where.not(token: nil) } - scope :without_plaintext_token, -> { where(token: nil) } - end - - disable_ddl_transaction! - - def up - return unless Gitlab.ee? - - # 7357 records to be updated on GitLab.com - FeatureFlagsClient.with_encrypted_token.with_plaintext_token.each_batch do |relation| - relation.update_all(token: nil) - end - end - - def down - return unless Gitlab.ee? - - # There is no way to restore only the tokens that were NULLifyed in the `up` - # but we can do is to restore _all_ of them in case it is needed. - say_with_time('Decrypting tokens from operations_feature_flags_clients') do - FeatureFlagsClient.with_encrypted_token.without_plaintext_token.find_each do |feature_flags_client| - token = Gitlab::CryptoHelper.aes256_gcm_decrypt(feature_flags_client.token_encrypted) - feature_flags_client.update_column(:token, token) - end - end - end -end diff --git a/db/post_migrate/20191029095537_cleanup_application_settings_snowplow_site_id_rename.rb b/db/post_migrate/20191029095537_cleanup_application_settings_snowplow_site_id_rename.rb deleted file mode 100644 index 83b4a2af2b6..00000000000 --- a/db/post_migrate/20191029095537_cleanup_application_settings_snowplow_site_id_rename.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CleanupApplicationSettingsSnowplowSiteIdRename < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - cleanup_concurrent_column_rename :application_settings, :snowplow_site_id, :snowplow_app_id - end - - def down - undo_cleanup_concurrent_column_rename :application_settings, :snowplow_site_id, :snowplow_app_id - end -end diff --git a/db/post_migrate/20191030193050_remove_pendo_from_application_settings.rb b/db/post_migrate/20191030193050_remove_pendo_from_application_settings.rb deleted file mode 100644 index c1a1cc01aa4..00000000000 --- a/db/post_migrate/20191030193050_remove_pendo_from_application_settings.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class RemovePendoFromApplicationSettings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - - DOWNTIME = false - - def up - remove_column :application_settings, :pendo_enabled - remove_column :application_settings, :pendo_url - end - - def down - add_column_with_default :application_settings, :pendo_enabled, :boolean, default: false, allow_null: false # rubocop:disable Migration/AddColumnWithDefault - add_column :application_settings, :pendo_url, :string, limit: 255 - end -end diff --git a/db/post_migrate/20191030223057_backfill_version_author_and_created_at.rb b/db/post_migrate/20191030223057_backfill_version_author_and_created_at.rb deleted file mode 100644 index 3ec6c59f166..00000000000 --- a/db/post_migrate/20191030223057_backfill_version_author_and_created_at.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -class BackfillVersionAuthorAndCreatedAt < ActiveRecord::Migration[5.2] - DOWNTIME = false - MIGRATION = 'BackfillVersionDataFromGitaly' - BATCH_SIZE = 500 - - disable_ddl_transaction! - - class Project < ActiveRecord::Base - self.table_name = 'projects' - self.inheritance_column = :_type_disabled - end - - class Issue < ActiveRecord::Base - self.table_name = 'issues' - self.inheritance_column = :_type_disabled - end - - class Version < ActiveRecord::Base - include EachBatch - self.table_name = 'design_management_versions' - self.inheritance_column = :_type_disabled - - # Returns unique issue ids of versions that are not in projects - # that are pending deletion. - scope :with_unique_issue_ids, -> do - versions = Version.arel_table - issues = Issue.arel_table - projects = Project.arel_table - - select(versions[:issue_id]).where( - versions[:author_id].eq(nil).or( - versions[:created_at].eq(nil) - ).and( - issues[:project_id].not_in( - projects.project(projects[:id]).where(projects[:pending_delete].eq(true)) - ) - ) - ).joins( - versions.join(issues).on( - issues[:id].eq(versions[:issue_id]) - ).join_sources - ).distinct - end - end - - # This migration will make around ~1300 UPDATE queries on GitLab.com, - # one per design_management_versions record as the migration will update - # each record individually. - # - # It will make around 870 Gitaly `ListCommitsByOid` requests on GitLab.com. - # One for every unique issue with design_management_versions records. - def up - return unless Gitlab.ee? # no-op for CE - - Version.with_unique_issue_ids.each_batch(of: BATCH_SIZE) do |versions, index| - jobs = versions.map { |version| [MIGRATION, [version.issue_id]] } - - BackgroundMigrationWorker.bulk_perform_async(jobs) - end - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20191031112603_remove_limits_from_plans.rb b/db/post_migrate/20191031112603_remove_limits_from_plans.rb deleted file mode 100644 index 30fb6a9d193..00000000000 --- a/db/post_migrate/20191031112603_remove_limits_from_plans.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RemoveLimitsFromPlans < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - remove_column :plans, :active_pipelines_limit - remove_column :plans, :pipeline_size_limit - remove_column :plans, :active_jobs_limit - end - - def down - add_column :plans, :active_pipelines_limit, :integer - add_column :plans, :pipeline_size_limit, :integer - add_column :plans, :active_jobs_limit, :integer - end -end diff --git a/db/post_migrate/20191104142124_nullify_users_role.rb b/db/post_migrate/20191104142124_nullify_users_role.rb deleted file mode 100644 index ab8eae46745..00000000000 --- a/db/post_migrate/20191104142124_nullify_users_role.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class NullifyUsersRole < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - disable_ddl_transaction! - INDEX_NAME = 'partial_index_users_updated_at_for_cleaning_mistaken_values' - - DOWNTIME = false - - def up - # expected updated users count is around 10K - # rubocop: disable Migration/UpdateLargeTable - add_concurrent_index(:users, :updated_at, where: 'role = 0', name: INDEX_NAME) - - update_column_in_batches(:users, :role, nil) do |table, query| - query.where(table[:updated_at].lt('2019-11-05 12:08:00')).where(table[:role].eq(0)) - end - - remove_concurrent_index_by_name(:users, INDEX_NAME) - end - - def down - # noop - end -end diff --git a/db/post_migrate/20191105094625_set_report_type_for_vulnerabilities.rb b/db/post_migrate/20191105094625_set_report_type_for_vulnerabilities.rb deleted file mode 100644 index 40e9e3bddc8..00000000000 --- a/db/post_migrate/20191105094625_set_report_type_for_vulnerabilities.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -class SetReportTypeForVulnerabilities < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - # set report_type based on vulnerability_occurrences from which the vulnerabilities were promoted, - # that is, first vulnerability_occurrences among those having the same vulnerability_id - execute <<~SQL - WITH first_findings_for_vulnerabilities AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported} ( - SELECT MIN(id) AS id, vulnerability_id - FROM vulnerability_occurrences - WHERE vulnerability_id IS NOT NULL - GROUP BY vulnerability_id - ) - UPDATE vulnerabilities - SET report_type = vulnerability_occurrences.report_type - FROM vulnerability_occurrences, first_findings_for_vulnerabilities - WHERE vulnerability_occurrences.id = first_findings_for_vulnerabilities.id - AND vulnerabilities.id = vulnerability_occurrences.vulnerability_id - SQL - - # set default report_type for orphan vulnerabilities (there should be none but...) - execute 'UPDATE vulnerabilities SET report_type = 0 WHERE report_type IS NULL' - - change_column_null :vulnerabilities, :report_type, false - end - - def down - change_column_null :vulnerabilities, :report_type, true - - execute 'UPDATE vulnerabilities SET report_type = NULL' - end -end diff --git a/db/post_migrate/20191105140942_add_indices_to_abuse_reports.rb b/db/post_migrate/20191105140942_add_indices_to_abuse_reports.rb deleted file mode 100644 index 2b2d04e8ccc..00000000000 --- a/db/post_migrate/20191105140942_add_indices_to_abuse_reports.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddIndicesToAbuseReports < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - add_concurrent_index :abuse_reports, :user_id - end - - def down - remove_concurrent_index :abuse_reports, :user_id - end -end diff --git a/db/post_migrate/20191108202723_add_unique_constraint_to_software_licenses.rb b/db/post_migrate/20191108202723_add_unique_constraint_to_software_licenses.rb deleted file mode 100644 index 580d3a189c8..00000000000 --- a/db/post_migrate/20191108202723_add_unique_constraint_to_software_licenses.rb +++ /dev/null @@ -1,69 +0,0 @@ -# frozen_string_literal: true - -class AddUniqueConstraintToSoftwareLicenses < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - DOWNTIME = false - NEW_INDEX = 'index_software_licenses_on_unique_name' - OLD_INDEX = 'index_software_licenses_on_name' - - disable_ddl_transaction! - - # 12 software licenses will be removed on GitLab.com - # 0 software license policies will be updated on GitLab.com - def up(attempts: 100) - remove_redundant_software_licenses! - - add_concurrent_index :software_licenses, :name, unique: true, name: NEW_INDEX - remove_concurrent_index :software_licenses, :name, name: OLD_INDEX - rescue ActiveRecord::RecordNotUnique - retry if (attempts -= 1) > 0 - - raise StandardError, <<~EOS - Failed to add an unique index to software_licenses, despite retrying the - migration 100 times. - - See https://gitlab.com/gitlab-org/gitlab/merge_requests/19840. - EOS - end - - def down - remove_concurrent_index :software_licenses, :name, unique: true, name: NEW_INDEX - add_concurrent_index :software_licenses, :name, name: OLD_INDEX - end - - private - - def remove_redundant_software_licenses! - redundant_software_licenses = execute <<~SQL - SELECT min(id) id, name - FROM software_licenses - WHERE name IN (select name from software_licenses group by name having count(name) > 1) - GROUP BY name - SQL - say "Detected #{redundant_software_licenses.count} duplicates." - - redundant_software_licenses.each_row do |id, name| - say_with_time("Reassigning policies that reference software license #{name}.") do - duplicates = software_licenses.where.not(id: id).where(name: name) - - software_license_policies - .where(software_license_id: duplicates) - .update_all(software_license_id: id) - - duplicates.delete_all - end - end - end - - def table(name) - Class.new(ActiveRecord::Base) { self.table_name = name } - end - - def software_licenses - @software_licenses ||= table(:software_licenses) - end - - def software_license_policies - @software_license_policies ||= table(:software_license_policies) - end -end diff --git a/db/post_migrate/20191112023159_complete_pages_metadata_migration.rb b/db/post_migrate/20191112023159_complete_pages_metadata_migration.rb deleted file mode 100644 index 6468eef8cc1..00000000000 --- a/db/post_migrate/20191112023159_complete_pages_metadata_migration.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class CompletePagesMetadataMigration < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - Gitlab::BackgroundMigration.steal('MigratePagesMetadata') - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20191112115317_change_vulnerabilities_title_html_to_nullable.rb b/db/post_migrate/20191112115317_change_vulnerabilities_title_html_to_nullable.rb deleted file mode 100644 index 6e0f3247410..00000000000 --- a/db/post_migrate/20191112115317_change_vulnerabilities_title_html_to_nullable.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class ChangeVulnerabilitiesTitleHtmlToNullable < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def change - change_column_null :vulnerabilities, :title_html, true - end -end diff --git a/db/post_migrate/20191114173624_set_resolved_state_on_vulnerabilities.rb b/db/post_migrate/20191114173624_set_resolved_state_on_vulnerabilities.rb deleted file mode 100644 index 2900ef852a5..00000000000 --- a/db/post_migrate/20191114173624_set_resolved_state_on_vulnerabilities.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class SetResolvedStateOnVulnerabilities < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - execute <<~SQL - -- selecting IDs for all non-orphan Findings that either have no feedback or it's a non-dismissal feedback - WITH resolved_vulnerability_ids AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported} ( - SELECT DISTINCT vulnerability_id AS id - FROM vulnerability_occurrences - LEFT JOIN vulnerability_feedback ON vulnerability_feedback.project_fingerprint = ENCODE(vulnerability_occurrences.project_fingerprint::bytea, 'HEX') - WHERE vulnerability_id IS NOT NULL - AND (vulnerability_feedback.id IS NULL OR vulnerability_feedback.feedback_type <> 0) - ) - UPDATE vulnerabilities - SET state = 3, resolved_by_id = closed_by_id, resolved_at = NOW() - FROM resolved_vulnerability_ids - WHERE vulnerabilities.id IN (resolved_vulnerability_ids.id) - AND state = 2 -- only 'closed' Vulnerabilities become 'resolved' - SQL - end - - def down - execute <<~SQL - UPDATE vulnerabilities - SET state = 2, resolved_by_id = NULL, resolved_at = NULL -- state = 'closed' - WHERE state = 3 -- 'resolved' - SQL - end -end diff --git a/db/post_migrate/20191114204343_remove_milestone_id_from_epics.rb b/db/post_migrate/20191114204343_remove_milestone_id_from_epics.rb deleted file mode 100644 index 4ef6decda95..00000000000 --- a/db/post_migrate/20191114204343_remove_milestone_id_from_epics.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class RemoveMilestoneIdFromEpics < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - remove_column :epics, :milestone_id - end - - def down - add_column :epics, :milestone_id, :integer - end -end diff --git a/db/post_migrate/20191115115043_migrate_epic_mentions_to_db.rb b/db/post_migrate/20191115115043_migrate_epic_mentions_to_db.rb deleted file mode 100644 index 97f2e568a7e..00000000000 --- a/db/post_migrate/20191115115043_migrate_epic_mentions_to_db.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -class MigrateEpicMentionsToDb < ActiveRecord::Migration[5.2] - DOWNTIME = false - - disable_ddl_transaction! - - DELAY = 2.minutes.to_i - BATCH_SIZE = 10000 - MIGRATION = 'UserMentions::CreateResourceUserMention' - - JOIN = "LEFT JOIN epic_user_mentions on epics.id = epic_user_mentions.epic_id" - QUERY_CONDITIONS = "(description like '%@%' OR title like '%@%') AND epic_user_mentions.epic_id is null" - - class Epic < ActiveRecord::Base - include EachBatch - - self.table_name = 'epics' - end - - def up - return unless Gitlab.ee? - - Epic - .joins(JOIN) - .where(QUERY_CONDITIONS) - .each_batch(of: BATCH_SIZE) do |batch, index| - range = batch.pluck(Arel.sql('MIN(epics.id)'), Arel.sql('MAX(epics.id)')).first - BackgroundMigrationWorker.perform_in(index * DELAY, MIGRATION, ['Epic', JOIN, QUERY_CONDITIONS, false, *range]) - end - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20191115115522_migrate_epic_notes_mentions_to_db.rb b/db/post_migrate/20191115115522_migrate_epic_notes_mentions_to_db.rb deleted file mode 100644 index 7914ff59dbd..00000000000 --- a/db/post_migrate/20191115115522_migrate_epic_notes_mentions_to_db.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -class MigrateEpicNotesMentionsToDb < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - DELAY = 2.minutes.to_i - BATCH_SIZE = 10000 - MIGRATION = 'UserMentions::CreateResourceUserMention' - - INDEX_NAME = 'epic_mentions_temp_index' - INDEX_CONDITION = "note LIKE '%@%'::text AND notes.noteable_type = 'Epic'" - QUERY_CONDITIONS = "#{INDEX_CONDITION} AND epic_user_mentions.epic_id IS NULL" - JOIN = 'INNER JOIN epics ON epics.id = notes.noteable_id LEFT JOIN epic_user_mentions ON notes.id = epic_user_mentions.note_id' - - class Note < ActiveRecord::Base - include EachBatch - - self.table_name = 'notes' - end - - def up - return unless Gitlab.ee? - - # create temporary index for notes with mentions, may take well over 1h - add_concurrent_index(:notes, :id, where: INDEX_CONDITION, name: INDEX_NAME) - - Note - .joins(JOIN) - .where(QUERY_CONDITIONS) - .each_batch(of: BATCH_SIZE) do |batch, index| - range = batch.pluck(Arel.sql('MIN(notes.id)'), Arel.sql('MAX(notes.id)')).first - BackgroundMigrationWorker.perform_in(index * DELAY, MIGRATION, ['Epic', JOIN, QUERY_CONDITIONS, true, *range]) - end - end - - def down - # no-op - # temporary index is to be dropped in a different migration in an upcoming release: - # https://gitlab.com/gitlab-org/gitlab/issues/196842 - end -end diff --git a/db/post_migrate/20191118211629_migrate_ops_feature_flags_scopes_target_user_ids.rb b/db/post_migrate/20191118211629_migrate_ops_feature_flags_scopes_target_user_ids.rb deleted file mode 100644 index 47622a216d9..00000000000 --- a/db/post_migrate/20191118211629_migrate_ops_feature_flags_scopes_target_user_ids.rb +++ /dev/null @@ -1,53 +0,0 @@ -# frozen_string_literal: true - -class MigrateOpsFeatureFlagsScopesTargetUserIds < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - class OperationsFeatureFlagScope < ActiveRecord::Base - include EachBatch - self.table_name = 'operations_feature_flag_scopes' - self.inheritance_column = :_type_disabled - end - - ### - # 2019-11-26 - # - # There are about 1000 rows in the operations_feature_flag_scopes table on gitlab.com. - # This migration will update about 30 of them. - # https://gitlab.com/gitlab-org/gitlab/merge_requests/20325#note_250742098 - # - # This should take a few seconds to run. - # https://gitlab.com/gitlab-org/gitlab/merge_requests/20325#note_254871603 - # - ### - def up - OperationsFeatureFlagScope.where("strategies @> ?", [{ 'name': 'userWithId' }].to_json).each_batch do |scopes| - scopes.each do |scope| - if scope.active - default_strategy = scope.strategies.find { |s| s['name'] == 'default' } - - if default_strategy.present? - scope.update({ strategies: [default_strategy] }) - end - else - user_with_id_strategy = scope.strategies.find { |s| s['name'] == 'userWithId' } - - scope.update({ - active: true, - strategies: [user_with_id_strategy] - }) - end - end - end - end - - def down - # This is not reversible. - # The old Target Users feature required the same list of user ids to be applied to each environment scope. - # Now we allow the list of user ids to differ for each scope. - end -end diff --git a/db/post_migrate/20191119221041_cleanup_software_license_policies_classification_rename.rb b/db/post_migrate/20191119221041_cleanup_software_license_policies_classification_rename.rb deleted file mode 100644 index eb605dce5aa..00000000000 --- a/db/post_migrate/20191119221041_cleanup_software_license_policies_classification_rename.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CleanupSoftwareLicensePoliciesClassificationRename < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - cleanup_concurrent_column_rename :software_license_policies, :approval_status, :classification - end - - def down - undo_cleanup_concurrent_column_rename :software_license_policies, :approval_status, :classification - end -end diff --git a/db/post_migrate/20191121122856_drop_packages_package_metadata_table.rb b/db/post_migrate/20191121122856_drop_packages_package_metadata_table.rb deleted file mode 100644 index 9e24f64660c..00000000000 --- a/db/post_migrate/20191121122856_drop_packages_package_metadata_table.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class DropPackagesPackageMetadataTable < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - drop_table :packages_package_metadata - end - - def down - create_table :packages_package_metadata do |t| - t.references :package, index: { unique: true }, null: false, foreign_key: { to_table: :packages_packages, on_delete: :cascade }, type: :integer - t.binary :metadata, null: false - end - end -end diff --git a/db/post_migrate/20191122135327_remove_plaintext_columns_from_application_settings.rb b/db/post_migrate/20191122135327_remove_plaintext_columns_from_application_settings.rb deleted file mode 100644 index b5cd58b10a8..00000000000 --- a/db/post_migrate/20191122135327_remove_plaintext_columns_from_application_settings.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class RemovePlaintextColumnsFromApplicationSettings < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - PLAINTEXT_ATTRIBUTES = %w[ - akismet_api_key - elasticsearch_aws_secret_access_key - recaptcha_private_key - recaptcha_site_key - slack_app_secret - slack_app_verification_token - ].freeze - - def up - PLAINTEXT_ATTRIBUTES.each do |plaintext_attribute| - remove_column :application_settings, plaintext_attribute - end - end - - def down - PLAINTEXT_ATTRIBUTES.each do |plaintext_attribute| - add_column :application_settings, plaintext_attribute, :text - end - end -end diff --git a/db/post_migrate/20191125024005_cleanup_deploy_access_levels_for_removed_groups.rb b/db/post_migrate/20191125024005_cleanup_deploy_access_levels_for_removed_groups.rb deleted file mode 100644 index 29592612a02..00000000000 --- a/db/post_migrate/20191125024005_cleanup_deploy_access_levels_for_removed_groups.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -class CleanupDeployAccessLevelsForRemovedGroups < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - return unless Gitlab.ee? - - delete = <<~SQL - DELETE FROM protected_environment_deploy_access_levels d - USING protected_environments p - WHERE d.protected_environment_id=p.id - AND d.group_id IS NOT NULL - AND NOT EXISTS (SELECT 1 FROM project_group_links WHERE project_id=p.project_id AND group_id=d.group_id) - RETURNING * - SQL - - # At the time of writing there are 4 such records on GitLab.com, - # execution time is expected to be around 15ms. - records = execute(delete) - - logger = Gitlab::BackgroundMigration::Logger.build - records.to_a.each do |record| - logger.info record.as_json.merge(message: "protected_environments_deploy_access_levels was deleted") - end - end - - def down - # There is no pragmatic way to restore - # the records deleted in the `#up` method above. - end -end diff --git a/db/post_migrate/20191128162854_drop_project_ci_cd_settings_merge_trains_enabled.rb b/db/post_migrate/20191128162854_drop_project_ci_cd_settings_merge_trains_enabled.rb deleted file mode 100644 index 7f91d5112b3..00000000000 --- a/db/post_migrate/20191128162854_drop_project_ci_cd_settings_merge_trains_enabled.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class DropProjectCiCdSettingsMergeTrainsEnabled < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - remove_column :project_ci_cd_settings, :merge_trains_enabled - end - - def down - # rubocop:disable Migration/AddColumnWithDefault - add_column_with_default :project_ci_cd_settings, :merge_trains_enabled, :boolean, default: false, allow_null: true # rubocop:disable Migration/UpdateLargeTable - # rubocop:enable Migration/AddColumnWithDefault - end -end diff --git a/db/post_migrate/20191202031812_drop_operations_feature_flags_clients_token.rb b/db/post_migrate/20191202031812_drop_operations_feature_flags_clients_token.rb deleted file mode 100644 index 93cef322f02..00000000000 --- a/db/post_migrate/20191202031812_drop_operations_feature_flags_clients_token.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class DropOperationsFeatureFlagsClientsToken < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - def up - # Ignored in 12.5 - https://gitlab.com/gitlab-org/gitlab/merge_requests/18923 - remove_column :operations_feature_flags_clients, :token - end - - def down - unless column_exists?(:operations_feature_flags_clients, :token) - add_column :operations_feature_flags_clients, :token, :string - end - - add_concurrent_index :operations_feature_flags_clients, [:project_id, :token], unique: true, - name: 'index_operations_feature_flags_clients_on_project_id_and_token' - end -end diff --git a/db/post_migrate/20191204114127_delete_legacy_triggers.rb b/db/post_migrate/20191204114127_delete_legacy_triggers.rb deleted file mode 100644 index 82d901ae689..00000000000 --- a/db/post_migrate/20191204114127_delete_legacy_triggers.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class DeleteLegacyTriggers < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - execute <<~SQL - DELETE FROM ci_triggers WHERE owner_id IS NULL - SQL - - change_column_null :ci_triggers, :owner_id, false - end - - def down - change_column_null :ci_triggers, :owner_id, true - end -end diff --git a/db/post_migrate/20191205084057_update_minimum_password_length.rb b/db/post_migrate/20191205084057_update_minimum_password_length.rb deleted file mode 100644 index d9324347075..00000000000 --- a/db/post_migrate/20191205084057_update_minimum_password_length.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class UpdateMinimumPasswordLength < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - value_to_be_updated_to = [ - Devise.password_length.min, - ApplicationSetting::DEFAULT_MINIMUM_PASSWORD_LENGTH - ].max - - execute "UPDATE application_settings SET minimum_password_length = #{value_to_be_updated_to}" - - ApplicationSetting.expire - end - - def down - value_to_be_updated_to = ApplicationSetting::DEFAULT_MINIMUM_PASSWORD_LENGTH - - execute "UPDATE application_settings SET minimum_password_length = #{value_to_be_updated_to}" - - ApplicationSetting.expire - end -end diff --git a/db/post_migrate/20191209215316_knative_0_9_prometheus_update.rb b/db/post_migrate/20191209215316_knative_0_9_prometheus_update.rb deleted file mode 100644 index 52127f71cd0..00000000000 --- a/db/post_migrate/20191209215316_knative_0_9_prometheus_update.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class Knative09PrometheusUpdate < ActiveRecord::Migration[5.2] - DOWNTIME = false - - def up - ::Gitlab::DatabaseImporters::CommonMetrics::Importer.new.execute - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20191212162434_change_commit_user_mentions_commit_id_column_type_cleanup.rb b/db/post_migrate/20191212162434_change_commit_user_mentions_commit_id_column_type_cleanup.rb deleted file mode 100644 index aed9d335af9..00000000000 --- a/db/post_migrate/20191212162434_change_commit_user_mentions_commit_id_column_type_cleanup.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class ChangeCommitUserMentionsCommitIdColumnTypeCleanup < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - - disable_ddl_transaction! - - NEW_INDEX = 'commit_id_for_type_change_and_note_id_index' - OLD_INDEX = 'commit_user_mentions_on_commit_id_and_note_id_index' - - def up - cleanup_concurrent_column_type_change :commit_user_mentions, :commit_id - end - - def down - change_column_type_concurrently :commit_user_mentions, :commit_id, :binary - - # change_column_type_concurrently creates a new index based on existing commit_id_and_note_id_index` naming it - # `commit_id_for_type_change_and_note_id_index` so we'll rename it back to its original name. - add_concurrent_index :commit_user_mentions, [:commit_id_for_type_change, :note_id], name: OLD_INDEX - remove_concurrent_index_by_name :commit_user_mentions, NEW_INDEX - end -end diff --git a/db/post_migrate/20191218225624_add_index_on_project_id_to_ci_pipelines.rb b/db/post_migrate/20191218225624_add_index_on_project_id_to_ci_pipelines.rb deleted file mode 100644 index ab6c3b0616a..00000000000 --- a/db/post_migrate/20191218225624_add_index_on_project_id_to_ci_pipelines.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexOnProjectIdToCiPipelines < ActiveRecord::Migration[5.2] - include Gitlab::Database::MigrationHelpers - - DOWNTIME = false - INDEX_NAME = 'index_ci_pipelines_on_project_id_and_id_desc' - - disable_ddl_transaction! - - def up - add_concurrent_index :ci_pipelines, [:project_id, :id], name: INDEX_NAME, order: { id: :desc } - end - - def down - remove_concurrent_index :ci_pipelines, [:project_id, :id], name: INDEX_NAME, order: { id: :desc } - end -end diff --git a/db/schema_migrations/20190102152410 b/db/schema_migrations/20190102152410 deleted file mode 100644 index abeec4ae6ed..00000000000 --- a/db/schema_migrations/20190102152410 +++ /dev/null @@ -1 +0,0 @@ -b4437ea9b52eaa5c1e25982995720139b359e58c9622a1206b212e96a188e28a
\ No newline at end of file diff --git a/db/schema_migrations/20190103140724 b/db/schema_migrations/20190103140724 deleted file mode 100644 index 85c51014c8f..00000000000 --- a/db/schema_migrations/20190103140724 +++ /dev/null @@ -1 +0,0 @@ -a972ee9ce7142d93108f635f550d0b6245c335dec130072e9f5121fed52544a1
\ No newline at end of file diff --git a/db/schema_migrations/20190104182041 b/db/schema_migrations/20190104182041 deleted file mode 100644 index 9342970a634..00000000000 --- a/db/schema_migrations/20190104182041 +++ /dev/null @@ -1 +0,0 @@ -2f2226dc7a34ae86e00f00ad03e74b2591adc6e5f9367b779c7bb57a38702c0f
\ No newline at end of file diff --git a/db/schema_migrations/20190107151020 b/db/schema_migrations/20190107151020 deleted file mode 100644 index be64b70d253..00000000000 --- a/db/schema_migrations/20190107151020 +++ /dev/null @@ -1 +0,0 @@ -52b5718373a5a336a38257aa73758059e77ba15afab89ac3326f8a96ac4df00a
\ No newline at end of file diff --git a/db/schema_migrations/20190108192941 b/db/schema_migrations/20190108192941 deleted file mode 100644 index 8bdd56bb248..00000000000 --- a/db/schema_migrations/20190108192941 +++ /dev/null @@ -1 +0,0 @@ -58d3c729a331666723ff80b4f778795d39bcf6b62fb79931bf25e30ac072fbf8
\ No newline at end of file diff --git a/db/schema_migrations/20190109153125 b/db/schema_migrations/20190109153125 deleted file mode 100644 index 26ce8cd7b28..00000000000 --- a/db/schema_migrations/20190109153125 +++ /dev/null @@ -1 +0,0 @@ -901f28f6af880c088971c619d095db2d328c42a8b3b31b4faf53d4bf0f76b4e0
\ No newline at end of file diff --git a/db/schema_migrations/20190114172110 b/db/schema_migrations/20190114172110 deleted file mode 100644 index c32ee0ddcae..00000000000 --- a/db/schema_migrations/20190114172110 +++ /dev/null @@ -1 +0,0 @@ -4bde1677e881c6bb03785e313875fce7c4bf690f1fe8b807be473331cfb57c22
\ No newline at end of file diff --git a/db/schema_migrations/20190115054215 b/db/schema_migrations/20190115054215 deleted file mode 100644 index 45c2d030a79..00000000000 --- a/db/schema_migrations/20190115054215 +++ /dev/null @@ -1 +0,0 @@ -1a87f77540cf91ae8d640819d515ed34ca69bef1e0d5494b0247385e44f3520c
\ No newline at end of file diff --git a/db/schema_migrations/20190115054216 b/db/schema_migrations/20190115054216 deleted file mode 100644 index 0eb786da0b9..00000000000 --- a/db/schema_migrations/20190115054216 +++ /dev/null @@ -1 +0,0 @@ -7bd27433ac96c9aaf0ab7aeb5b4bea9af292b56ff5cb9966df63145a95a906e3
\ No newline at end of file diff --git a/db/schema_migrations/20190115092821 b/db/schema_migrations/20190115092821 deleted file mode 100644 index 9037247c9c1..00000000000 --- a/db/schema_migrations/20190115092821 +++ /dev/null @@ -1 +0,0 @@ -0d1262ee8c48483020f8aaec1d737650339e56c0fa0b530a047423e5ad4cf7fb
\ No newline at end of file diff --git a/db/schema_migrations/20190116234221 b/db/schema_migrations/20190116234221 deleted file mode 100644 index e57d4297007..00000000000 --- a/db/schema_migrations/20190116234221 +++ /dev/null @@ -1 +0,0 @@ -36ad5643295d8ab4f2b50c028dc6e047ac1bba18c2495862113c227040549a7c
\ No newline at end of file diff --git a/db/schema_migrations/20190124200344 b/db/schema_migrations/20190124200344 deleted file mode 100644 index b3b490b5a22..00000000000 --- a/db/schema_migrations/20190124200344 +++ /dev/null @@ -1 +0,0 @@ -c3563a49a4f65389da84eae0a3d6851ac1d89f736ad213047bb20b085cf65444
\ No newline at end of file diff --git a/db/schema_migrations/20190130091630 b/db/schema_migrations/20190130091630 deleted file mode 100644 index bb31de7213d..00000000000 --- a/db/schema_migrations/20190130091630 +++ /dev/null @@ -1 +0,0 @@ -824c8286fcc54bf104c76159d75d22addb9084f932d884008a6e09d3ffdd4fc3
\ No newline at end of file diff --git a/db/schema_migrations/20190131122559 b/db/schema_migrations/20190131122559 deleted file mode 100644 index 5ff09feeb4a..00000000000 --- a/db/schema_migrations/20190131122559 +++ /dev/null @@ -1 +0,0 @@ -8c9392470fe4f34e5a194b449702161fedfe12237c87e1653fc1edaff6f82493
\ No newline at end of file diff --git a/db/schema_migrations/20190204115450 b/db/schema_migrations/20190204115450 deleted file mode 100644 index cca6016a50a..00000000000 --- a/db/schema_migrations/20190204115450 +++ /dev/null @@ -1 +0,0 @@ -1259521d2b9cc79694f0d47dce9e599b7fb0abfd3fa6b8c0161860b6815676c8
\ No newline at end of file diff --git a/db/schema_migrations/20190206193120 b/db/schema_migrations/20190206193120 deleted file mode 100644 index 9918f719946..00000000000 --- a/db/schema_migrations/20190206193120 +++ /dev/null @@ -1 +0,0 @@ -75e303c1cc9ba39465ed4cb7db6b24b38af0f83b11b72fcc25478bd98260ecd9
\ No newline at end of file diff --git a/db/schema_migrations/20190211131150 b/db/schema_migrations/20190211131150 deleted file mode 100644 index 364b1244b25..00000000000 --- a/db/schema_migrations/20190211131150 +++ /dev/null @@ -1 +0,0 @@ -e400393e5a5cfdbcea5927ce6c037e0879cf86d8b35c11673701a2515bbf93b6
\ No newline at end of file diff --git a/db/schema_migrations/20190214112022 b/db/schema_migrations/20190214112022 deleted file mode 100644 index d13877d88a6..00000000000 --- a/db/schema_migrations/20190214112022 +++ /dev/null @@ -1 +0,0 @@ -a3afb501288961682a4969f4ecaf2496e75795fa2adaa10d3d047ee24c9b1967
\ No newline at end of file diff --git a/db/schema_migrations/20190215154930 b/db/schema_migrations/20190215154930 deleted file mode 100644 index cb0e0834f8d..00000000000 --- a/db/schema_migrations/20190215154930 +++ /dev/null @@ -1 +0,0 @@ -3eea929f8efcb9ef32242c98a7393a8b45eceb3930b7e9b3a782dd9f5628d718
\ No newline at end of file diff --git a/db/schema_migrations/20190218134158 b/db/schema_migrations/20190218134158 deleted file mode 100644 index 04b55b69e23..00000000000 --- a/db/schema_migrations/20190218134158 +++ /dev/null @@ -1 +0,0 @@ -86716aa523d3fbf1c0dc40e758b004ee500d9b6dbc5f5f05ddf167b0f1937fd7
\ No newline at end of file diff --git a/db/schema_migrations/20190218134209 b/db/schema_migrations/20190218134209 deleted file mode 100644 index 7a442ccf8a4..00000000000 --- a/db/schema_migrations/20190218134209 +++ /dev/null @@ -1 +0,0 @@ -e63a6b7f3032aa58d906f0b5b2141ae376bc4ce78aa4a9c18c983b4c749cd736
\ No newline at end of file diff --git a/db/schema_migrations/20190219201635 b/db/schema_migrations/20190219201635 deleted file mode 100644 index 65073d40aea..00000000000 --- a/db/schema_migrations/20190219201635 +++ /dev/null @@ -1 +0,0 @@ -bba3d5fba71bc98e53f3858cf039d74049eb9beb0c6a7d075909dd58e88595ba
\ No newline at end of file diff --git a/db/schema_migrations/20190220142344 b/db/schema_migrations/20190220142344 deleted file mode 100644 index 32a3a4e12e2..00000000000 --- a/db/schema_migrations/20190220142344 +++ /dev/null @@ -1 +0,0 @@ -f0c7e5bb3048b6e7d91a4fb5082ad0b1ac86965287f956dc8a2de17e13a9f365
\ No newline at end of file diff --git a/db/schema_migrations/20190220150130 b/db/schema_migrations/20190220150130 deleted file mode 100644 index bf4130f7e2b..00000000000 --- a/db/schema_migrations/20190220150130 +++ /dev/null @@ -1 +0,0 @@ -341ac337f4b5aa05bbb6d69ca4517a785eb2f577ed53b282484f6b2bf44eaf86
\ No newline at end of file diff --git a/db/schema_migrations/20190222051615 b/db/schema_migrations/20190222051615 deleted file mode 100644 index 0028efcf173..00000000000 --- a/db/schema_migrations/20190222051615 +++ /dev/null @@ -1 +0,0 @@ -af6fc844acb6091006688452a2a5d863bb133908bc739f36267fa8178c316d21
\ No newline at end of file diff --git a/db/schema_migrations/20190225152525 b/db/schema_migrations/20190225152525 deleted file mode 100644 index 0e90656201a..00000000000 --- a/db/schema_migrations/20190225152525 +++ /dev/null @@ -1 +0,0 @@ -78ca691904675f03d3debbb6a632e75d74eee054150ed4cd93804a4d70aeb6b4
\ No newline at end of file diff --git a/db/schema_migrations/20190225160301 b/db/schema_migrations/20190225160301 deleted file mode 100644 index b3126de5788..00000000000 --- a/db/schema_migrations/20190225160301 +++ /dev/null @@ -1 +0,0 @@ -614cfc757d5f3eddc1144247932b83c71359edea88f06bef9348081448b78134
\ No newline at end of file diff --git a/db/schema_migrations/20190228192410 b/db/schema_migrations/20190228192410 deleted file mode 100644 index fd80c6c3fa8..00000000000 --- a/db/schema_migrations/20190228192410 +++ /dev/null @@ -1 +0,0 @@ -ccfbf0b383cc80dca181abed3e23e1c41033aa59b38c2fea25b424e08329633c
\ No newline at end of file diff --git a/db/schema_migrations/20190301081611 b/db/schema_migrations/20190301081611 deleted file mode 100644 index 601c04a3f63..00000000000 --- a/db/schema_migrations/20190301081611 +++ /dev/null @@ -1 +0,0 @@ -3bab89fa4b95f022ec5a17a1fd3c006f7f822091f35e3db923e1b8f0ca7c0b3e
\ No newline at end of file diff --git a/db/schema_migrations/20190301182457 b/db/schema_migrations/20190301182457 deleted file mode 100644 index 671779d1714..00000000000 --- a/db/schema_migrations/20190301182457 +++ /dev/null @@ -1 +0,0 @@ -43b776baffd1c8c2e0731c3d897aa3b4f043faa79132dcd2b73d06ee53641f92
\ No newline at end of file diff --git a/db/schema_migrations/20190312071108 b/db/schema_migrations/20190312071108 deleted file mode 100644 index ff788bf449a..00000000000 --- a/db/schema_migrations/20190312071108 +++ /dev/null @@ -1 +0,0 @@ -85a35b85d9c6c484cea1991504d2406f752c09929d2770309d475feee238f69c
\ No newline at end of file diff --git a/db/schema_migrations/20190312113229 b/db/schema_migrations/20190312113229 deleted file mode 100644 index 487ec48f404..00000000000 --- a/db/schema_migrations/20190312113229 +++ /dev/null @@ -1 +0,0 @@ -2028ff93a38e1788d91884f63689d35163cf01ced7e7a049184f2081a18cdafd
\ No newline at end of file diff --git a/db/schema_migrations/20190312113634 b/db/schema_migrations/20190312113634 deleted file mode 100644 index 0f764bc0e0a..00000000000 --- a/db/schema_migrations/20190312113634 +++ /dev/null @@ -1 +0,0 @@ -52626206f5779839a1d5b2a4910ae3f79adcaa617d21816b25dd8eb18d0f234e
\ No newline at end of file diff --git a/db/schema_migrations/20190313092516 b/db/schema_migrations/20190313092516 deleted file mode 100644 index ba4de300985..00000000000 --- a/db/schema_migrations/20190313092516 +++ /dev/null @@ -1 +0,0 @@ -b81fd5f350588d2326c97bd061f3b7c3ab97023e445335ad3d848c8eb2c14f48
\ No newline at end of file diff --git a/db/schema_migrations/20190315191339 b/db/schema_migrations/20190315191339 deleted file mode 100644 index 3245749bb3e..00000000000 --- a/db/schema_migrations/20190315191339 +++ /dev/null @@ -1 +0,0 @@ -3a8bd7f70351a26ba827ad4e3a63e374c9065e232109925286f6ff0d79430b7b
\ No newline at end of file diff --git a/db/schema_migrations/20190320174702 b/db/schema_migrations/20190320174702 deleted file mode 100644 index 56231223122..00000000000 --- a/db/schema_migrations/20190320174702 +++ /dev/null @@ -1 +0,0 @@ -8a180702a02279a67245c4fa90fd168ee86d373597902fcf5acd2ca5ed5bb5ee
\ No newline at end of file diff --git a/db/schema_migrations/20190322132835 b/db/schema_migrations/20190322132835 deleted file mode 100644 index 990aaf1701d..00000000000 --- a/db/schema_migrations/20190322132835 +++ /dev/null @@ -1 +0,0 @@ -56c444f12de56f3e31c723632944a7dacd7eb256760ea268a97f8a02f6365491
\ No newline at end of file diff --git a/db/schema_migrations/20190322164830 b/db/schema_migrations/20190322164830 deleted file mode 100644 index 8c1d40a8203..00000000000 --- a/db/schema_migrations/20190322164830 +++ /dev/null @@ -1 +0,0 @@ -ad03fde4d9311607d920e6bddde19b0f96a2ee7ed3199d6eb5f9b111df25a525
\ No newline at end of file diff --git a/db/schema_migrations/20190325080727 b/db/schema_migrations/20190325080727 deleted file mode 100644 index 1fe4949ba8e..00000000000 --- a/db/schema_migrations/20190325080727 +++ /dev/null @@ -1 +0,0 @@ -77e3fe2b1a968a4be27b7150ea993de11028b876905f30d381bc08263dab0d3f
\ No newline at end of file diff --git a/db/schema_migrations/20190325105715 b/db/schema_migrations/20190325105715 deleted file mode 100644 index 7c179827543..00000000000 --- a/db/schema_migrations/20190325105715 +++ /dev/null @@ -1 +0,0 @@ -c674d2f2cf2147125760613edfea332860f90a9cc1e1d9f3c857aa0b033d8912
\ No newline at end of file diff --git a/db/schema_migrations/20190325111602 b/db/schema_migrations/20190325111602 deleted file mode 100644 index 271e447435a..00000000000 --- a/db/schema_migrations/20190325111602 +++ /dev/null @@ -1 +0,0 @@ -3fac4d070229a0534a3b98d5f80c814c5564881b24837289207769b9a235e808
\ No newline at end of file diff --git a/db/schema_migrations/20190325165127 b/db/schema_migrations/20190325165127 deleted file mode 100644 index 88d90cd99e9..00000000000 --- a/db/schema_migrations/20190325165127 +++ /dev/null @@ -1 +0,0 @@ -9b7ebd3a5456b55a73ae1f7d504c36485d0b15f9e2b7ad3f43c71cbfd65720f1
\ No newline at end of file diff --git a/db/schema_migrations/20190326164045 b/db/schema_migrations/20190326164045 deleted file mode 100644 index a1ca6378508..00000000000 --- a/db/schema_migrations/20190326164045 +++ /dev/null @@ -1 +0,0 @@ -69ed3746ead7d706c62fd5287e9df3a496dc9d17d344a6c43b511db3e2467667
\ No newline at end of file diff --git a/db/schema_migrations/20190327163904 b/db/schema_migrations/20190327163904 deleted file mode 100644 index c0e4070375a..00000000000 --- a/db/schema_migrations/20190327163904 +++ /dev/null @@ -1 +0,0 @@ -08f49ff72142d860dac3fc70444523d0c89912d1be85a994c17411e4748b9099
\ No newline at end of file diff --git a/db/schema_migrations/20190329085614 b/db/schema_migrations/20190329085614 deleted file mode 100644 index 069e3e0e86e..00000000000 --- a/db/schema_migrations/20190329085614 +++ /dev/null @@ -1 +0,0 @@ -a58e6d439a97f378d280aee285a3662525a971ddf11761e0ae3c3093163499db
\ No newline at end of file diff --git a/db/schema_migrations/20190402150158 b/db/schema_migrations/20190402150158 deleted file mode 100644 index 282cc3f5f9d..00000000000 --- a/db/schema_migrations/20190402150158 +++ /dev/null @@ -1 +0,0 @@ -4501b35c0661f0ef6a3cd46db5d48f90b2131a1ae30bd73b442ed56ac6655e8d
\ No newline at end of file diff --git a/db/schema_migrations/20190403161806 b/db/schema_migrations/20190403161806 deleted file mode 100644 index 41e390d6d83..00000000000 --- a/db/schema_migrations/20190403161806 +++ /dev/null @@ -1 +0,0 @@ -fd69f104fb0707d622bc8c7955481b277907e919a2423cc7e35f68e76544a304
\ No newline at end of file diff --git a/db/schema_migrations/20190404143330 b/db/schema_migrations/20190404143330 deleted file mode 100644 index da8b26709c1..00000000000 --- a/db/schema_migrations/20190404143330 +++ /dev/null @@ -1 +0,0 @@ -dc1704bbed4f8d7e285e8edf9e6d537c8e720f4737f76b089532c6a0712d132a
\ No newline at end of file diff --git a/db/schema_migrations/20190404231137 b/db/schema_migrations/20190404231137 deleted file mode 100644 index 0cc8f0e1203..00000000000 --- a/db/schema_migrations/20190404231137 +++ /dev/null @@ -1 +0,0 @@ -32f6313383609eb5abd9082e51ddc5719766c3d74d0cc5d776535f52ffddd5bb
\ No newline at end of file diff --git a/db/schema_migrations/20190408163745 b/db/schema_migrations/20190408163745 deleted file mode 100644 index 04fe7efa73a..00000000000 --- a/db/schema_migrations/20190408163745 +++ /dev/null @@ -1 +0,0 @@ -47d77dd636c35cd2c7f9bc2de035899548052a2005f29735d078f054c02bee7c
\ No newline at end of file diff --git a/db/schema_migrations/20190409224933 b/db/schema_migrations/20190409224933 deleted file mode 100644 index e6c3eb0da22..00000000000 --- a/db/schema_migrations/20190409224933 +++ /dev/null @@ -1 +0,0 @@ -f3fd28e093775afa4f8e94b2355c1b5a6dc5d3138d31faa44b6d70a2f7dc3f88
\ No newline at end of file diff --git a/db/schema_migrations/20190410173409 b/db/schema_migrations/20190410173409 deleted file mode 100644 index 7134339796a..00000000000 --- a/db/schema_migrations/20190410173409 +++ /dev/null @@ -1 +0,0 @@ -6c2980e7e9056aa8966bb3e5b2547d9ef85da1b1bc25d5bd2acc1d218f52f14b
\ No newline at end of file diff --git a/db/schema_migrations/20190412155659 b/db/schema_migrations/20190412155659 deleted file mode 100644 index 8db412696ce..00000000000 --- a/db/schema_migrations/20190412155659 +++ /dev/null @@ -1 +0,0 @@ -62a8e24ba6fb73cd35bbeef9db6ea8827be117e86b5c0b72caeedfab078a5d5d
\ No newline at end of file diff --git a/db/schema_migrations/20190412183653 b/db/schema_migrations/20190412183653 deleted file mode 100644 index 8e5783e5afc..00000000000 --- a/db/schema_migrations/20190412183653 +++ /dev/null @@ -1 +0,0 @@ -6760598e05fbf57a005ef680b461d9dfea0481e7e5a8ec295926976cbf674e79
\ No newline at end of file diff --git a/db/schema_migrations/20190414185432 b/db/schema_migrations/20190414185432 deleted file mode 100644 index e35b69c4057..00000000000 --- a/db/schema_migrations/20190414185432 +++ /dev/null @@ -1 +0,0 @@ -7155530822ffefff7419ea8d5e319a01af58b64cffe56673cb78e8305b834921
\ No newline at end of file diff --git a/db/schema_migrations/20190415030217 b/db/schema_migrations/20190415030217 deleted file mode 100644 index cf96941c58a..00000000000 --- a/db/schema_migrations/20190415030217 +++ /dev/null @@ -1 +0,0 @@ -c3c9010876f7cd32f1ffa858fb35e530f64dad1e8d86962ee3c2a2d63ec052ec
\ No newline at end of file diff --git a/db/schema_migrations/20190415095825 b/db/schema_migrations/20190415095825 deleted file mode 100644 index d13d1f9be19..00000000000 --- a/db/schema_migrations/20190415095825 +++ /dev/null @@ -1 +0,0 @@ -883a00ae98969170f5f09842b04002145abb5f7e5e253e285eacc71828214ad0
\ No newline at end of file diff --git a/db/schema_migrations/20190415172035 b/db/schema_migrations/20190415172035 deleted file mode 100644 index 2ec55a9344b..00000000000 --- a/db/schema_migrations/20190415172035 +++ /dev/null @@ -1 +0,0 @@ -a9e2aed5e1b0ebcdd83b082777fef905bdbec7976a88af8a5393024032d4a61a
\ No newline at end of file diff --git a/db/schema_migrations/20190416185130 b/db/schema_migrations/20190416185130 deleted file mode 100644 index 0a649490d3b..00000000000 --- a/db/schema_migrations/20190416185130 +++ /dev/null @@ -1 +0,0 @@ -96c1a1ccfecd82e93fd77dcaf957c7dc5e9604e18579cf06603f5e62b8816cd0
\ No newline at end of file diff --git a/db/schema_migrations/20190416213556 b/db/schema_migrations/20190416213556 deleted file mode 100644 index a6afa258846..00000000000 --- a/db/schema_migrations/20190416213556 +++ /dev/null @@ -1 +0,0 @@ -67ef8b059ebcfbfd447a1c2fee9628344a97aee1d7280722b507e8c59dec8944
\ No newline at end of file diff --git a/db/schema_migrations/20190416213615 b/db/schema_migrations/20190416213615 deleted file mode 100644 index effee0822ee..00000000000 --- a/db/schema_migrations/20190416213615 +++ /dev/null @@ -1 +0,0 @@ -7ac526e1cc920771f43333cebf6792ac41e1b0c4364eb8e0eaa955008801d45e
\ No newline at end of file diff --git a/db/schema_migrations/20190416213631 b/db/schema_migrations/20190416213631 deleted file mode 100644 index c94ba4fd5b2..00000000000 --- a/db/schema_migrations/20190416213631 +++ /dev/null @@ -1 +0,0 @@ -87782324f2922befcc1b6796dfed84c31f71022a725303428cc7c6e49422184c
\ No newline at end of file diff --git a/db/schema_migrations/20190418132125 b/db/schema_migrations/20190418132125 deleted file mode 100644 index 6a8c766a3fa..00000000000 --- a/db/schema_migrations/20190418132125 +++ /dev/null @@ -1 +0,0 @@ -a3980532461ee91172a91763d5380770d8b0c2bca5a3135e72617ea24e0d0ac8
\ No newline at end of file diff --git a/db/schema_migrations/20190418132750 b/db/schema_migrations/20190418132750 deleted file mode 100644 index ddc987390ba..00000000000 --- a/db/schema_migrations/20190418132750 +++ /dev/null @@ -1 +0,0 @@ -ee96740f57b428f12b1ccfb082ac37a53b713495067652eb4deb470c8044aeda
\ No newline at end of file diff --git a/db/schema_migrations/20190418182545 b/db/schema_migrations/20190418182545 deleted file mode 100644 index 76eba7cf4af..00000000000 --- a/db/schema_migrations/20190418182545 +++ /dev/null @@ -1 +0,0 @@ -1f07b87a2330c84adcf34c163276afeb7e360bd797f79d26afd58cc80cd449fe
\ No newline at end of file diff --git a/db/schema_migrations/20190419121952 b/db/schema_migrations/20190419121952 deleted file mode 100644 index fe75181492b..00000000000 --- a/db/schema_migrations/20190419121952 +++ /dev/null @@ -1 +0,0 @@ -bec13ef72249efab67c8e89ec78acfff6aee6d9d2e15f7d16d7e8f630142410b
\ No newline at end of file diff --git a/db/schema_migrations/20190419123057 b/db/schema_migrations/20190419123057 deleted file mode 100644 index 4dfaafa73cb..00000000000 --- a/db/schema_migrations/20190419123057 +++ /dev/null @@ -1 +0,0 @@ -f63e65742f287eae6de42676655f47faed5ad2cdd999d2f24169beebfd90df6a
\ No newline at end of file diff --git a/db/schema_migrations/20190422082247 b/db/schema_migrations/20190422082247 deleted file mode 100644 index dcfec7aa6ad..00000000000 --- a/db/schema_migrations/20190422082247 +++ /dev/null @@ -1 +0,0 @@ -66792bafc4b8dbe42f8c9e8112344f7e4aac24c7d4a214dd8d9c35111e93f2de
\ No newline at end of file diff --git a/db/schema_migrations/20190423124640 b/db/schema_migrations/20190423124640 deleted file mode 100644 index 42087906694..00000000000 --- a/db/schema_migrations/20190423124640 +++ /dev/null @@ -1 +0,0 @@ -9a58f5a97883e97b340c9170d8259a081bb7b6ac82f58a7729cc7aee3a34814f
\ No newline at end of file diff --git a/db/schema_migrations/20190424134256 b/db/schema_migrations/20190424134256 deleted file mode 100644 index 0e6e7fef6dd..00000000000 --- a/db/schema_migrations/20190424134256 +++ /dev/null @@ -1 +0,0 @@ -c05439f0c95c3278389dd50ee395212ff132f3db5bdda06805b1d8d0000054d8
\ No newline at end of file diff --git a/db/schema_migrations/20190426180107 b/db/schema_migrations/20190426180107 deleted file mode 100644 index de83271a3f2..00000000000 --- a/db/schema_migrations/20190426180107 +++ /dev/null @@ -1 +0,0 @@ -ca82f05a9d25e7dde29d678b3db88338dcd22ec0969a47053cb435f3fe24d3d2
\ No newline at end of file diff --git a/db/schema_migrations/20190429082448 b/db/schema_migrations/20190429082448 deleted file mode 100644 index 99ae471395a..00000000000 --- a/db/schema_migrations/20190429082448 +++ /dev/null @@ -1 +0,0 @@ -a35c3db7b3be33721141f30634e65a72f26b2858a6c57121a0c68c689c40789a
\ No newline at end of file diff --git a/db/schema_migrations/20190430131225 b/db/schema_migrations/20190430131225 deleted file mode 100644 index 3c12a6f445d..00000000000 --- a/db/schema_migrations/20190430131225 +++ /dev/null @@ -1 +0,0 @@ -d7f74861d06aaaacf9d05f16a6659e8c93deeed297d4eec93fe0262fef11184d
\ No newline at end of file diff --git a/db/schema_migrations/20190430142025 b/db/schema_migrations/20190430142025 deleted file mode 100644 index a498ab346ed..00000000000 --- a/db/schema_migrations/20190430142025 +++ /dev/null @@ -1 +0,0 @@ -b9e011b738ee260a804295a7efeb91fb6c40ae5d24cfcc4b7614478eabc06504
\ No newline at end of file diff --git a/db/schema_migrations/20190506135337 b/db/schema_migrations/20190506135337 deleted file mode 100644 index 6b8dfa5c410..00000000000 --- a/db/schema_migrations/20190506135337 +++ /dev/null @@ -1 +0,0 @@ -7a37879b82367f2792900e286cd50546607525a2888ee6ffea7b9945f828e107
\ No newline at end of file diff --git a/db/schema_migrations/20190506135400 b/db/schema_migrations/20190506135400 deleted file mode 100644 index 7e20423d0fe..00000000000 --- a/db/schema_migrations/20190506135400 +++ /dev/null @@ -1 +0,0 @@ -b9290414944590f81e6bf90840f966d32f5205c839b086a73b59e28119fbe075
\ No newline at end of file diff --git a/db/schema_migrations/20190511144331 b/db/schema_migrations/20190511144331 deleted file mode 100644 index 0f5a8cac075..00000000000 --- a/db/schema_migrations/20190511144331 +++ /dev/null @@ -1 +0,0 @@ -7f4212cfe2895b14992d02150915b9c68ca537f5b69acaf286815c0697d9ccf8
\ No newline at end of file diff --git a/db/schema_migrations/20190513174947 b/db/schema_migrations/20190513174947 deleted file mode 100644 index ba44be223d5..00000000000 --- a/db/schema_migrations/20190513174947 +++ /dev/null @@ -1 +0,0 @@ -e5778ed38cfb813985a0070cb8120864a575d996a7a83f42a41f6ad1e4b90748
\ No newline at end of file diff --git a/db/schema_migrations/20190514105711 b/db/schema_migrations/20190514105711 deleted file mode 100644 index 9985a90dbfb..00000000000 --- a/db/schema_migrations/20190514105711 +++ /dev/null @@ -1 +0,0 @@ -ffe125d215b0c65ce1ca4801e3b78381381c73b8056d95bd024cd5382570fba0
\ No newline at end of file diff --git a/db/schema_migrations/20190515125613 b/db/schema_migrations/20190515125613 deleted file mode 100644 index c20946369f9..00000000000 --- a/db/schema_migrations/20190515125613 +++ /dev/null @@ -1 +0,0 @@ -3a7371d1496098c700d0769994cb01f49f834904d4e6176ea2250d4ea34aed6b
\ No newline at end of file diff --git a/db/schema_migrations/20190516011213 b/db/schema_migrations/20190516011213 deleted file mode 100644 index d880a478fbf..00000000000 --- a/db/schema_migrations/20190516011213 +++ /dev/null @@ -1 +0,0 @@ -367010e0e41cd29fda7e4580bfdd080ebcdd858382c52213cf9765c56e7a5fdf
\ No newline at end of file diff --git a/db/schema_migrations/20190516151857 b/db/schema_migrations/20190516151857 deleted file mode 100644 index d96e812b54a..00000000000 --- a/db/schema_migrations/20190516151857 +++ /dev/null @@ -1 +0,0 @@ -fd37070c5d59d050b48bfcebfeeff703f3368774df3445993623a6ec73f62396
\ No newline at end of file diff --git a/db/schema_migrations/20190516155724 b/db/schema_migrations/20190516155724 deleted file mode 100644 index a75bc76c9ab..00000000000 --- a/db/schema_migrations/20190516155724 +++ /dev/null @@ -1 +0,0 @@ -87361447d851dff62b599e4578d469a373d6e71b0ba30bb424a3c7b13cdb0a0d
\ No newline at end of file diff --git a/db/schema_migrations/20190517153211 b/db/schema_migrations/20190517153211 deleted file mode 100644 index 44c71eb8a04..00000000000 --- a/db/schema_migrations/20190517153211 +++ /dev/null @@ -1 +0,0 @@ -d763d436102851337ff4d667fa6f11958ecd24251acd138feae18a1549b523c8
\ No newline at end of file diff --git a/db/schema_migrations/20190520200123 b/db/schema_migrations/20190520200123 deleted file mode 100644 index f4a29b16d4e..00000000000 --- a/db/schema_migrations/20190520200123 +++ /dev/null @@ -1 +0,0 @@ -7e1baeb3a7664b668bbf10c1399d99ace8ec0050537cfe1637a56546a11993d6
\ No newline at end of file diff --git a/db/schema_migrations/20190520201748 b/db/schema_migrations/20190520201748 deleted file mode 100644 index d3a2e7ae017..00000000000 --- a/db/schema_migrations/20190520201748 +++ /dev/null @@ -1 +0,0 @@ -0dc814eaab3c9b9df422cdb26b116c22b35a14fd90fe4c4ff388868d31bf54fc
\ No newline at end of file diff --git a/db/schema_migrations/20190521174505 b/db/schema_migrations/20190521174505 deleted file mode 100644 index fc21aab73ef..00000000000 --- a/db/schema_migrations/20190521174505 +++ /dev/null @@ -1 +0,0 @@ -a776caf05daa2921442913187335e230683034c7b28a847410ec149bd73c2d85
\ No newline at end of file diff --git a/db/schema_migrations/20190522143720 b/db/schema_migrations/20190522143720 deleted file mode 100644 index 795fb9452c9..00000000000 --- a/db/schema_migrations/20190522143720 +++ /dev/null @@ -1 +0,0 @@ -e313e0902106da890ef0bf2e292b66377a306521c53b592a41ff1d0aa3093773
\ No newline at end of file diff --git a/db/schema_migrations/20190523112344 b/db/schema_migrations/20190523112344 deleted file mode 100644 index 08930b99aac..00000000000 --- a/db/schema_migrations/20190523112344 +++ /dev/null @@ -1 +0,0 @@ -7ead29c04ea8285a5660546183469941b2e7dd2e73dea2b6c64cf4d640271f85
\ No newline at end of file diff --git a/db/schema_migrations/20190524062810 b/db/schema_migrations/20190524062810 deleted file mode 100644 index 0d9bac494aa..00000000000 --- a/db/schema_migrations/20190524062810 +++ /dev/null @@ -1 +0,0 @@ -a1e08ba597e365bd18b1272089189a4417e2353ed80926d52a1eb8a0cfddee22
\ No newline at end of file diff --git a/db/schema_migrations/20190524071727 b/db/schema_migrations/20190524071727 deleted file mode 100644 index c63a56f5040..00000000000 --- a/db/schema_migrations/20190524071727 +++ /dev/null @@ -1 +0,0 @@ -5e495b65103d5506efcb95eab0ed07aa64448bb19f2a83137ec51e09aa6675d7
\ No newline at end of file diff --git a/db/schema_migrations/20190524073827 b/db/schema_migrations/20190524073827 deleted file mode 100644 index 3d152f83be9..00000000000 --- a/db/schema_migrations/20190524073827 +++ /dev/null @@ -1 +0,0 @@ -a090ed64202749ed3b108491757072f62d93a21c9795b5b48b88b568d13de2f1
\ No newline at end of file diff --git a/db/schema_migrations/20190527011309 b/db/schema_migrations/20190527011309 deleted file mode 100644 index 101c0b7a7bc..00000000000 --- a/db/schema_migrations/20190527011309 +++ /dev/null @@ -1 +0,0 @@ -6b85fc6767490e4e45e8f18ab828296c4f6103811a0fe44ea840e8da146cb0b1
\ No newline at end of file diff --git a/db/schema_migrations/20190527194830 b/db/schema_migrations/20190527194830 deleted file mode 100644 index a647f31c58d..00000000000 --- a/db/schema_migrations/20190527194830 +++ /dev/null @@ -1 +0,0 @@ -935dc61bec02fa364dd288a67244d8d604ef304c690ef1243c3cd0483e00c356
\ No newline at end of file diff --git a/db/schema_migrations/20190527194900 b/db/schema_migrations/20190527194900 deleted file mode 100644 index 05bdfe7dcf4..00000000000 --- a/db/schema_migrations/20190527194900 +++ /dev/null @@ -1 +0,0 @@ -f05f4728c295f5b90ef1662a223e6a265d1598159592286f6a23578f434d2121
\ No newline at end of file diff --git a/db/schema_migrations/20190528173628 b/db/schema_migrations/20190528173628 deleted file mode 100644 index dffeef637ec..00000000000 --- a/db/schema_migrations/20190528173628 +++ /dev/null @@ -1 +0,0 @@ -a7e5d565f568c7963add43d4936115a64256d1cd925d0415a46ff567bf14848f
\ No newline at end of file diff --git a/db/schema_migrations/20190528180441 b/db/schema_migrations/20190528180441 deleted file mode 100644 index 4497b2b8449..00000000000 --- a/db/schema_migrations/20190528180441 +++ /dev/null @@ -1 +0,0 @@ -786807c18fa81892be66c977cc46cf0bef023cb95ee1759330621bb79c11955e
\ No newline at end of file diff --git a/db/schema_migrations/20190529142545 b/db/schema_migrations/20190529142545 deleted file mode 100644 index 5860afac439..00000000000 --- a/db/schema_migrations/20190529142545 +++ /dev/null @@ -1 +0,0 @@ -68d16c1d3811ef365ae815e9da96370537b8f7d4c25aa71287f7b37c8c764b03
\ No newline at end of file diff --git a/db/schema_migrations/20190530042141 b/db/schema_migrations/20190530042141 deleted file mode 100644 index 41cc48a9d1b..00000000000 --- a/db/schema_migrations/20190530042141 +++ /dev/null @@ -1 +0,0 @@ -2583953e1ee878bc3c892e3afd363ddfe0e9f49467a9345f751f999ad6f0c8d0
\ No newline at end of file diff --git a/db/schema_migrations/20190530154715 b/db/schema_migrations/20190530154715 deleted file mode 100644 index 51772a0715a..00000000000 --- a/db/schema_migrations/20190530154715 +++ /dev/null @@ -1 +0,0 @@ -1240ce7849fd8111f7917f39afe477730ffbfb8cb0ab11c5134bf6cc6803abd9
\ No newline at end of file diff --git a/db/schema_migrations/20190531153110 b/db/schema_migrations/20190531153110 deleted file mode 100644 index ad1d33ddbd7..00000000000 --- a/db/schema_migrations/20190531153110 +++ /dev/null @@ -1 +0,0 @@ -afcab81b5e162ef24ae02d53be845816043fa75eaf13c6330982b53a575849ce
\ No newline at end of file diff --git a/db/schema_migrations/20190602014139 b/db/schema_migrations/20190602014139 deleted file mode 100644 index cb6573f068e..00000000000 --- a/db/schema_migrations/20190602014139 +++ /dev/null @@ -1 +0,0 @@ -aa6fd9356f8b8d2e002c97b3b3592e73d6b0dd146b20ad4703fa9f4a43b6cbec
\ No newline at end of file diff --git a/db/schema_migrations/20190603124955 b/db/schema_migrations/20190603124955 deleted file mode 100644 index af9f93d017f..00000000000 --- a/db/schema_migrations/20190603124955 +++ /dev/null @@ -1 +0,0 @@ -ee146a0cce8acfde0f89b7fce8480474f2df9de028c7736f4cd4690ffb5c075a
\ No newline at end of file diff --git a/db/schema_migrations/20190604091310 b/db/schema_migrations/20190604091310 deleted file mode 100644 index 2d367af3872..00000000000 --- a/db/schema_migrations/20190604091310 +++ /dev/null @@ -1 +0,0 @@ -504a65f9efc57883172fdcb59b738e8fcd1c2cf580c604a520a84ec922b4d105
\ No newline at end of file diff --git a/db/schema_migrations/20190604184643 b/db/schema_migrations/20190604184643 deleted file mode 100644 index acf6af1d4ce..00000000000 --- a/db/schema_migrations/20190604184643 +++ /dev/null @@ -1 +0,0 @@ -dc03c37f956fbd004ca336e705038f220fe5a02a46feeeca8d63e80f2fe6cb8a
\ No newline at end of file diff --git a/db/schema_migrations/20190605104727 b/db/schema_migrations/20190605104727 deleted file mode 100644 index 9f1323a9815..00000000000 --- a/db/schema_migrations/20190605104727 +++ /dev/null @@ -1 +0,0 @@ -37497e9cc9185acebe62e9ea24898e37224917af6d0e93e381edc0d9631d53a4
\ No newline at end of file diff --git a/db/schema_migrations/20190605184422 b/db/schema_migrations/20190605184422 deleted file mode 100644 index 4993d5f9ebb..00000000000 --- a/db/schema_migrations/20190605184422 +++ /dev/null @@ -1 +0,0 @@ -0fb5e9c6bdaf8e2acb2c9c8a63100f5663aa671f62e07fa33fe99edbce85fcb9
\ No newline at end of file diff --git a/db/schema_migrations/20190606014128 b/db/schema_migrations/20190606014128 deleted file mode 100644 index d4a92366e61..00000000000 --- a/db/schema_migrations/20190606014128 +++ /dev/null @@ -1 +0,0 @@ -cb1b1b375fb69e3c6f33d3e696f4ef785452573935c5a96243f13ecab5a187a3
\ No newline at end of file diff --git a/db/schema_migrations/20190606034427 b/db/schema_migrations/20190606034427 deleted file mode 100644 index a4951e638c6..00000000000 --- a/db/schema_migrations/20190606034427 +++ /dev/null @@ -1 +0,0 @@ -f3e40533908868437f317a963038178cb0a04c7b6b1abfb8dd6d0ae169a9a209
\ No newline at end of file diff --git a/db/schema_migrations/20190606054649 b/db/schema_migrations/20190606054649 deleted file mode 100644 index 67a626f8452..00000000000 --- a/db/schema_migrations/20190606054649 +++ /dev/null @@ -1 +0,0 @@ -1bafcb781a7d8cd16f5526e9a8f5e3f0c7dd17de9d5595c32453d2c009673c0a
\ No newline at end of file diff --git a/db/schema_migrations/20190606054742 b/db/schema_migrations/20190606054742 deleted file mode 100644 index 23d4b29bb90..00000000000 --- a/db/schema_migrations/20190606054742 +++ /dev/null @@ -1 +0,0 @@ -22640305aae7467ce244b1a9225de5cbc90db787b1baa277f991350e21a85108
\ No newline at end of file diff --git a/db/schema_migrations/20190606054832 b/db/schema_migrations/20190606054832 deleted file mode 100644 index e41d65512e6..00000000000 --- a/db/schema_migrations/20190606054832 +++ /dev/null @@ -1 +0,0 @@ -3c79d8f1867480104fd4c29affd02095202e4d39922482be82914a072a5f02e7
\ No newline at end of file diff --git a/db/schema_migrations/20190606163724 b/db/schema_migrations/20190606163724 deleted file mode 100644 index a003d9dd3ef..00000000000 --- a/db/schema_migrations/20190606163724 +++ /dev/null @@ -1 +0,0 @@ -52342ab4e26e39ca4682d8f3ee731617de051b3029ce5a7d97b7bf5a50a124d5
\ No newline at end of file diff --git a/db/schema_migrations/20190606175050 b/db/schema_migrations/20190606175050 deleted file mode 100644 index 43a2f6c3de1..00000000000 --- a/db/schema_migrations/20190606175050 +++ /dev/null @@ -1 +0,0 @@ -1ecf4228ce976c3f233e13aa6868e43d6d5104d0e8a479abc74f857a6d9cafce
\ No newline at end of file diff --git a/db/schema_migrations/20190606202100 b/db/schema_migrations/20190606202100 deleted file mode 100644 index 6d4b870bcf0..00000000000 --- a/db/schema_migrations/20190606202100 +++ /dev/null @@ -1 +0,0 @@ -f83d5d357ecb172e9ea9456d8d4209c42c124db075f05207e81dd33cfef2f5c3
\ No newline at end of file diff --git a/db/schema_migrations/20190607085356 b/db/schema_migrations/20190607085356 deleted file mode 100644 index 403f450b009..00000000000 --- a/db/schema_migrations/20190607085356 +++ /dev/null @@ -1 +0,0 @@ -03a357ec9004e70efa1f93f79e21045219518901e245fa75fb8b943aca92725e
\ No newline at end of file diff --git a/db/schema_migrations/20190607145325 b/db/schema_migrations/20190607145325 deleted file mode 100644 index ced928bf8d1..00000000000 --- a/db/schema_migrations/20190607145325 +++ /dev/null @@ -1 +0,0 @@ -db85869c90ab5ab42a18b4d2e82bdd86957b32ef3e433715a89c14091b7d0616
\ No newline at end of file diff --git a/db/schema_migrations/20190607190856 b/db/schema_migrations/20190607190856 deleted file mode 100644 index 9a56d9d4dfd..00000000000 --- a/db/schema_migrations/20190607190856 +++ /dev/null @@ -1 +0,0 @@ -d63160a517e26c56e72f6c08557af6a7e1798306bfa8fc8b552b86e0343cdb26
\ No newline at end of file diff --git a/db/schema_migrations/20190607205656 b/db/schema_migrations/20190607205656 deleted file mode 100644 index a63622f3ea2..00000000000 --- a/db/schema_migrations/20190607205656 +++ /dev/null @@ -1 +0,0 @@ -5bafb21d8d5b4651a1bae9e9dd184b4e4ac99a179068d1bc117b97f1c83a9796
\ No newline at end of file diff --git a/db/schema_migrations/20190610142825 b/db/schema_migrations/20190610142825 deleted file mode 100644 index 56c1833bd44..00000000000 --- a/db/schema_migrations/20190610142825 +++ /dev/null @@ -1 +0,0 @@ -e1834da62fe919f9d93b80c97319266a4494f1a14833f7be6637a562591f6236
\ No newline at end of file diff --git a/db/schema_migrations/20190611090827 b/db/schema_migrations/20190611090827 deleted file mode 100644 index b13743f7b66..00000000000 --- a/db/schema_migrations/20190611090827 +++ /dev/null @@ -1 +0,0 @@ -39cd7fa15659e7afcda7e59599e2b971c56fd5097105bbd4bf99c92ada398b99
\ No newline at end of file diff --git a/db/schema_migrations/20190611100201 b/db/schema_migrations/20190611100201 deleted file mode 100644 index bd94fb72901..00000000000 --- a/db/schema_migrations/20190611100201 +++ /dev/null @@ -1 +0,0 @@ -d23880fd9f984318f91f4f27136a90c23659c14983d2fc59402372121ec632a9
\ No newline at end of file diff --git a/db/schema_migrations/20190611100202 b/db/schema_migrations/20190611100202 deleted file mode 100644 index 1d72fc158d2..00000000000 --- a/db/schema_migrations/20190611100202 +++ /dev/null @@ -1 +0,0 @@ -45c181d994822f92a984fc5d51c40db4a813e5eb083979114d2be0dc46e5fb4b
\ No newline at end of file diff --git a/db/schema_migrations/20190611161641 b/db/schema_migrations/20190611161641 deleted file mode 100644 index 6e84592f40e..00000000000 --- a/db/schema_migrations/20190611161641 +++ /dev/null @@ -1 +0,0 @@ -0de36ee37bc4e7e0a53cefb3a254e0b7445fc26b394f5b0fe0ffff0e225994e4
\ No newline at end of file diff --git a/db/schema_migrations/20190611161642 b/db/schema_migrations/20190611161642 deleted file mode 100644 index 2a2f41e8337..00000000000 --- a/db/schema_migrations/20190611161642 +++ /dev/null @@ -1 +0,0 @@ -d91a41584d6deb62a4c3884a9bf8df290fd232593d330b1332f8a34873a6ea00
\ No newline at end of file diff --git a/db/schema_migrations/20190612111201 b/db/schema_migrations/20190612111201 deleted file mode 100644 index 3cb0deb644f..00000000000 --- a/db/schema_migrations/20190612111201 +++ /dev/null @@ -1 +0,0 @@ -998cc01599f4ce7e3544e1551ec238ee53d15e226f5a5dec0920d7bd04031105
\ No newline at end of file diff --git a/db/schema_migrations/20190612111404 b/db/schema_migrations/20190612111404 deleted file mode 100644 index b6e7b3d3548..00000000000 --- a/db/schema_migrations/20190612111404 +++ /dev/null @@ -1 +0,0 @@ -2f2a8d4bc77d1e67c5625acc6a9482a07147bf0620ecd17dc71ad543b97b66b3
\ No newline at end of file diff --git a/db/schema_migrations/20190613030606 b/db/schema_migrations/20190613030606 deleted file mode 100644 index 560a9393d1f..00000000000 --- a/db/schema_migrations/20190613030606 +++ /dev/null @@ -1 +0,0 @@ -ebdd40a0903fbdf8826dbf9ab1d995cb4aefc336c8adbc8a2d1dbb07418aa48e
\ No newline at end of file diff --git a/db/schema_migrations/20190613044655 b/db/schema_migrations/20190613044655 deleted file mode 100644 index c7cbd43115b..00000000000 --- a/db/schema_migrations/20190613044655 +++ /dev/null @@ -1 +0,0 @@ -ed2a16e4096acb1476cf452245abe37e3fe11ccfbf8f84dbbf56be3c80238e80
\ No newline at end of file diff --git a/db/schema_migrations/20190613073003 b/db/schema_migrations/20190613073003 deleted file mode 100644 index 451d6ab7b6e..00000000000 --- a/db/schema_migrations/20190613073003 +++ /dev/null @@ -1 +0,0 @@ -9d6603760854e72c812894c1290ad6cb4067c2145fe5bdfa0c4d971398db409b
\ No newline at end of file diff --git a/db/schema_migrations/20190613231640 b/db/schema_migrations/20190613231640 deleted file mode 100644 index e9ea84f27b8..00000000000 --- a/db/schema_migrations/20190613231640 +++ /dev/null @@ -1 +0,0 @@ -32914670dedaddceeba21519343deb11dc79b027b491e2ecf9566874f0794e2e
\ No newline at end of file diff --git a/db/schema_migrations/20190617123615 b/db/schema_migrations/20190617123615 deleted file mode 100644 index c5c7053d51f..00000000000 --- a/db/schema_migrations/20190617123615 +++ /dev/null @@ -1 +0,0 @@ -e4497740a3f33e37b2ed14bc9f3b67a29af91cdcdc40c44ac6ef896047957046
\ No newline at end of file diff --git a/db/schema_migrations/20190618171120 b/db/schema_migrations/20190618171120 deleted file mode 100644 index 6c28a884641..00000000000 --- a/db/schema_migrations/20190618171120 +++ /dev/null @@ -1 +0,0 @@ -a41ac00d0dbb71e23e224e5cddf65891efb83167fdeef2568f10420e6362c794
\ No newline at end of file diff --git a/db/schema_migrations/20190619175843 b/db/schema_migrations/20190619175843 deleted file mode 100644 index 142d694f58a..00000000000 --- a/db/schema_migrations/20190619175843 +++ /dev/null @@ -1 +0,0 @@ -2e08e7f7493f2feecf4029bb788b0f6a113ee83f44fd8437e9903f5c5b62e7d0
\ No newline at end of file diff --git a/db/schema_migrations/20190620105427 b/db/schema_migrations/20190620105427 deleted file mode 100644 index 54106d8dfae..00000000000 --- a/db/schema_migrations/20190620105427 +++ /dev/null @@ -1 +0,0 @@ -5689bf2f5dcc2464fcb0361c69c8d0a17d7bc2d2c3af88ac80644374c9210311
\ No newline at end of file diff --git a/db/schema_migrations/20190620112608 b/db/schema_migrations/20190620112608 deleted file mode 100644 index d78c1abb550..00000000000 --- a/db/schema_migrations/20190620112608 +++ /dev/null @@ -1 +0,0 @@ -19738810877e1177df13681f77ec0d05d3124ca6ffc862829883f9f1995557e7
\ No newline at end of file diff --git a/db/schema_migrations/20190621022810 b/db/schema_migrations/20190621022810 deleted file mode 100644 index ff2949806c4..00000000000 --- a/db/schema_migrations/20190621022810 +++ /dev/null @@ -1 +0,0 @@ -d55d3175690df242a19cd25ba2d78cb3ddd5a35d095fe354ff20b7977b09eaf3
\ No newline at end of file diff --git a/db/schema_migrations/20190621151636 b/db/schema_migrations/20190621151636 deleted file mode 100644 index 2046ae116ab..00000000000 --- a/db/schema_migrations/20190621151636 +++ /dev/null @@ -1 +0,0 @@ -4759b161afb94a5b1eb951fd2a874a4c5b7e53cec7c4fbf6a7292ed2d8e8dabc
\ No newline at end of file diff --git a/db/schema_migrations/20190623212503 b/db/schema_migrations/20190623212503 deleted file mode 100644 index 64ff254fce2..00000000000 --- a/db/schema_migrations/20190623212503 +++ /dev/null @@ -1 +0,0 @@ -98ceb8452ec3c1c9d16096e567b5d3046c9403d643da555647be73343cdfe9ed
\ No newline at end of file diff --git a/db/schema_migrations/20190624123615 b/db/schema_migrations/20190624123615 deleted file mode 100644 index 1e59eed250c..00000000000 --- a/db/schema_migrations/20190624123615 +++ /dev/null @@ -1 +0,0 @@ -52674a8e27d46622259c99099faf88fc409691b1e67ce9c6ae728ab29435a6e7
\ No newline at end of file diff --git a/db/schema_migrations/20190625115224 b/db/schema_migrations/20190625115224 deleted file mode 100644 index 1090694684e..00000000000 --- a/db/schema_migrations/20190625115224 +++ /dev/null @@ -1 +0,0 @@ -bf4ea807b92c5f82d1c2e2c8acf6c269484931540b8b24618dd44aed2d3a45a0
\ No newline at end of file diff --git a/db/schema_migrations/20190625184066 b/db/schema_migrations/20190625184066 deleted file mode 100644 index 3f76b9ccf17..00000000000 --- a/db/schema_migrations/20190625184066 +++ /dev/null @@ -1 +0,0 @@ -b79a009d180b2faee8795eddcd855b3080e2716bb0ac153f2031f33044cd4c09
\ No newline at end of file diff --git a/db/schema_migrations/20190626175626 b/db/schema_migrations/20190626175626 deleted file mode 100644 index 33ba2c9fe7d..00000000000 --- a/db/schema_migrations/20190626175626 +++ /dev/null @@ -1 +0,0 @@ -088a3fa51ef2a41ef11b38d9bb311494ce30645cb679dadffeeacca56e81bd71
\ No newline at end of file diff --git a/db/schema_migrations/20190627051902 b/db/schema_migrations/20190627051902 deleted file mode 100644 index fb66a2de0a5..00000000000 --- a/db/schema_migrations/20190627051902 +++ /dev/null @@ -1 +0,0 @@ -67fd84ab0a4fc8ec401149888d4820c620615931d56fa7d2a777b680981f74b8
\ No newline at end of file diff --git a/db/schema_migrations/20190627100221 b/db/schema_migrations/20190627100221 deleted file mode 100644 index 48c9d783a84..00000000000 --- a/db/schema_migrations/20190627100221 +++ /dev/null @@ -1 +0,0 @@ -46fe4606e6a33a991a46ee06bf65ee104369ab414f87d40cc24c15005f09d9ac
\ No newline at end of file diff --git a/db/schema_migrations/20190627122264 b/db/schema_migrations/20190627122264 deleted file mode 100644 index 4f752116ea8..00000000000 --- a/db/schema_migrations/20190627122264 +++ /dev/null @@ -1 +0,0 @@ -2b1c45ada63a90fc8259104c1870a4fe707bf80470c628fb1ed91801e54e5bb1
\ No newline at end of file diff --git a/db/schema_migrations/20190628145246 b/db/schema_migrations/20190628145246 deleted file mode 100644 index fe1f29883f6..00000000000 --- a/db/schema_migrations/20190628145246 +++ /dev/null @@ -1 +0,0 @@ -552d4f6f10e75fbf2c8a5a20bc4199c464b2aa028fc9553fa062e4c5430d36ef
\ No newline at end of file diff --git a/db/schema_migrations/20190628185000 b/db/schema_migrations/20190628185000 deleted file mode 100644 index 297cd00076f..00000000000 --- a/db/schema_migrations/20190628185000 +++ /dev/null @@ -1 +0,0 @@ -7988202164669a5307bc53994083959c272b21c1e33657c88ea43223019298f0
\ No newline at end of file diff --git a/db/schema_migrations/20190628185004 b/db/schema_migrations/20190628185004 deleted file mode 100644 index 15fc93dc8b1..00000000000 --- a/db/schema_migrations/20190628185004 +++ /dev/null @@ -1 +0,0 @@ -4b2f0f82eab6b1ed3523bfa0ac56593de05cd0512fc43df028dad7006ab4f14f
\ No newline at end of file diff --git a/db/schema_migrations/20190628191740 b/db/schema_migrations/20190628191740 deleted file mode 100644 index fb4201ffd5e..00000000000 --- a/db/schema_migrations/20190628191740 +++ /dev/null @@ -1 +0,0 @@ -22dbdd0dcbfc2697655eebc5dea4c749f31484b2660e5ef42b790bfcd6ff5b8c
\ No newline at end of file diff --git a/db/schema_migrations/20190702173936 b/db/schema_migrations/20190702173936 deleted file mode 100644 index 1f6d5fb59b6..00000000000 --- a/db/schema_migrations/20190702173936 +++ /dev/null @@ -1 +0,0 @@ -a4a25def014aadc4d0883589e2823d0840e982bbc0ec6427d87815ddc37597e2
\ No newline at end of file diff --git a/db/schema_migrations/20190703043358 b/db/schema_migrations/20190703043358 deleted file mode 100644 index ec5451e142d..00000000000 --- a/db/schema_migrations/20190703043358 +++ /dev/null @@ -1 +0,0 @@ -39b8a683bf81dbddbe67d4cf9f35557d9218c7fa44d1f203b8efe83e361d3782
\ No newline at end of file diff --git a/db/schema_migrations/20190703130053 b/db/schema_migrations/20190703130053 deleted file mode 100644 index 05c495065d8..00000000000 --- a/db/schema_migrations/20190703130053 +++ /dev/null @@ -1 +0,0 @@ -2702394a2b0097580a88aca4f65804abf64a17cc1032c9a641800ddcb68f9c27
\ No newline at end of file diff --git a/db/schema_migrations/20190703171157 b/db/schema_migrations/20190703171157 deleted file mode 100644 index 62a40205ba9..00000000000 --- a/db/schema_migrations/20190703171157 +++ /dev/null @@ -1 +0,0 @@ -25d3eaf8e02bc7abaaf5f85289e2d1767429c7584bdf184b269f3ce8283b6b74
\ No newline at end of file diff --git a/db/schema_migrations/20190703171555 b/db/schema_migrations/20190703171555 deleted file mode 100644 index a9a5d063008..00000000000 --- a/db/schema_migrations/20190703171555 +++ /dev/null @@ -1 +0,0 @@ -01f022814b8d35c357b4b39cfa19fa087c69ea95ca19fe278f2c795b78169aa2
\ No newline at end of file diff --git a/db/schema_migrations/20190703185326 b/db/schema_migrations/20190703185326 deleted file mode 100644 index f5cddad84ea..00000000000 --- a/db/schema_migrations/20190703185326 +++ /dev/null @@ -1 +0,0 @@ -1d5c623de91ba7a646512ce08c0ea0e2d00b42d30bd772d719c15b650c6b9c1a
\ No newline at end of file diff --git a/db/schema_migrations/20190709204413 b/db/schema_migrations/20190709204413 deleted file mode 100644 index 7dd1600979b..00000000000 --- a/db/schema_migrations/20190709204413 +++ /dev/null @@ -1 +0,0 @@ -2ca41cf6eaca8493cc8ac70f418ce7b8b3cbb66e5160d82563735adeab0d1a60
\ No newline at end of file diff --git a/db/schema_migrations/20190709220014 b/db/schema_migrations/20190709220014 deleted file mode 100644 index bbc2215a244..00000000000 --- a/db/schema_migrations/20190709220014 +++ /dev/null @@ -1 +0,0 @@ -1853add73d46169890cfffeaf55037b31a740398b985e4d9491b5ee8f7053114
\ No newline at end of file diff --git a/db/schema_migrations/20190709220143 b/db/schema_migrations/20190709220143 deleted file mode 100644 index 3761bb2375a..00000000000 --- a/db/schema_migrations/20190709220143 +++ /dev/null @@ -1 +0,0 @@ -0908df76b1f54196780e0f2327593d192ba2ff28e15502e478dfd5ca45a25ef8
\ No newline at end of file diff --git a/db/schema_migrations/20190710151229 b/db/schema_migrations/20190710151229 deleted file mode 100644 index 9385ba6155b..00000000000 --- a/db/schema_migrations/20190710151229 +++ /dev/null @@ -1 +0,0 @@ -3f38687fa0c3d0c37531561c621ef4e6d7985f6ae189bda9dab8f10e445dbc4e
\ No newline at end of file diff --git a/db/schema_migrations/20190711124721 b/db/schema_migrations/20190711124721 deleted file mode 100644 index 6b475f6b805..00000000000 --- a/db/schema_migrations/20190711124721 +++ /dev/null @@ -1 +0,0 @@ -daf93c9d8381ff4cbbd048e50080d11ecc495ad7ac24b6ea3729e2b7de4aa39c
\ No newline at end of file diff --git a/db/schema_migrations/20190711200053 b/db/schema_migrations/20190711200053 deleted file mode 100644 index 1933550163e..00000000000 --- a/db/schema_migrations/20190711200053 +++ /dev/null @@ -1 +0,0 @@ -ab0ac0911f2fb21b8ff9b890c2f630810391db5c0abc26dce27c83ad7638a063
\ No newline at end of file diff --git a/db/schema_migrations/20190711200508 b/db/schema_migrations/20190711200508 deleted file mode 100644 index 8fabc5e81ad..00000000000 --- a/db/schema_migrations/20190711200508 +++ /dev/null @@ -1 +0,0 @@ -2cfb7874cbd4f2e0ce7e3f38d86e24eaadabf12719bafc2fda42b8d9d98e6aa8
\ No newline at end of file diff --git a/db/schema_migrations/20190711201818 b/db/schema_migrations/20190711201818 deleted file mode 100644 index c029b259c5e..00000000000 --- a/db/schema_migrations/20190711201818 +++ /dev/null @@ -1 +0,0 @@ -2058573396bf9a04e3d3524477431c88d6bcd55eca011e785d9cc02e67c4a9e9
\ No newline at end of file diff --git a/db/schema_migrations/20190712040400 b/db/schema_migrations/20190712040400 deleted file mode 100644 index f4dce5ca733..00000000000 --- a/db/schema_migrations/20190712040400 +++ /dev/null @@ -1 +0,0 @@ -e2459e4cfb50e8b0cf16248ae12a83ced625c6428737500c32c22d6b94bcec26
\ No newline at end of file diff --git a/db/schema_migrations/20190712040412 b/db/schema_migrations/20190712040412 deleted file mode 100644 index e8a1a848c77..00000000000 --- a/db/schema_migrations/20190712040412 +++ /dev/null @@ -1 +0,0 @@ -b054916f4986988b9285f0b651d75c1c7c120a83faf2efe9c1a30e3661736e17
\ No newline at end of file diff --git a/db/schema_migrations/20190712064021 b/db/schema_migrations/20190712064021 deleted file mode 100644 index d5bcd7c3f49..00000000000 --- a/db/schema_migrations/20190712064021 +++ /dev/null @@ -1 +0,0 @@ -8f94e963eb8a422b2327736a8072bb9d5104e7cf941d11de3136125e2df297bf
\ No newline at end of file diff --git a/db/schema_migrations/20190715042813 b/db/schema_migrations/20190715042813 deleted file mode 100644 index ab2e27a8be9..00000000000 --- a/db/schema_migrations/20190715042813 +++ /dev/null @@ -1 +0,0 @@ -0b44983f3ded88843f2477cc6d0b279d6c2168f0d49f5df30fb8a7abb3aa1ef1
\ No newline at end of file diff --git a/db/schema_migrations/20190715043944 b/db/schema_migrations/20190715043944 deleted file mode 100644 index f63601b4568..00000000000 --- a/db/schema_migrations/20190715043944 +++ /dev/null @@ -1 +0,0 @@ -fbeac311a26b199ea3c98b5d0bbc6be4708a7e56edf0144089ccc72a2694f2eb
\ No newline at end of file diff --git a/db/schema_migrations/20190715043954 b/db/schema_migrations/20190715043954 deleted file mode 100644 index f03e6304658..00000000000 --- a/db/schema_migrations/20190715043954 +++ /dev/null @@ -1 +0,0 @@ -f83c6fbc1d29fb4df1cbe78bbab07f28e9fac1c7a61aa29ee156a0329099437e
\ No newline at end of file diff --git a/db/schema_migrations/20190715044501 b/db/schema_migrations/20190715044501 deleted file mode 100644 index a98712a26c4..00000000000 --- a/db/schema_migrations/20190715044501 +++ /dev/null @@ -1 +0,0 @@ -8601344d3a27c18c1b21ef4224174211993ad219e73708c65325ca0c1dd3f0ac
\ No newline at end of file diff --git a/db/schema_migrations/20190715114644 b/db/schema_migrations/20190715114644 deleted file mode 100644 index 8b573691440..00000000000 --- a/db/schema_migrations/20190715114644 +++ /dev/null @@ -1 +0,0 @@ -86ee5fd36187d63f8ac246b0d7c02a4f933468b80d4dd5b2a06ed7752ce606b4
\ No newline at end of file diff --git a/db/schema_migrations/20190715140740 b/db/schema_migrations/20190715140740 deleted file mode 100644 index b194a741ac0..00000000000 --- a/db/schema_migrations/20190715140740 +++ /dev/null @@ -1 +0,0 @@ -8eca8127d4e3bf7d3cccd57438c29971c599141760380b04880a4085cd2bdb60
\ No newline at end of file diff --git a/db/schema_migrations/20190715142138 b/db/schema_migrations/20190715142138 deleted file mode 100644 index ed8cca73645..00000000000 --- a/db/schema_migrations/20190715142138 +++ /dev/null @@ -1 +0,0 @@ -fd1e1a4caf6f7904407784b817217636a8b12e4f853dd8581dc696e1e3f9cc17
\ No newline at end of file diff --git a/db/schema_migrations/20190715173819 b/db/schema_migrations/20190715173819 deleted file mode 100644 index 3dfd6d0d578..00000000000 --- a/db/schema_migrations/20190715173819 +++ /dev/null @@ -1 +0,0 @@ -744d01f5a73c4e53ea1116b2b6055dd7db4aa4e1a97fe4110c1a1eb276f1303d
\ No newline at end of file diff --git a/db/schema_migrations/20190715193142 b/db/schema_migrations/20190715193142 deleted file mode 100644 index e621c1ac0b5..00000000000 --- a/db/schema_migrations/20190715193142 +++ /dev/null @@ -1 +0,0 @@ -974a811dd7cc9810d7e9717bbe1e66db89084f5661dfbb66121099a29e093c8b
\ No newline at end of file diff --git a/db/schema_migrations/20190715215532 b/db/schema_migrations/20190715215532 deleted file mode 100644 index 53eaefff77f..00000000000 --- a/db/schema_migrations/20190715215532 +++ /dev/null @@ -1 +0,0 @@ -ca01d1d7f09ca6ec4af7b14f73f9fdfb723e9d3be85b94a121fc70803d4e97c8
\ No newline at end of file diff --git a/db/schema_migrations/20190715215549 b/db/schema_migrations/20190715215549 deleted file mode 100644 index c1ebe3109a5..00000000000 --- a/db/schema_migrations/20190715215549 +++ /dev/null @@ -1 +0,0 @@ -824d8dc5c0994e92ab63be2893d57244ff22bbbf4f6f281364213e3e25033a15
\ No newline at end of file diff --git a/db/schema_migrations/20190716144222 b/db/schema_migrations/20190716144222 deleted file mode 100644 index af11d3aca6f..00000000000 --- a/db/schema_migrations/20190716144222 +++ /dev/null @@ -1 +0,0 @@ -fb3a9f53b3ebda9cd8147faa61a6ba8a2fb9f2852e4d9c10f793ea516d270f9b
\ No newline at end of file diff --git a/db/schema_migrations/20190719122333 b/db/schema_migrations/20190719122333 deleted file mode 100644 index a263369181d..00000000000 --- a/db/schema_migrations/20190719122333 +++ /dev/null @@ -1 +0,0 @@ -41b0974a7667bb439f115960ba63a2f99d1b747af3d3c5fac27f4fe3ebe3657b
\ No newline at end of file diff --git a/db/schema_migrations/20190719174505 b/db/schema_migrations/20190719174505 deleted file mode 100644 index c00e973c7f7..00000000000 --- a/db/schema_migrations/20190719174505 +++ /dev/null @@ -1 +0,0 @@ -8132aa506ed7c07fa7610a20305ff9e34febf452e64fce44cd221aa16d95af55
\ No newline at end of file diff --git a/db/schema_migrations/20190722104947 b/db/schema_migrations/20190722104947 deleted file mode 100644 index df8fb24c556..00000000000 --- a/db/schema_migrations/20190722104947 +++ /dev/null @@ -1 +0,0 @@ -383b7f623b7ab9496a521a75d83e14af1c8bb5b133494410dda24be8144ed8a4
\ No newline at end of file diff --git a/db/schema_migrations/20190722132830 b/db/schema_migrations/20190722132830 deleted file mode 100644 index 99dd27a2042..00000000000 --- a/db/schema_migrations/20190722132830 +++ /dev/null @@ -1 +0,0 @@ -1fdd66556bdf081a09090f9f790142000c22e9402edc67efcdc25806fac5b9cf
\ No newline at end of file diff --git a/db/schema_migrations/20190722144316 b/db/schema_migrations/20190722144316 deleted file mode 100644 index 5a5f5a5839b..00000000000 --- a/db/schema_migrations/20190722144316 +++ /dev/null @@ -1 +0,0 @@ -1fa269a8ec548e937b04b11fc0bcae7c77c2d1f257ae37d1263573fc9ec6f8cd
\ No newline at end of file diff --git a/db/schema_migrations/20190723105753 b/db/schema_migrations/20190723105753 deleted file mode 100644 index 65401154db6..00000000000 --- a/db/schema_migrations/20190723105753 +++ /dev/null @@ -1 +0,0 @@ -fd00e121f2e97645fd660a5fadd17d4811faff70bbf966b3333aebd118d1a66e
\ No newline at end of file diff --git a/db/schema_migrations/20190723153247 b/db/schema_migrations/20190723153247 deleted file mode 100644 index caeecf37f87..00000000000 --- a/db/schema_migrations/20190723153247 +++ /dev/null @@ -1 +0,0 @@ -d4ac849cdd37d734afb3c74baad0ea8833a7a0f1fa607fc1f6c649ee67f9ca8c
\ No newline at end of file diff --git a/db/schema_migrations/20190724112147 b/db/schema_migrations/20190724112147 deleted file mode 100644 index b0913c59a08..00000000000 --- a/db/schema_migrations/20190724112147 +++ /dev/null @@ -1 +0,0 @@ -283a81dc204445d16db191facf3d92e5d67ad3ff5fa89448f998a52ddc48e9b3
\ No newline at end of file diff --git a/db/schema_migrations/20190725012225 b/db/schema_migrations/20190725012225 deleted file mode 100644 index 42a307bc49f..00000000000 --- a/db/schema_migrations/20190725012225 +++ /dev/null @@ -1 +0,0 @@ -180b6a3e2a9bf2d07d7edb47db9b6be0f144936649471de4c60c106e64b39d3f
\ No newline at end of file diff --git a/db/schema_migrations/20190725080128 b/db/schema_migrations/20190725080128 deleted file mode 100644 index 3231fafb244..00000000000 --- a/db/schema_migrations/20190725080128 +++ /dev/null @@ -1 +0,0 @@ -f187c16f5f27d9fef62ad9186f839dda677ab0406b465f1b16cc01134cc35d7e
\ No newline at end of file diff --git a/db/schema_migrations/20190725183432 b/db/schema_migrations/20190725183432 deleted file mode 100644 index 0a18c88c8b0..00000000000 --- a/db/schema_migrations/20190725183432 +++ /dev/null @@ -1 +0,0 @@ -3ea3bc4b03f5ee23e8864fa23aa2ee91eb30355246bd3f344711d06c97bfd89d
\ No newline at end of file diff --git a/db/schema_migrations/20190726101050 b/db/schema_migrations/20190726101050 deleted file mode 100644 index 20aab312c87..00000000000 --- a/db/schema_migrations/20190726101050 +++ /dev/null @@ -1 +0,0 @@ -c1f602171c71e02dd6ba7ce9a949414f71839e518a41f4d179e164a7870f49c9
\ No newline at end of file diff --git a/db/schema_migrations/20190726101133 b/db/schema_migrations/20190726101133 deleted file mode 100644 index 23462dcd446..00000000000 --- a/db/schema_migrations/20190726101133 +++ /dev/null @@ -1 +0,0 @@ -2f9887af666d0e9d256d7f0c1526194d5a1af7238e57a57c1f11d05928039785
\ No newline at end of file diff --git a/db/schema_migrations/20190729062536 b/db/schema_migrations/20190729062536 deleted file mode 100644 index 7b177f8768e..00000000000 --- a/db/schema_migrations/20190729062536 +++ /dev/null @@ -1 +0,0 @@ -33eab679fd572d55ac8b6363c821b9c94b127f16ec32275dd08a987e4e9bec35
\ No newline at end of file diff --git a/db/schema_migrations/20190729090456 b/db/schema_migrations/20190729090456 deleted file mode 100644 index fbee008c83f..00000000000 --- a/db/schema_migrations/20190729090456 +++ /dev/null @@ -1 +0,0 @@ -6aa639ff412dee0c1b78224950f30935d8fcbceddc44f199dc2cba29ad1bb131
\ No newline at end of file diff --git a/db/schema_migrations/20190729180447 b/db/schema_migrations/20190729180447 deleted file mode 100644 index 776a6dafd9b..00000000000 --- a/db/schema_migrations/20190729180447 +++ /dev/null @@ -1 +0,0 @@ -7603148a9b9909e0ce6239add43b47627f47f3c7c42a0a57d98a710343ecf221
\ No newline at end of file diff --git a/db/schema_migrations/20190731084415 b/db/schema_migrations/20190731084415 deleted file mode 100644 index 9c5c8cc24d8..00000000000 --- a/db/schema_migrations/20190731084415 +++ /dev/null @@ -1 +0,0 @@ -ef924cafda1ed0db2c8dd5015b1c191db9607353bb75d7997e7bc6bd77a932b3
\ No newline at end of file diff --git a/db/schema_migrations/20190801060809 b/db/schema_migrations/20190801060809 deleted file mode 100644 index 45a57d75919..00000000000 --- a/db/schema_migrations/20190801060809 +++ /dev/null @@ -1 +0,0 @@ -4f68ea061fc5db2b6ffe0178400277a294aa66f5391cea57e5939064b18d2437
\ No newline at end of file diff --git a/db/schema_migrations/20190801114109 b/db/schema_migrations/20190801114109 deleted file mode 100644 index 0652f1f6da0..00000000000 --- a/db/schema_migrations/20190801114109 +++ /dev/null @@ -1 +0,0 @@ -4994a44a4138487988226173a7244e23ca6f02dead34e5f644ebe98e4545b386
\ No newline at end of file diff --git a/db/schema_migrations/20190801142441 b/db/schema_migrations/20190801142441 deleted file mode 100644 index 9d783f2cf5b..00000000000 --- a/db/schema_migrations/20190801142441 +++ /dev/null @@ -1 +0,0 @@ -d2719026b340b4e2272d6a45d19c3cf4887bc1fd8c1b6354cfb3386e69f01752
\ No newline at end of file diff --git a/db/schema_migrations/20190801193427 b/db/schema_migrations/20190801193427 deleted file mode 100644 index fbdb3ba1aaa..00000000000 --- a/db/schema_migrations/20190801193427 +++ /dev/null @@ -1 +0,0 @@ -7a90f907ae9813ed6dadc5689155177a7985e714f98d193d52b052049497284f
\ No newline at end of file diff --git a/db/schema_migrations/20190802012622 b/db/schema_migrations/20190802012622 deleted file mode 100644 index 270b1eea497..00000000000 --- a/db/schema_migrations/20190802012622 +++ /dev/null @@ -1 +0,0 @@ -9cdfaa5c3e062f5f90ea580d825583b3d50f09e0750af87aee79f6e2f3480731
\ No newline at end of file diff --git a/db/schema_migrations/20190802091750 b/db/schema_migrations/20190802091750 deleted file mode 100644 index a22ea316bc7..00000000000 --- a/db/schema_migrations/20190802091750 +++ /dev/null @@ -1 +0,0 @@ -4f0f1e92ae75588cd2c6c0374907fbf5809f942d07342da8ff264a10a76dd68a
\ No newline at end of file diff --git a/db/schema_migrations/20190802195602 b/db/schema_migrations/20190802195602 deleted file mode 100644 index 7529973918a..00000000000 --- a/db/schema_migrations/20190802195602 +++ /dev/null @@ -1 +0,0 @@ -c868cca470f2ab73419cb1e44a4bfd6a1e1f45f2c45d69066d305aaffd0ade30
\ No newline at end of file diff --git a/db/schema_migrations/20190802235445 b/db/schema_migrations/20190802235445 deleted file mode 100644 index bb75868843f..00000000000 --- a/db/schema_migrations/20190802235445 +++ /dev/null @@ -1 +0,0 @@ -b1051ef820cff1f920d6df527fd79b7a922d4b3fc840670b91ffe8cf36f61407
\ No newline at end of file diff --git a/db/schema_migrations/20190805140353 b/db/schema_migrations/20190805140353 deleted file mode 100644 index 4d80ef8f4f2..00000000000 --- a/db/schema_migrations/20190805140353 +++ /dev/null @@ -1 +0,0 @@ -4181ee5e466d8efd90127bcdde2f072c4c75173e612e8496e2ee767e4f64c97e
\ No newline at end of file diff --git a/db/schema_migrations/20190806071559 b/db/schema_migrations/20190806071559 deleted file mode 100644 index c9e382a679b..00000000000 --- a/db/schema_migrations/20190806071559 +++ /dev/null @@ -1 +0,0 @@ -eb0ddb4065ab724d820a89350052ed694c08a8e98e235c32ea72fbae915330bb
\ No newline at end of file diff --git a/db/schema_migrations/20190807023052 b/db/schema_migrations/20190807023052 deleted file mode 100644 index 9b5cd4b50f3..00000000000 --- a/db/schema_migrations/20190807023052 +++ /dev/null @@ -1 +0,0 @@ -9a728799a6877d4d0d889846e80dd92448ff0f96bfb2e85eddd31dbbf213c1ac
\ No newline at end of file diff --git a/db/schema_migrations/20190808152507 b/db/schema_migrations/20190808152507 deleted file mode 100644 index e8a4130067a..00000000000 --- a/db/schema_migrations/20190808152507 +++ /dev/null @@ -1 +0,0 @@ -3caa0d7f3abfaae8602ae0ef9f34987f8135b0612be5be730248b4eafeec65a2
\ No newline at end of file diff --git a/db/schema_migrations/20190809072552 b/db/schema_migrations/20190809072552 deleted file mode 100644 index cc3ed4b3580..00000000000 --- a/db/schema_migrations/20190809072552 +++ /dev/null @@ -1 +0,0 @@ -3cfffb7434a171017f6fe634a67e096ab6d52dca9a7137a326f69f294b55d76b
\ No newline at end of file diff --git a/db/schema_migrations/20190812070645 b/db/schema_migrations/20190812070645 deleted file mode 100644 index fed7d32cc77..00000000000 --- a/db/schema_migrations/20190812070645 +++ /dev/null @@ -1 +0,0 @@ -78b4dc9862419faf4868edf2895587e6e86f18c3d04b45c81950faa9f200820d
\ No newline at end of file diff --git a/db/schema_migrations/20190814205640 b/db/schema_migrations/20190814205640 deleted file mode 100644 index 5926d6ad382..00000000000 --- a/db/schema_migrations/20190814205640 +++ /dev/null @@ -1 +0,0 @@ -5c6476a11648e962ab12abd61670ea4af6c19780150ec4afb5e28200d7d2b8d4
\ No newline at end of file diff --git a/db/schema_migrations/20190815093936 b/db/schema_migrations/20190815093936 deleted file mode 100644 index 21427de8945..00000000000 --- a/db/schema_migrations/20190815093936 +++ /dev/null @@ -1 +0,0 @@ -3176385f347a7caa394e9c28f6d1db6551f3e32034bb31d02b5acf7064825745
\ No newline at end of file diff --git a/db/schema_migrations/20190815093949 b/db/schema_migrations/20190815093949 deleted file mode 100644 index 8d5e1a4d31d..00000000000 --- a/db/schema_migrations/20190815093949 +++ /dev/null @@ -1 +0,0 @@ -24d0ed21332c6f5b540b51de7d1e0aa680a0802f3da51e7e6ebefad478632aea
\ No newline at end of file diff --git a/db/schema_migrations/20190816151221 b/db/schema_migrations/20190816151221 deleted file mode 100644 index 72fb221782a..00000000000 --- a/db/schema_migrations/20190816151221 +++ /dev/null @@ -1 +0,0 @@ -7b597261d88ca69a87973d3a3cf8dd0d7428f8d9c8e33a1b341c620e7515f59c
\ No newline at end of file diff --git a/db/schema_migrations/20190819131155 b/db/schema_migrations/20190819131155 deleted file mode 100644 index 053e70f1ff8..00000000000 --- a/db/schema_migrations/20190819131155 +++ /dev/null @@ -1 +0,0 @@ -2e73d76d728d37ab1597f7cdb049aead3b20ef8212fd813e79e1d64d56fe8265
\ No newline at end of file diff --git a/db/schema_migrations/20190819231552 b/db/schema_migrations/20190819231552 deleted file mode 100644 index f3d32630f28..00000000000 --- a/db/schema_migrations/20190819231552 +++ /dev/null @@ -1 +0,0 @@ -d66662f0bc2962b3e9c306647de4d173b92831c64cf374be27173da46ccf5ace
\ No newline at end of file diff --git a/db/schema_migrations/20190820163320 b/db/schema_migrations/20190820163320 deleted file mode 100644 index 93792f5895b..00000000000 --- a/db/schema_migrations/20190820163320 +++ /dev/null @@ -1 +0,0 @@ -cba2d66103e62fe6c6d60bfe1ef6be1bcaaee6a48cdeb7bb663c5bd2dc059571
\ No newline at end of file diff --git a/db/schema_migrations/20190821040941 b/db/schema_migrations/20190821040941 deleted file mode 100644 index 37a82ad9dbd..00000000000 --- a/db/schema_migrations/20190821040941 +++ /dev/null @@ -1 +0,0 @@ -63240b9c28ba37dc3aa808c9cb94c80bd5556c3e718883cd07f5cbd26c877a58
\ No newline at end of file diff --git a/db/schema_migrations/20190822175441 b/db/schema_migrations/20190822175441 deleted file mode 100644 index 9fce25dde65..00000000000 --- a/db/schema_migrations/20190822175441 +++ /dev/null @@ -1 +0,0 @@ -7b878154bca04d4e93e3d8af4a2a4f5ee789493dfb9c06c778d2e912c75f96cc
\ No newline at end of file diff --git a/db/schema_migrations/20190822181528 b/db/schema_migrations/20190822181528 deleted file mode 100644 index 252438dbfe4..00000000000 --- a/db/schema_migrations/20190822181528 +++ /dev/null @@ -1 +0,0 @@ -173274a98fc3ba27c1536e2d2eefc353810be6e445c35fe5e692d70f574f5a41
\ No newline at end of file diff --git a/db/schema_migrations/20190822185441 b/db/schema_migrations/20190822185441 deleted file mode 100644 index 0495815eb4c..00000000000 --- a/db/schema_migrations/20190822185441 +++ /dev/null @@ -1 +0,0 @@ -3eabd3983d6ddaf416e2806d545578c38dc29ebd374c8f763c914dac97620d4b
\ No newline at end of file diff --git a/db/schema_migrations/20190823055948 b/db/schema_migrations/20190823055948 deleted file mode 100644 index 36199132ec9..00000000000 --- a/db/schema_migrations/20190823055948 +++ /dev/null @@ -1 +0,0 @@ -64c06be6709159060c175972af919282560a33d1e69964512ca3b938c0084059
\ No newline at end of file diff --git a/db/schema_migrations/20190826090628 b/db/schema_migrations/20190826090628 deleted file mode 100644 index f2bb1347784..00000000000 --- a/db/schema_migrations/20190826090628 +++ /dev/null @@ -1 +0,0 @@ -e689268ad90086dd164950897da74cbe5ec6d92684eb44280bd34c8adef82beb
\ No newline at end of file diff --git a/db/schema_migrations/20190826100605 b/db/schema_migrations/20190826100605 deleted file mode 100644 index b5095bb9fe6..00000000000 --- a/db/schema_migrations/20190826100605 +++ /dev/null @@ -1 +0,0 @@ -90fb1444404d07fc3a88f48040d5aeb8c6cbb3389239881737116f4b50983836
\ No newline at end of file diff --git a/db/schema_migrations/20190827102026 b/db/schema_migrations/20190827102026 deleted file mode 100644 index 86ed4e10076..00000000000 --- a/db/schema_migrations/20190827102026 +++ /dev/null @@ -1 +0,0 @@ -7528817e5b38379a3115d1de18a4c8a79a88b238ad1684c68ffa09c41992d1a2
\ No newline at end of file diff --git a/db/schema_migrations/20190827222124 b/db/schema_migrations/20190827222124 deleted file mode 100644 index 9879219c579..00000000000 --- a/db/schema_migrations/20190827222124 +++ /dev/null @@ -1 +0,0 @@ -72fe9451980b1fae87b884d8ec4d24766ab63cedd9afb2e7dec3d6900d940233
\ No newline at end of file diff --git a/db/schema_migrations/20190828083843 b/db/schema_migrations/20190828083843 deleted file mode 100644 index fb8d2811ee8..00000000000 --- a/db/schema_migrations/20190828083843 +++ /dev/null @@ -1 +0,0 @@ -b443f17924a61e4b5edc21ee95ac836c23715c19ac56b0f30f6dde3048e6f4c8
\ No newline at end of file diff --git a/db/schema_migrations/20190828110802 b/db/schema_migrations/20190828110802 deleted file mode 100644 index 0fd636be6bf..00000000000 --- a/db/schema_migrations/20190828110802 +++ /dev/null @@ -1 +0,0 @@ -997654825079895b6deb78fee85622d5f553516b0f79dd45864ccf78e7d393c8
\ No newline at end of file diff --git a/db/schema_migrations/20190828170945 b/db/schema_migrations/20190828170945 deleted file mode 100644 index 3042a5c4c78..00000000000 --- a/db/schema_migrations/20190828170945 +++ /dev/null @@ -1 +0,0 @@ -d756f3c3669522a88f4145ffbae4dd320362dfa1d20c0dab706f927d5dc9c1fc
\ No newline at end of file diff --git a/db/schema_migrations/20190828172831 b/db/schema_migrations/20190828172831 deleted file mode 100644 index 7928f862d70..00000000000 --- a/db/schema_migrations/20190828172831 +++ /dev/null @@ -1 +0,0 @@ -bb2177e3f6edfb3b4f3a6f99c163569fcc7ffcd9937e20731127639c5f581e14
\ No newline at end of file diff --git a/db/schema_migrations/20190829131130 b/db/schema_migrations/20190829131130 deleted file mode 100644 index 5ec3a5a63f9..00000000000 --- a/db/schema_migrations/20190829131130 +++ /dev/null @@ -1 +0,0 @@ -d79cee991f9c67f1f32734e462ba20716b7afb2807aadbe3bb223482c39752ce
\ No newline at end of file diff --git a/db/schema_migrations/20190830075508 b/db/schema_migrations/20190830075508 deleted file mode 100644 index 5e65fbd2bcc..00000000000 --- a/db/schema_migrations/20190830075508 +++ /dev/null @@ -1 +0,0 @@ -a63559fc92fab466a04b52828bb4b871d8957012f670d0be426d3d4d7a358523
\ No newline at end of file diff --git a/db/schema_migrations/20190830080123 b/db/schema_migrations/20190830080123 deleted file mode 100644 index 8ebc3ebb6e5..00000000000 --- a/db/schema_migrations/20190830080123 +++ /dev/null @@ -1 +0,0 @@ -a01e57d8ea05aa230ea14a64eaab9cf9477a5e2738623142d2f56fc146cce8c8
\ No newline at end of file diff --git a/db/schema_migrations/20190830080626 b/db/schema_migrations/20190830080626 deleted file mode 100644 index a866a488301..00000000000 --- a/db/schema_migrations/20190830080626 +++ /dev/null @@ -1 +0,0 @@ -2d41add021e675aad73b81c7e26b4887eebb22f897f9b85db487b1a88a6d6909
\ No newline at end of file diff --git a/db/schema_migrations/20190830140240 b/db/schema_migrations/20190830140240 deleted file mode 100644 index 5ef4d017f49..00000000000 --- a/db/schema_migrations/20190830140240 +++ /dev/null @@ -1 +0,0 @@ -113a73e88c0396d50120e77bd5f0cb2a259f1d4e695609114993815fd5f723aa
\ No newline at end of file diff --git a/db/schema_migrations/20190901174200 b/db/schema_migrations/20190901174200 deleted file mode 100644 index 6b7f5f55ce5..00000000000 --- a/db/schema_migrations/20190901174200 +++ /dev/null @@ -1 +0,0 @@ -07db6a59b3d2535eb6886cbac83372c93c9890085c1bd865365dda84f27655bb
\ No newline at end of file diff --git a/db/schema_migrations/20190902131045 b/db/schema_migrations/20190902131045 deleted file mode 100644 index 9006505b959..00000000000 --- a/db/schema_migrations/20190902131045 +++ /dev/null @@ -1 +0,0 @@ -6170672240e9dbdf65aea165cc5781daf15fb8737a0b91c560872c0272ecf499
\ No newline at end of file diff --git a/db/schema_migrations/20190902152329 b/db/schema_migrations/20190902152329 deleted file mode 100644 index 45049378dc7..00000000000 --- a/db/schema_migrations/20190902152329 +++ /dev/null @@ -1 +0,0 @@ -1e61fe5200e8335727f655dcdbab451f4415d17a8ab2c8f64ee1b94f2e6a84dd
\ No newline at end of file diff --git a/db/schema_migrations/20190902160015 b/db/schema_migrations/20190902160015 deleted file mode 100644 index 1523e1b23b0..00000000000 --- a/db/schema_migrations/20190902160015 +++ /dev/null @@ -1 +0,0 @@ -9263ca48605ef16b34722cf103f58e179737af3420de4779f056adebca0084a3
\ No newline at end of file diff --git a/db/schema_migrations/20190903150358 b/db/schema_migrations/20190903150358 deleted file mode 100644 index a7720c53569..00000000000 --- a/db/schema_migrations/20190903150358 +++ /dev/null @@ -1 +0,0 @@ -c52f003550f4aef93784c633215ad751ea558b4473528f5135439430a3abb3f3
\ No newline at end of file diff --git a/db/schema_migrations/20190903150435 b/db/schema_migrations/20190903150435 deleted file mode 100644 index f2b72bafc45..00000000000 --- a/db/schema_migrations/20190903150435 +++ /dev/null @@ -1 +0,0 @@ -a7f0d5b70c638e36ae55c31bab207508f380e68dab2bc92105e8d304dd86abd3
\ No newline at end of file diff --git a/db/schema_migrations/20190904173203 b/db/schema_migrations/20190904173203 deleted file mode 100644 index c4985aa95aa..00000000000 --- a/db/schema_migrations/20190904173203 +++ /dev/null @@ -1 +0,0 @@ -a600aea22d7f5b373a272785c24a2277276a7a3f011f8a2fe827cb2e2e669c48
\ No newline at end of file diff --git a/db/schema_migrations/20190904205212 b/db/schema_migrations/20190904205212 deleted file mode 100644 index 1203c40561c..00000000000 --- a/db/schema_migrations/20190904205212 +++ /dev/null @@ -1 +0,0 @@ -2cf185a3fe5c97db01f2e1b93135457626d5e6e8713db8f51ec9f0cf5f7fe282
\ No newline at end of file diff --git a/db/schema_migrations/20190905022045 b/db/schema_migrations/20190905022045 deleted file mode 100644 index d8af3140f0c..00000000000 --- a/db/schema_migrations/20190905022045 +++ /dev/null @@ -1 +0,0 @@ -e75ebe92e7631d163312dd3d0a1a4bc4a9f42ad9457b534bcd43585c266fe456
\ No newline at end of file diff --git a/db/schema_migrations/20190905074652 b/db/schema_migrations/20190905074652 deleted file mode 100644 index 72d73da0912..00000000000 --- a/db/schema_migrations/20190905074652 +++ /dev/null @@ -1 +0,0 @@ -a31342276e56ac9c36affe2dac9b9a29624955d88da6cc54276eb56fe3049963
\ No newline at end of file diff --git a/db/schema_migrations/20190905091812 b/db/schema_migrations/20190905091812 deleted file mode 100644 index af5d7f93580..00000000000 --- a/db/schema_migrations/20190905091812 +++ /dev/null @@ -1 +0,0 @@ -16de88860f5a6191dd023cc530e0ae93d648d6205933008ab4f6c3ed86bc25ec
\ No newline at end of file diff --git a/db/schema_migrations/20190905091831 b/db/schema_migrations/20190905091831 deleted file mode 100644 index 2ed7942a7c7..00000000000 --- a/db/schema_migrations/20190905091831 +++ /dev/null @@ -1 +0,0 @@ -326f4bba5fa295e1f06ecd0a6623a1f5229612c5581e3a3b0d23a30ec586da0b
\ No newline at end of file diff --git a/db/schema_migrations/20190905140605 b/db/schema_migrations/20190905140605 deleted file mode 100644 index f3d57276be6..00000000000 --- a/db/schema_migrations/20190905140605 +++ /dev/null @@ -1 +0,0 @@ -169286baf5974bee56b3450c2b909b647f0e3432c8c6d958f9fe0236d676c79f
\ No newline at end of file diff --git a/db/schema_migrations/20190905223800 b/db/schema_migrations/20190905223800 deleted file mode 100644 index eda3f89260d..00000000000 --- a/db/schema_migrations/20190905223800 +++ /dev/null @@ -1 +0,0 @@ -0f49689e2eec83d2b15b81438759bf0bd33039f044dfbc07f1461d670dec85d3
\ No newline at end of file diff --git a/db/schema_migrations/20190905223900 b/db/schema_migrations/20190905223900 deleted file mode 100644 index 2e1d1e86404..00000000000 --- a/db/schema_migrations/20190905223900 +++ /dev/null @@ -1 +0,0 @@ -aa3ed5d568045a08acf2c597f5e13e14e09090be034d547838af3ccf0642f44f
\ No newline at end of file diff --git a/db/schema_migrations/20190906104555 b/db/schema_migrations/20190906104555 deleted file mode 100644 index 30d0d71c8e4..00000000000 --- a/db/schema_migrations/20190906104555 +++ /dev/null @@ -1 +0,0 @@ -b2da83b53773a8a5f3c779fde07e13620463b3d5f05c9437a91cfff616bd76b7
\ No newline at end of file diff --git a/db/schema_migrations/20190907184714 b/db/schema_migrations/20190907184714 deleted file mode 100644 index 732a32f4578..00000000000 --- a/db/schema_migrations/20190907184714 +++ /dev/null @@ -1 +0,0 @@ -d9a42b17a86eb438e9b89eaa099f2a6fa1bbaeb0aa46dde58c459c73d263eee2
\ No newline at end of file diff --git a/db/schema_migrations/20190909045845 b/db/schema_migrations/20190909045845 deleted file mode 100644 index c6324dfc036..00000000000 --- a/db/schema_migrations/20190909045845 +++ /dev/null @@ -1 +0,0 @@ -28b305e2347f50850a09dc9db2562e24e6579795b61c2be7917f285fa363cbfc
\ No newline at end of file diff --git a/db/schema_migrations/20190909141517 b/db/schema_migrations/20190909141517 deleted file mode 100644 index 489e65b3945..00000000000 --- a/db/schema_migrations/20190909141517 +++ /dev/null @@ -1 +0,0 @@ -54f0a1698edddee206f61b275996d6a20d94c94b48f2fc4e4d4a464cd8eea676
\ No newline at end of file diff --git a/db/schema_migrations/20190910000130 b/db/schema_migrations/20190910000130 deleted file mode 100644 index e1ad7182eb2..00000000000 --- a/db/schema_migrations/20190910000130 +++ /dev/null @@ -1 +0,0 @@ -2de4107f3687f69949b0075bb160a6b93646f2737ed737e2229e8302b6ffb3bd
\ No newline at end of file diff --git a/db/schema_migrations/20190910103144 b/db/schema_migrations/20190910103144 deleted file mode 100644 index eccfe7eefdb..00000000000 --- a/db/schema_migrations/20190910103144 +++ /dev/null @@ -1 +0,0 @@ -ce78a19764a8055042f4380780e7e0444be1aa904ba8d1206de4723108170017
\ No newline at end of file diff --git a/db/schema_migrations/20190910114843 b/db/schema_migrations/20190910114843 deleted file mode 100644 index 6bab165a8f9..00000000000 --- a/db/schema_migrations/20190910114843 +++ /dev/null @@ -1 +0,0 @@ -d8a9d068e664ab398ff7d7efcf2a69d7432efd41d0e89399527cf7099067cda7
\ No newline at end of file diff --git a/db/schema_migrations/20190910125852 b/db/schema_migrations/20190910125852 deleted file mode 100644 index 8c04d879807..00000000000 --- a/db/schema_migrations/20190910125852 +++ /dev/null @@ -1 +0,0 @@ -b4344e58c731f9c70895b761cf2b8e7a44c1bcb5b991cdc8d0906e314c4f2296
\ No newline at end of file diff --git a/db/schema_migrations/20190910211526 b/db/schema_migrations/20190910211526 deleted file mode 100644 index 72f18bd664b..00000000000 --- a/db/schema_migrations/20190910211526 +++ /dev/null @@ -1 +0,0 @@ -686f188c7033439f89a01f66c832296ae4bbdce8d86271a5bda0c2beb7cc7b2f
\ No newline at end of file diff --git a/db/schema_migrations/20190910212256 b/db/schema_migrations/20190910212256 deleted file mode 100644 index cdb7678e8c6..00000000000 --- a/db/schema_migrations/20190910212256 +++ /dev/null @@ -1 +0,0 @@ -bf2d561f6150890d54dcaac3bd47099688510cf01ab02b4f8ccb1a496019448e
\ No newline at end of file diff --git a/db/schema_migrations/20190911115056 b/db/schema_migrations/20190911115056 deleted file mode 100644 index cec3ef2cb98..00000000000 --- a/db/schema_migrations/20190911115056 +++ /dev/null @@ -1 +0,0 @@ -c37f0de57ff5d08961bd660dba33973eb9e2348e4c1460e1b45b30ca8815b9d2
\ No newline at end of file diff --git a/db/schema_migrations/20190911115109 b/db/schema_migrations/20190911115109 deleted file mode 100644 index 42c0a722373..00000000000 --- a/db/schema_migrations/20190911115109 +++ /dev/null @@ -1 +0,0 @@ -1a7e8a2fdf5a515dcdc85fb55b335351e1531b49a7d319625e8dae8a7921384b
\ No newline at end of file diff --git a/db/schema_migrations/20190911115207 b/db/schema_migrations/20190911115207 deleted file mode 100644 index 5205c1d07ed..00000000000 --- a/db/schema_migrations/20190911115207 +++ /dev/null @@ -1 +0,0 @@ -56cfabbb08ece8934ae0f4eadeb8c5d438d3d6156806ab843ff0c1497c94147b
\ No newline at end of file diff --git a/db/schema_migrations/20190911115222 b/db/schema_migrations/20190911115222 deleted file mode 100644 index 47d0dfd4ff1..00000000000 --- a/db/schema_migrations/20190911115222 +++ /dev/null @@ -1 +0,0 @@ -f5f18602819d84a6423dcc5899572e5c83d6fb251e3f309b748eb303ab65d03f
\ No newline at end of file diff --git a/db/schema_migrations/20190911251732 b/db/schema_migrations/20190911251732 deleted file mode 100644 index 0f724d28d77..00000000000 --- a/db/schema_migrations/20190911251732 +++ /dev/null @@ -1 +0,0 @@ -4c36e9ee7c007a36df4f49b6f7708b4028413829fe14898e73b8d2e13a8f80af
\ No newline at end of file diff --git a/db/schema_migrations/20190912061145 b/db/schema_migrations/20190912061145 deleted file mode 100644 index a9ec1e1cef3..00000000000 --- a/db/schema_migrations/20190912061145 +++ /dev/null @@ -1 +0,0 @@ -66182e65e32e9198a92161fb649807df3a265947389c3f84cdd303a66b669628
\ No newline at end of file diff --git a/db/schema_migrations/20190912223232 b/db/schema_migrations/20190912223232 deleted file mode 100644 index ace13c81391..00000000000 --- a/db/schema_migrations/20190912223232 +++ /dev/null @@ -1 +0,0 @@ -ba46f2f1a218bb6cfb85b0556cfaf22f8cfe9e72e8176d7db51f36ffc98a54da
\ No newline at end of file diff --git a/db/schema_migrations/20190913174707 b/db/schema_migrations/20190913174707 deleted file mode 100644 index d54be440545..00000000000 --- a/db/schema_migrations/20190913174707 +++ /dev/null @@ -1 +0,0 @@ -0979c494820844051d5ee90cf241dc76d20524343a3012201941db8715962b41
\ No newline at end of file diff --git a/db/schema_migrations/20190913175827 b/db/schema_migrations/20190913175827 deleted file mode 100644 index 77ded500f29..00000000000 --- a/db/schema_migrations/20190913175827 +++ /dev/null @@ -1 +0,0 @@ -efb47887cabf9ab80c541efc08f9d9d70b08d7c06e735861c3a54c961c6c0b05
\ No newline at end of file diff --git a/db/schema_migrations/20190914223900 b/db/schema_migrations/20190914223900 deleted file mode 100644 index 888f635bc0d..00000000000 --- a/db/schema_migrations/20190914223900 +++ /dev/null @@ -1 +0,0 @@ -c236cdced1af8a5f286f33e20289aaee9c5918e38aab2da16a2b9b58731c309e
\ No newline at end of file diff --git a/db/schema_migrations/20190917173107 b/db/schema_migrations/20190917173107 deleted file mode 100644 index 084e78606c7..00000000000 --- a/db/schema_migrations/20190917173107 +++ /dev/null @@ -1 +0,0 @@ -671a0dd0e94baa3874769e83bdf2efa1a96e3e2f17b0d9b47a2268104a50518b
\ No newline at end of file diff --git a/db/schema_migrations/20190918025618 b/db/schema_migrations/20190918025618 deleted file mode 100644 index cecaca948b6..00000000000 --- a/db/schema_migrations/20190918025618 +++ /dev/null @@ -1 +0,0 @@ -247d77a5db97c95e36ff893669986353e3558780c2187544bce673243bd9dc79
\ No newline at end of file diff --git a/db/schema_migrations/20190918102042 b/db/schema_migrations/20190918102042 deleted file mode 100644 index 59a1a20a040..00000000000 --- a/db/schema_migrations/20190918102042 +++ /dev/null @@ -1 +0,0 @@ -1cf2cc93823110690e4debbe6397921ba968bd1ea2e8f4a277a77c02893e8cc7
\ No newline at end of file diff --git a/db/schema_migrations/20190918104212 b/db/schema_migrations/20190918104212 deleted file mode 100644 index f7e01c33654..00000000000 --- a/db/schema_migrations/20190918104212 +++ /dev/null @@ -1 +0,0 @@ -2c75f0b733601f577243c2d39089f5a0d99f33f81be9b668d4b9c139b0544301
\ No newline at end of file diff --git a/db/schema_migrations/20190918104222 b/db/schema_migrations/20190918104222 deleted file mode 100644 index c8572c39792..00000000000 --- a/db/schema_migrations/20190918104222 +++ /dev/null @@ -1 +0,0 @@ -1d3c87c5e53c56f8aa94ed3d23c65c0c7b84e9252a9a1aa9f21223c1b313e495
\ No newline at end of file diff --git a/db/schema_migrations/20190918104731 b/db/schema_migrations/20190918104731 deleted file mode 100644 index 61a0c25cd61..00000000000 --- a/db/schema_migrations/20190918104731 +++ /dev/null @@ -1 +0,0 @@ -3595e71954274ca93f665936fdcdf87073c98cc0b6a840d1f7e6c6d29aebe97e
\ No newline at end of file diff --git a/db/schema_migrations/20190918121135 b/db/schema_migrations/20190918121135 deleted file mode 100644 index f9890b3a0e8..00000000000 --- a/db/schema_migrations/20190918121135 +++ /dev/null @@ -1 +0,0 @@ -6c85977a3458d9ac411eb9ed79d61b00ee5fa933fbf30fd58b35ef963fe1a746
\ No newline at end of file diff --git a/db/schema_migrations/20190919040324 b/db/schema_migrations/20190919040324 deleted file mode 100644 index 8009072a21c..00000000000 --- a/db/schema_migrations/20190919040324 +++ /dev/null @@ -1 +0,0 @@ -aaa311c52e01fe6727592c6f12b2d35e2fe2b391fb93707408376d7bdc95be39
\ No newline at end of file diff --git a/db/schema_migrations/20190919091300 b/db/schema_migrations/20190919091300 deleted file mode 100644 index 957b870e3c5..00000000000 --- a/db/schema_migrations/20190919091300 +++ /dev/null @@ -1 +0,0 @@ -e2a0c99b401e65f900105be1855f3d8b2a459dae946f1be7ddd996ec3cf4c7a3
\ No newline at end of file diff --git a/db/schema_migrations/20190919104119 b/db/schema_migrations/20190919104119 deleted file mode 100644 index 0113dc9fff5..00000000000 --- a/db/schema_migrations/20190919104119 +++ /dev/null @@ -1 +0,0 @@ -4f3494c5cd745c13d4ca1f239b327b9d4f2d2580350dd351c08c1d225f87013c
\ No newline at end of file diff --git a/db/schema_migrations/20190919162036 b/db/schema_migrations/20190919162036 deleted file mode 100644 index cb6a8479b18..00000000000 --- a/db/schema_migrations/20190919162036 +++ /dev/null @@ -1 +0,0 @@ -bcbfc76cccb757346cb6f8fc90177170c10600cc7717215d040db7c027dae104
\ No newline at end of file diff --git a/db/schema_migrations/20190919183411 b/db/schema_migrations/20190919183411 deleted file mode 100644 index 21eee82f4f8..00000000000 --- a/db/schema_migrations/20190919183411 +++ /dev/null @@ -1 +0,0 @@ -aca0b79fa42d7cc2e838f90105b0a0d4788d8fe96b569a587e733a61d5848f4a
\ No newline at end of file diff --git a/db/schema_migrations/20190920122420 b/db/schema_migrations/20190920122420 deleted file mode 100644 index ef08bf34ebb..00000000000 --- a/db/schema_migrations/20190920122420 +++ /dev/null @@ -1 +0,0 @@ -6bab074de61f0231e1bdecd0ee4ec333b516d76c19cb8db94ee947818b081f94
\ No newline at end of file diff --git a/db/schema_migrations/20190920194925 b/db/schema_migrations/20190920194925 deleted file mode 100644 index 0c64e2b6c24..00000000000 --- a/db/schema_migrations/20190920194925 +++ /dev/null @@ -1 +0,0 @@ -42d85b089f83d310b8b632884ac705249817c95f102682b090d4acfbd61f4b22
\ No newline at end of file diff --git a/db/schema_migrations/20190920224341 b/db/schema_migrations/20190920224341 deleted file mode 100644 index 9706a37704b..00000000000 --- a/db/schema_migrations/20190920224341 +++ /dev/null @@ -1 +0,0 @@ -bc6d8b2fceb2982a9a686aa3d419c3f98310168ea2e51762b1a9e5b0ed4b7c48
\ No newline at end of file diff --git a/db/schema_migrations/20190924124627 b/db/schema_migrations/20190924124627 deleted file mode 100644 index cc90f50596a..00000000000 --- a/db/schema_migrations/20190924124627 +++ /dev/null @@ -1 +0,0 @@ -8ed6b12a504868795ffb2ecb02060da5b7e5e0ba4e1f9c6169c48310bd84eeef
\ No newline at end of file diff --git a/db/schema_migrations/20190924152703 b/db/schema_migrations/20190924152703 deleted file mode 100644 index 347e9f93d0a..00000000000 --- a/db/schema_migrations/20190924152703 +++ /dev/null @@ -1 +0,0 @@ -0bb9141d46bcccfa8e9490eaf9fcb33915bdaeacdb84a9c6858935a562c8a362
\ No newline at end of file diff --git a/db/schema_migrations/20190925055714 b/db/schema_migrations/20190925055714 deleted file mode 100644 index 701644cdd6f..00000000000 --- a/db/schema_migrations/20190925055714 +++ /dev/null @@ -1 +0,0 @@ -a680157909ef97ac07faca16c001b143378e6465573b6f2373b393c47fc027d6
\ No newline at end of file diff --git a/db/schema_migrations/20190925055902 b/db/schema_migrations/20190925055902 deleted file mode 100644 index f714bc2686f..00000000000 --- a/db/schema_migrations/20190925055902 +++ /dev/null @@ -1 +0,0 @@ -f558687fcde66fd9a830c7bdca30085a69491f59bc8adb69ee605a9e6f1c7763
\ No newline at end of file diff --git a/db/schema_migrations/20190926041216 b/db/schema_migrations/20190926041216 deleted file mode 100644 index 5e3420d6292..00000000000 --- a/db/schema_migrations/20190926041216 +++ /dev/null @@ -1 +0,0 @@ -a014773268f68be8ee1e645265cda8cfca72d8186c4d0a2c4d6a7d7398f7fea3
\ No newline at end of file diff --git a/db/schema_migrations/20190926180443 b/db/schema_migrations/20190926180443 deleted file mode 100644 index 291bb50985f..00000000000 --- a/db/schema_migrations/20190926180443 +++ /dev/null @@ -1 +0,0 @@ -29140931453a51f6dad67a51ab7d17e7a0006ad6275f2624bb481214ed704f71
\ No newline at end of file diff --git a/db/schema_migrations/20190926225633 b/db/schema_migrations/20190926225633 deleted file mode 100644 index 00719ab965f..00000000000 --- a/db/schema_migrations/20190926225633 +++ /dev/null @@ -1 +0,0 @@ -c88a5b610eba2708ed79facbf4f35643870ec528af1ee1ee4fc506fbd923a6e0
\ No newline at end of file diff --git a/db/schema_migrations/20190927055500 b/db/schema_migrations/20190927055500 deleted file mode 100644 index 393ababee7c..00000000000 --- a/db/schema_migrations/20190927055500 +++ /dev/null @@ -1 +0,0 @@ -f16865939bc333d342cc92edceed9948470f3552268323ec941f0b0c11b93aae
\ No newline at end of file diff --git a/db/schema_migrations/20190927055540 b/db/schema_migrations/20190927055540 deleted file mode 100644 index 6109b40df7a..00000000000 --- a/db/schema_migrations/20190927055540 +++ /dev/null @@ -1 +0,0 @@ -aea3adb38f7895217fdf08bed5ff9b6f648672b76f475447b6773619cb9cc4c8
\ No newline at end of file diff --git a/db/schema_migrations/20190927074328 b/db/schema_migrations/20190927074328 deleted file mode 100644 index 89dc5ae89c0..00000000000 --- a/db/schema_migrations/20190927074328 +++ /dev/null @@ -1 +0,0 @@ -5dabaea6f44793c36585f119903ca9e26b70a7a1d35000107ed25ac1c655d937
\ No newline at end of file diff --git a/db/schema_migrations/20190929180751 b/db/schema_migrations/20190929180751 deleted file mode 100644 index f09fe68462d..00000000000 --- a/db/schema_migrations/20190929180751 +++ /dev/null @@ -1 +0,0 @@ -7bc84e4ec27b07c3a8f484ca9237065f8b38e44fa26d21f4f67cd08855017ddd
\ No newline at end of file diff --git a/db/schema_migrations/20190929180813 b/db/schema_migrations/20190929180813 deleted file mode 100644 index 651673105f6..00000000000 --- a/db/schema_migrations/20190929180813 +++ /dev/null @@ -1 +0,0 @@ -e986b7f607f859f8df4792979a549e045ece73f77ce482ced67da29b64f1d076
\ No newline at end of file diff --git a/db/schema_migrations/20190929180827 b/db/schema_migrations/20190929180827 deleted file mode 100644 index 0f640c52750..00000000000 --- a/db/schema_migrations/20190929180827 +++ /dev/null @@ -1 +0,0 @@ -04805d47a8857a8d484fed6b509b4940d5952657ebff694ee6410d2e2805f83c
\ No newline at end of file diff --git a/db/schema_migrations/20190930025655 b/db/schema_migrations/20190930025655 deleted file mode 100644 index 19cd29eafa1..00000000000 --- a/db/schema_migrations/20190930025655 +++ /dev/null @@ -1 +0,0 @@ -cfbb6f3dd187ec2fb28c290338030608c765d5713842ee3f16827db2be2fff04
\ No newline at end of file diff --git a/db/schema_migrations/20190930063627 b/db/schema_migrations/20190930063627 deleted file mode 100644 index 046506410c6..00000000000 --- a/db/schema_migrations/20190930063627 +++ /dev/null @@ -1 +0,0 @@ -3055bcbf27cd61bfc38f2aceb17f62edd87d2491c156576c9a86cc7c938558c6
\ No newline at end of file diff --git a/db/schema_migrations/20190930082942 b/db/schema_migrations/20190930082942 deleted file mode 100644 index 237c30f5e73..00000000000 --- a/db/schema_migrations/20190930082942 +++ /dev/null @@ -1 +0,0 @@ -c3605df74eb32a0e5e0966c365e5afe41c2277def650c71ebfde591aff535256
\ No newline at end of file diff --git a/db/schema_migrations/20190930153535 b/db/schema_migrations/20190930153535 deleted file mode 100644 index e6f379fa97d..00000000000 --- a/db/schema_migrations/20190930153535 +++ /dev/null @@ -1 +0,0 @@ -e31108d9a2834e73feb7591f7715da6ce4078da1529788d3ee60337d1132eb6a
\ No newline at end of file diff --git a/db/schema_migrations/20191001040549 b/db/schema_migrations/20191001040549 deleted file mode 100644 index 8710defdcfd..00000000000 --- a/db/schema_migrations/20191001040549 +++ /dev/null @@ -1 +0,0 @@ -6ec6d4d3077ce67d74c66e25ec74d978aca2403da05429878fc876a9e7e5d15f
\ No newline at end of file diff --git a/db/schema_migrations/20191001170300 b/db/schema_migrations/20191001170300 deleted file mode 100644 index 476230c45e6..00000000000 --- a/db/schema_migrations/20191001170300 +++ /dev/null @@ -1 +0,0 @@ -17cde9d5755d2c9403704482b0deca4748ccb5d9112253fb8abc51ecb3dbf084
\ No newline at end of file diff --git a/db/schema_migrations/20191002031332 b/db/schema_migrations/20191002031332 deleted file mode 100644 index ffa5e9a5884..00000000000 --- a/db/schema_migrations/20191002031332 +++ /dev/null @@ -1 +0,0 @@ -74bacf6a489c59ec66ed6687f065ddc2037b2ba35754c551cb0a23188988aafa
\ No newline at end of file diff --git a/db/schema_migrations/20191002123516 b/db/schema_migrations/20191002123516 deleted file mode 100644 index aa4160aa80a..00000000000 --- a/db/schema_migrations/20191002123516 +++ /dev/null @@ -1 +0,0 @@ -79d78a9910567d4eb9a77400080b68653cee7af50f4894dad5a907306bc1559c
\ No newline at end of file diff --git a/db/schema_migrations/20191003015155 b/db/schema_migrations/20191003015155 deleted file mode 100644 index e8af40d63aa..00000000000 --- a/db/schema_migrations/20191003015155 +++ /dev/null @@ -1 +0,0 @@ -95e665176c25d7afffddf3bcde7786847f9a05371b8218614c86a4def3472066
\ No newline at end of file diff --git a/db/schema_migrations/20191003060227 b/db/schema_migrations/20191003060227 deleted file mode 100644 index 9c22b09db90..00000000000 --- a/db/schema_migrations/20191003060227 +++ /dev/null @@ -1 +0,0 @@ -83b408c994191be4c4854d3899ced96afec3fd10cbca6ae25dc550b73bd8c46e
\ No newline at end of file diff --git a/db/schema_migrations/20191003064615 b/db/schema_migrations/20191003064615 deleted file mode 100644 index 37976de895b..00000000000 --- a/db/schema_migrations/20191003064615 +++ /dev/null @@ -1 +0,0 @@ -20526b0038ef1ef4123069d6e39fd4b0f5a67e34042a1660a3f074cfb3eaaee9
\ No newline at end of file diff --git a/db/schema_migrations/20191003130045 b/db/schema_migrations/20191003130045 deleted file mode 100644 index 639ec302114..00000000000 --- a/db/schema_migrations/20191003130045 +++ /dev/null @@ -1 +0,0 @@ -647253df86d12695d6dc9c58c7b84dffd44d447c996903c9d13a397d73a70878
\ No newline at end of file diff --git a/db/schema_migrations/20191003150045 b/db/schema_migrations/20191003150045 deleted file mode 100644 index 116ad2dc2e1..00000000000 --- a/db/schema_migrations/20191003150045 +++ /dev/null @@ -1 +0,0 @@ -701e32e383ad00c81a28caa035746a07ec6a84be6733d5543c261b7c17072e56
\ No newline at end of file diff --git a/db/schema_migrations/20191003161031 b/db/schema_migrations/20191003161031 deleted file mode 100644 index 5a46d3bbc1a..00000000000 --- a/db/schema_migrations/20191003161031 +++ /dev/null @@ -1 +0,0 @@ -7bde96e64e08a843eb16786fe755c2892c9b9d90dea851fd444bfa5655ce35c3
\ No newline at end of file diff --git a/db/schema_migrations/20191003161032 b/db/schema_migrations/20191003161032 deleted file mode 100644 index df8057f443a..00000000000 --- a/db/schema_migrations/20191003161032 +++ /dev/null @@ -1 +0,0 @@ -28f7f650cca6da6ef4c569ee07f1e681b49ec7f0d472d7f15bde5fbbc4896796
\ No newline at end of file diff --git a/db/schema_migrations/20191003195218 b/db/schema_migrations/20191003195218 deleted file mode 100644 index 1107e33c6ad..00000000000 --- a/db/schema_migrations/20191003195218 +++ /dev/null @@ -1 +0,0 @@ -4b1c5dc0da16549b1a903f14dd8eb204ec56482ca22e6839dff8e48f80caee24
\ No newline at end of file diff --git a/db/schema_migrations/20191003195620 b/db/schema_migrations/20191003195620 deleted file mode 100644 index e74ac9c4aee..00000000000 --- a/db/schema_migrations/20191003195620 +++ /dev/null @@ -1 +0,0 @@ -634635076b4f908de271d24c34f527634ee6b7c48124dc32bfbd38029e335a74
\ No newline at end of file diff --git a/db/schema_migrations/20191003200045 b/db/schema_migrations/20191003200045 deleted file mode 100644 index b60c0645785..00000000000 --- a/db/schema_migrations/20191003200045 +++ /dev/null @@ -1 +0,0 @@ -39f5ff3e3837b71388110f3bfe49d5629f1f0a083b2ce6a36c06cfa560a323ef
\ No newline at end of file diff --git a/db/schema_migrations/20191003250045 b/db/schema_migrations/20191003250045 deleted file mode 100644 index 4976f84e6a6..00000000000 --- a/db/schema_migrations/20191003250045 +++ /dev/null @@ -1 +0,0 @@ -8a40db4e6be8fc3ee50181feb541bf808a8a9eb6555bcea9edb5c4a7570de557
\ No newline at end of file diff --git a/db/schema_migrations/20191003300045 b/db/schema_migrations/20191003300045 deleted file mode 100644 index a659fcd73fe..00000000000 --- a/db/schema_migrations/20191003300045 +++ /dev/null @@ -1 +0,0 @@ -53147133c54680a43bdf1aff6ae02449c2b1593047f22ad2329908ebac6eb5e3
\ No newline at end of file diff --git a/db/schema_migrations/20191003350045 b/db/schema_migrations/20191003350045 deleted file mode 100644 index 3cc0550fad5..00000000000 --- a/db/schema_migrations/20191003350045 +++ /dev/null @@ -1 +0,0 @@ -01f417ab7ce788a41e21bfa73de4cc0448964a3e2b34f967296a2429b3541d3c
\ No newline at end of file diff --git a/db/schema_migrations/20191004080818 b/db/schema_migrations/20191004080818 deleted file mode 100644 index edb2e06501b..00000000000 --- a/db/schema_migrations/20191004080818 +++ /dev/null @@ -1 +0,0 @@ -7cdddb5ab3975e8b878f820561effad9977db87626b14ed9d32a5f1cb0140b55
\ No newline at end of file diff --git a/db/schema_migrations/20191004081520 b/db/schema_migrations/20191004081520 deleted file mode 100644 index 61204bebacb..00000000000 --- a/db/schema_migrations/20191004081520 +++ /dev/null @@ -1 +0,0 @@ -2fe1525c594ffb2e5428107fc5ef6c2a2c521b704a26e4153f2fdb1f4fcb86f5
\ No newline at end of file diff --git a/db/schema_migrations/20191004133612 b/db/schema_migrations/20191004133612 deleted file mode 100644 index 210618788f4..00000000000 --- a/db/schema_migrations/20191004133612 +++ /dev/null @@ -1 +0,0 @@ -375054e9a4f9e5e3acb29765678c9595e99da067e527f54a6f12c47f3f8145ea
\ No newline at end of file diff --git a/db/schema_migrations/20191004151428 b/db/schema_migrations/20191004151428 deleted file mode 100644 index 140a32a5bde..00000000000 --- a/db/schema_migrations/20191004151428 +++ /dev/null @@ -1 +0,0 @@ -0ea9ef1db88a71d9a37f0d90dd3311c0bdaaa56ebfd02044580d5b07509e09a1
\ No newline at end of file diff --git a/db/schema_migrations/20191007163701 b/db/schema_migrations/20191007163701 deleted file mode 100644 index c9ce34edca1..00000000000 --- a/db/schema_migrations/20191007163701 +++ /dev/null @@ -1 +0,0 @@ -4fb6c0471e91ebacaf06fac4faaed364fbeec6359a59f965e37732efb4df089c
\ No newline at end of file diff --git a/db/schema_migrations/20191007163736 b/db/schema_migrations/20191007163736 deleted file mode 100644 index 093e30e73cf..00000000000 --- a/db/schema_migrations/20191007163736 +++ /dev/null @@ -1 +0,0 @@ -137eac8d3ab2700cb0615d7b6e1a6f5d78d67b39bfd726ae53e12928526570c4
\ No newline at end of file diff --git a/db/schema_migrations/20191008013056 b/db/schema_migrations/20191008013056 deleted file mode 100644 index 20f631fa969..00000000000 --- a/db/schema_migrations/20191008013056 +++ /dev/null @@ -1 +0,0 @@ -9ce5934992c927939d740e2fdc1aaa39d26939bf31ac5fe6e8d861d2d4f723c6
\ No newline at end of file diff --git a/db/schema_migrations/20191008142331 b/db/schema_migrations/20191008142331 deleted file mode 100644 index 260d7a96b84..00000000000 --- a/db/schema_migrations/20191008142331 +++ /dev/null @@ -1 +0,0 @@ -172d41ab9cdc70a749baa3e9a06f152f8b3b91db2a9ecf83d981e60398c2097f
\ No newline at end of file diff --git a/db/schema_migrations/20191008143850 b/db/schema_migrations/20191008143850 deleted file mode 100644 index 76c0d403065..00000000000 --- a/db/schema_migrations/20191008143850 +++ /dev/null @@ -1 +0,0 @@ -9f19480610dd2714e25df6abf8124b889f0dac7798d15e7fb751c7045ea889f7
\ No newline at end of file diff --git a/db/schema_migrations/20191008180203 b/db/schema_migrations/20191008180203 deleted file mode 100644 index 60eebb8d5d1..00000000000 --- a/db/schema_migrations/20191008180203 +++ /dev/null @@ -1 +0,0 @@ -0c1c6f8193df04caf2b679200210324f2c0cb756415a65148a849082bddfb35a
\ No newline at end of file diff --git a/db/schema_migrations/20191008200204 b/db/schema_migrations/20191008200204 deleted file mode 100644 index cd158096655..00000000000 --- a/db/schema_migrations/20191008200204 +++ /dev/null @@ -1 +0,0 @@ -340475bf3c99c19c4ed8ec5bf5932081e7e308b12d50532dcba8f1ba0dccceab
\ No newline at end of file diff --git a/db/schema_migrations/20191009100244 b/db/schema_migrations/20191009100244 deleted file mode 100644 index 29a9d7898ba..00000000000 --- a/db/schema_migrations/20191009100244 +++ /dev/null @@ -1 +0,0 @@ -7c473a2218de1b95ba49a6ef1ef73a0ac941796bc781456fced83ab893b055ab
\ No newline at end of file diff --git a/db/schema_migrations/20191009110124 b/db/schema_migrations/20191009110124 deleted file mode 100644 index 2738c7dbef5..00000000000 --- a/db/schema_migrations/20191009110124 +++ /dev/null @@ -1 +0,0 @@ -d1b9c7b45305ceaf336bc08b0e09ebc30a7798674926acec65f8681a3858ae79
\ No newline at end of file diff --git a/db/schema_migrations/20191009110757 b/db/schema_migrations/20191009110757 deleted file mode 100644 index ae007b9c1b8..00000000000 --- a/db/schema_migrations/20191009110757 +++ /dev/null @@ -1 +0,0 @@ -8b89d05eb642d48fe82b419c5f96b20e8e216626f0d9c41a140df2d0eac4ca20
\ No newline at end of file diff --git a/db/schema_migrations/20191009222222 b/db/schema_migrations/20191009222222 deleted file mode 100644 index cf1f7486c9f..00000000000 --- a/db/schema_migrations/20191009222222 +++ /dev/null @@ -1 +0,0 @@ -3b810cddb78ee65ea7c06f7d5702a2b2fc4f6d34602d7be9b004a2dfd3bfff2b
\ No newline at end of file diff --git a/db/schema_migrations/20191010174846 b/db/schema_migrations/20191010174846 deleted file mode 100644 index 00b1fdc74c1..00000000000 --- a/db/schema_migrations/20191010174846 +++ /dev/null @@ -1 +0,0 @@ -eaba16815f50b8e2e964601996deccbbce332d7716c49367f0721060f3bc4ec8
\ No newline at end of file diff --git a/db/schema_migrations/20191011084019 b/db/schema_migrations/20191011084019 deleted file mode 100644 index 4213aa061f9..00000000000 --- a/db/schema_migrations/20191011084019 +++ /dev/null @@ -1 +0,0 @@ -28239df940adf7613964bf28c5b81a886deddb86712cbf19095fc919a4acf6bc
\ No newline at end of file diff --git a/db/schema_migrations/20191013100213 b/db/schema_migrations/20191013100213 deleted file mode 100644 index 818165d03c4..00000000000 --- a/db/schema_migrations/20191013100213 +++ /dev/null @@ -1 +0,0 @@ -4bb549347499e4570f278fd78e74e304993fc9bb8e548ca781010b134fcdfc52
\ No newline at end of file diff --git a/db/schema_migrations/20191014025629 b/db/schema_migrations/20191014025629 deleted file mode 100644 index 4e55bee4959..00000000000 --- a/db/schema_migrations/20191014025629 +++ /dev/null @@ -1 +0,0 @@ -ca01db96291b81b82ae07a9bb939fbbd2ae6050246a29311894a0951ea0eff56
\ No newline at end of file diff --git a/db/schema_migrations/20191014030134 b/db/schema_migrations/20191014030134 deleted file mode 100644 index e1eed0dc2fc..00000000000 --- a/db/schema_migrations/20191014030134 +++ /dev/null @@ -1 +0,0 @@ -ad82d6f2dad42e97601d4f9b938a2d823fdc21e93ea37b87ca65251662703cbe
\ No newline at end of file diff --git a/db/schema_migrations/20191014030730 b/db/schema_migrations/20191014030730 deleted file mode 100644 index 0205b78d2d1..00000000000 --- a/db/schema_migrations/20191014030730 +++ /dev/null @@ -1 +0,0 @@ -20b8eebd018f231896919a5dde5c6d252efadacd647631f13d9abc18af093132
\ No newline at end of file diff --git a/db/schema_migrations/20191014084150 b/db/schema_migrations/20191014084150 deleted file mode 100644 index f8dfa8d9613..00000000000 --- a/db/schema_migrations/20191014084150 +++ /dev/null @@ -1 +0,0 @@ -68af1731d498b269416d55657ca494aa83d8b972994f1c4de192afa8c719f23f
\ No newline at end of file diff --git a/db/schema_migrations/20191014123159 b/db/schema_migrations/20191014123159 deleted file mode 100644 index 7849f2ea9d7..00000000000 --- a/db/schema_migrations/20191014123159 +++ /dev/null @@ -1 +0,0 @@ -a165f4ebb5ec0cf763adb9e91dae9f4be52e3d9333af684ef829b2f03820c4db
\ No newline at end of file diff --git a/db/schema_migrations/20191014132931 b/db/schema_migrations/20191014132931 deleted file mode 100644 index 8df3ccfb63b..00000000000 --- a/db/schema_migrations/20191014132931 +++ /dev/null @@ -1 +0,0 @@ -170e19c11fe7c0ae06eebe94876ad7f8073a7eac93535a8d396bf666601ed6ad
\ No newline at end of file diff --git a/db/schema_migrations/20191015154408 b/db/schema_migrations/20191015154408 deleted file mode 100644 index 4c406bcad04..00000000000 --- a/db/schema_migrations/20191015154408 +++ /dev/null @@ -1 +0,0 @@ -adabec34b91bb4a85e93aed851bd9160228a286ea73ac56e3edd17b7690acd7a
\ No newline at end of file diff --git a/db/schema_migrations/20191016072826 b/db/schema_migrations/20191016072826 deleted file mode 100644 index cbf49e25a42..00000000000 --- a/db/schema_migrations/20191016072826 +++ /dev/null @@ -1 +0,0 @@ -7038fdce2168ca2f6b60cfe995099b85c5aef44fe0644565ce9581e68544633d
\ No newline at end of file diff --git a/db/schema_migrations/20191016133352 b/db/schema_migrations/20191016133352 deleted file mode 100644 index 05169b4aac3..00000000000 --- a/db/schema_migrations/20191016133352 +++ /dev/null @@ -1 +0,0 @@ -7ce33f357bb3f7bb8bd912bdfb4e8b77e0f8fbeee3c4f35b26cf2de67b9e38b5
\ No newline at end of file diff --git a/db/schema_migrations/20191016220135 b/db/schema_migrations/20191016220135 deleted file mode 100644 index d5f743e3cb8..00000000000 --- a/db/schema_migrations/20191016220135 +++ /dev/null @@ -1 +0,0 @@ -5f77d1303eb8fe7f4a3dbd3dd1cdcce7ce1eb24b5689bbf5eb688dba5873e13e
\ No newline at end of file diff --git a/db/schema_migrations/20191017001326 b/db/schema_migrations/20191017001326 deleted file mode 100644 index 6844190f9dc..00000000000 --- a/db/schema_migrations/20191017001326 +++ /dev/null @@ -1 +0,0 @@ -9e6a6aefb0f6332a0a373c69a54e974c8998d29ad68b30baca1da2394db7f619
\ No newline at end of file diff --git a/db/schema_migrations/20191017045817 b/db/schema_migrations/20191017045817 deleted file mode 100644 index c484051625a..00000000000 --- a/db/schema_migrations/20191017045817 +++ /dev/null @@ -1 +0,0 @@ -0502a7ab6a5fe6d865b41a90ed29a14677d6125fdeca5bf501f6efdbc17fb6c4
\ No newline at end of file diff --git a/db/schema_migrations/20191017094449 b/db/schema_migrations/20191017094449 deleted file mode 100644 index 1ae29d0a6dd..00000000000 --- a/db/schema_migrations/20191017094449 +++ /dev/null @@ -1 +0,0 @@ -882342a939bae12ee30b807f204d40fb18614516586341baeb21bcbb9b6e9717
\ No newline at end of file diff --git a/db/schema_migrations/20191017134513 b/db/schema_migrations/20191017134513 deleted file mode 100644 index 0ad1f8e2465..00000000000 --- a/db/schema_migrations/20191017134513 +++ /dev/null @@ -1 +0,0 @@ -a868bdd7ed190a51fbd81ef8a36974ac148d6a57e9dbce50ef204b02f2c44b63
\ No newline at end of file diff --git a/db/schema_migrations/20191017180026 b/db/schema_migrations/20191017180026 deleted file mode 100644 index 25e62576b4d..00000000000 --- a/db/schema_migrations/20191017180026 +++ /dev/null @@ -1 +0,0 @@ -be157a9c19ca4ffbb563fe66ed98e49073b4e46a0a5554650d403951083380ca
\ No newline at end of file diff --git a/db/schema_migrations/20191017191341 b/db/schema_migrations/20191017191341 deleted file mode 100644 index dcbdc4be712..00000000000 --- a/db/schema_migrations/20191017191341 +++ /dev/null @@ -1 +0,0 @@ -1f7cd89665a41c127017106e63c9424944c0a492506bf5a7cb4d475e654e6650
\ No newline at end of file diff --git a/db/schema_migrations/20191021101942 b/db/schema_migrations/20191021101942 deleted file mode 100644 index 675c9370ab7..00000000000 --- a/db/schema_migrations/20191021101942 +++ /dev/null @@ -1 +0,0 @@ -5f2930ae7d4dad97b6aa9bba35f37d18e2ca02be64522d8e2d25d0989e76f5b3
\ No newline at end of file diff --git a/db/schema_migrations/20191022113635 b/db/schema_migrations/20191022113635 deleted file mode 100644 index 823d0c986e9..00000000000 --- a/db/schema_migrations/20191022113635 +++ /dev/null @@ -1 +0,0 @@ -fc22f8d37344a5aa187382c56f693678e09d031699a7f2464a676714e94806c5
\ No newline at end of file diff --git a/db/schema_migrations/20191023093207 b/db/schema_migrations/20191023093207 deleted file mode 100644 index 4758b0ecdef..00000000000 --- a/db/schema_migrations/20191023093207 +++ /dev/null @@ -1 +0,0 @@ -86fa9bbc5967a595f73721de376af4ff101f768934a418d0ba8333446b7833ee
\ No newline at end of file diff --git a/db/schema_migrations/20191023132005 b/db/schema_migrations/20191023132005 deleted file mode 100644 index 05a85c7cbb3..00000000000 --- a/db/schema_migrations/20191023132005 +++ /dev/null @@ -1 +0,0 @@ -a882c8b34ad9953e258dd55b90f2436ae6e63aff04a3d11d3877a4047b847c82
\ No newline at end of file diff --git a/db/schema_migrations/20191023152913 b/db/schema_migrations/20191023152913 deleted file mode 100644 index 16a2d4c9b0c..00000000000 --- a/db/schema_migrations/20191023152913 +++ /dev/null @@ -1 +0,0 @@ -eeae7929170a1e677477a96b49196b59a921479f0f972f968100f56fbd1f4f96
\ No newline at end of file diff --git a/db/schema_migrations/20191024134020 b/db/schema_migrations/20191024134020 deleted file mode 100644 index 3f60f2d45a4..00000000000 --- a/db/schema_migrations/20191024134020 +++ /dev/null @@ -1 +0,0 @@ -fed14382ef37130d2da6beacc80a5d515785d90a647e8adf1840d5effb8bd291
\ No newline at end of file diff --git a/db/schema_migrations/20191025092748 b/db/schema_migrations/20191025092748 deleted file mode 100644 index c89bb0024b9..00000000000 --- a/db/schema_migrations/20191025092748 +++ /dev/null @@ -1 +0,0 @@ -d1c0141c9441751ea8d0f919dd2b47c87fb01ff48b2daa027edaac1dcf007309
\ No newline at end of file diff --git a/db/schema_migrations/20191026041447 b/db/schema_migrations/20191026041447 deleted file mode 100644 index 78749b3935b..00000000000 --- a/db/schema_migrations/20191026041447 +++ /dev/null @@ -1 +0,0 @@ -7d652dac435d973f39fa890ac8d90509d2f4983460ee6b2e0d902294406042a6
\ No newline at end of file diff --git a/db/schema_migrations/20191026120008 b/db/schema_migrations/20191026120008 deleted file mode 100644 index b50d993074c..00000000000 --- a/db/schema_migrations/20191026120008 +++ /dev/null @@ -1 +0,0 @@ -b678c8b2ec58bd313a27b4cf548c22aa0ed2b162ef697635d355f3f607c4a333
\ No newline at end of file diff --git a/db/schema_migrations/20191026120112 b/db/schema_migrations/20191026120112 deleted file mode 100644 index dba3a1edd13..00000000000 --- a/db/schema_migrations/20191026120112 +++ /dev/null @@ -1 +0,0 @@ -b572db7d84a0d1c7ffafd09f6c2b3d75a6f5e5185bec778e2fdf08c301fdec47
\ No newline at end of file diff --git a/db/schema_migrations/20191026124116 b/db/schema_migrations/20191026124116 deleted file mode 100644 index ea6fba0f3b3..00000000000 --- a/db/schema_migrations/20191026124116 +++ /dev/null @@ -1 +0,0 @@ -bebe14f48bd10e189c91a9a832a3c062b519f5ad73791f06ad6b5611ecb97ea8
\ No newline at end of file diff --git a/db/schema_migrations/20191028130054 b/db/schema_migrations/20191028130054 deleted file mode 100644 index ac5da187319..00000000000 --- a/db/schema_migrations/20191028130054 +++ /dev/null @@ -1 +0,0 @@ -6675036ac2ac04dfc8256e9b0036a5161fdda3fbf4485942712c08305f6c1759
\ No newline at end of file diff --git a/db/schema_migrations/20191028162543 b/db/schema_migrations/20191028162543 deleted file mode 100644 index 25164a7c36b..00000000000 --- a/db/schema_migrations/20191028162543 +++ /dev/null @@ -1 +0,0 @@ -f7c0aabbbcfbd54202293735fdf554b97485b1d88cd4ac953f91ba3e8599bec3
\ No newline at end of file diff --git a/db/schema_migrations/20191028184740 b/db/schema_migrations/20191028184740 deleted file mode 100644 index a09bf9b0915..00000000000 --- a/db/schema_migrations/20191028184740 +++ /dev/null @@ -1 +0,0 @@ -9f2e65680c422e86a5bf26e514a1edbd32a82a07b3e68b8bb016bbcaa862aa6e
\ No newline at end of file diff --git a/db/schema_migrations/20191029095537 b/db/schema_migrations/20191029095537 deleted file mode 100644 index 8f72856bc89..00000000000 --- a/db/schema_migrations/20191029095537 +++ /dev/null @@ -1 +0,0 @@ -b8d7fed0fabd24e042d120eefbafc3a914011e23d9f6c22e0d4fd8f45a196d0d
\ No newline at end of file diff --git a/db/schema_migrations/20191029125305 b/db/schema_migrations/20191029125305 deleted file mode 100644 index e83c595a0e2..00000000000 --- a/db/schema_migrations/20191029125305 +++ /dev/null @@ -1 +0,0 @@ -cb02b49acfa3838dcd1eb1e73fc63272a9b58b8c805970c4dc3f46593e9d92f7
\ No newline at end of file diff --git a/db/schema_migrations/20191029191901 b/db/schema_migrations/20191029191901 deleted file mode 100644 index 1cda09882e9..00000000000 --- a/db/schema_migrations/20191029191901 +++ /dev/null @@ -1 +0,0 @@ -8881bc9f3c3fd708d5041f767e2e626687ade676b6e6600f2dffba278f81162a
\ No newline at end of file diff --git a/db/schema_migrations/20191030135044 b/db/schema_migrations/20191030135044 deleted file mode 100644 index 2ee6b4f9756..00000000000 --- a/db/schema_migrations/20191030135044 +++ /dev/null @@ -1 +0,0 @@ -f6612c7723860345907922dc12e3c73dc2e8aa742e8682b5d4cf929483dc7a8c
\ No newline at end of file diff --git a/db/schema_migrations/20191030152934 b/db/schema_migrations/20191030152934 deleted file mode 100644 index 70be7290f44..00000000000 --- a/db/schema_migrations/20191030152934 +++ /dev/null @@ -1 +0,0 @@ -7b22e44823a4c9815c58629aa028da915b55114a274f25548078a73cac80d555
\ No newline at end of file diff --git a/db/schema_migrations/20191030193050 b/db/schema_migrations/20191030193050 deleted file mode 100644 index 5a30175d674..00000000000 --- a/db/schema_migrations/20191030193050 +++ /dev/null @@ -1 +0,0 @@ -c95cc8c7a11f0c9dc510c9254cac9877a9fa015fdfe1d26b28e4169efa8aca14
\ No newline at end of file diff --git a/db/schema_migrations/20191030223057 b/db/schema_migrations/20191030223057 deleted file mode 100644 index cef57b1615d..00000000000 --- a/db/schema_migrations/20191030223057 +++ /dev/null @@ -1 +0,0 @@ -2a2320529c5ad13f78be30ab783af3a3ee651d869feb2745c966443d69089fe8
\ No newline at end of file diff --git a/db/schema_migrations/20191031095636 b/db/schema_migrations/20191031095636 deleted file mode 100644 index 0da9d40ebaa..00000000000 --- a/db/schema_migrations/20191031095636 +++ /dev/null @@ -1 +0,0 @@ -523520657d3e053a634666d5c87365f4fc09abe577cf182a019e3b07fcf398bd
\ No newline at end of file diff --git a/db/schema_migrations/20191031112603 b/db/schema_migrations/20191031112603 deleted file mode 100644 index 83dfca58a9f..00000000000 --- a/db/schema_migrations/20191031112603 +++ /dev/null @@ -1 +0,0 @@ -f89da60d6dc1f28fc43f83d90153d5298425f6a357acf8e4a7e408553dd0d839
\ No newline at end of file diff --git a/db/schema_migrations/20191101092917 b/db/schema_migrations/20191101092917 deleted file mode 100644 index c791ade4cf3..00000000000 --- a/db/schema_migrations/20191101092917 +++ /dev/null @@ -1 +0,0 @@ -2c528df52c7a277e858282f28300c637d565f97b7ededce871dcc21f61aac601
\ No newline at end of file diff --git a/db/schema_migrations/20191103202505 b/db/schema_migrations/20191103202505 deleted file mode 100644 index b1c25cd2604..00000000000 --- a/db/schema_migrations/20191103202505 +++ /dev/null @@ -1 +0,0 @@ -bcae8632ac442e5d252e048ee875fea1c89d0fbbdd0c3b1e41cbae7a3d558c4a
\ No newline at end of file diff --git a/db/schema_migrations/20191104142124 b/db/schema_migrations/20191104142124 deleted file mode 100644 index 310159e120a..00000000000 --- a/db/schema_migrations/20191104142124 +++ /dev/null @@ -1 +0,0 @@ -8eef2b56efe33e8e1e8d09e146ab996dca8395dc12d4bbdd16a7472b2e063711
\ No newline at end of file diff --git a/db/schema_migrations/20191104205020 b/db/schema_migrations/20191104205020 deleted file mode 100644 index f0bab0c5ed4..00000000000 --- a/db/schema_migrations/20191104205020 +++ /dev/null @@ -1 +0,0 @@ -2d83dea4cc432ee51f1918c9f07dffeced1050306a151c96944a4eaf85c13076
\ No newline at end of file diff --git a/db/schema_migrations/20191105094558 b/db/schema_migrations/20191105094558 deleted file mode 100644 index 55dbd1d4a68..00000000000 --- a/db/schema_migrations/20191105094558 +++ /dev/null @@ -1 +0,0 @@ -b306b35b2f71fde76ed385c057d69233f9fa1df628767c6f1cdcf3bae262b621
\ No newline at end of file diff --git a/db/schema_migrations/20191105094625 b/db/schema_migrations/20191105094625 deleted file mode 100644 index 50452149a4d..00000000000 --- a/db/schema_migrations/20191105094625 +++ /dev/null @@ -1 +0,0 @@ -17554775e0ef29ea7f459385d9b756f532c13501e63c1c998356f37d2023766b
\ No newline at end of file diff --git a/db/schema_migrations/20191105134413 b/db/schema_migrations/20191105134413 deleted file mode 100644 index c4b25b722f0..00000000000 --- a/db/schema_migrations/20191105134413 +++ /dev/null @@ -1 +0,0 @@ -a6f3103dc78fe87beefc368ef43a65b6b856adfd31a29f1d3838c5df1ece99df
\ No newline at end of file diff --git a/db/schema_migrations/20191105140942 b/db/schema_migrations/20191105140942 deleted file mode 100644 index 2858b8b4341..00000000000 --- a/db/schema_migrations/20191105140942 +++ /dev/null @@ -1 +0,0 @@ -54a4048a224f47163db97fba12ec85830014252ab5ec2697ad61f8c978e9243e
\ No newline at end of file diff --git a/db/schema_migrations/20191105155113 b/db/schema_migrations/20191105155113 deleted file mode 100644 index f9c41ecdec6..00000000000 --- a/db/schema_migrations/20191105155113 +++ /dev/null @@ -1 +0,0 @@ -0f1825d0b0971c0ca115f134f82c7a0cad99279620163b77099d1f35089a33fe
\ No newline at end of file diff --git a/db/schema_migrations/20191105193652 b/db/schema_migrations/20191105193652 deleted file mode 100644 index cfaaf8839b1..00000000000 --- a/db/schema_migrations/20191105193652 +++ /dev/null @@ -1 +0,0 @@ -676bf9f4379ac5d3d62f3c5a6252f656588a0163c3bdba4b79af866247e3d005
\ No newline at end of file diff --git a/db/schema_migrations/20191106144901 b/db/schema_migrations/20191106144901 deleted file mode 100644 index 1baae965b5b..00000000000 --- a/db/schema_migrations/20191106144901 +++ /dev/null @@ -1 +0,0 @@ -fb604a50cf68ae7fc972acfad2dbb6bef9b6b1e7d823cc24447cd56a038134c5
\ No newline at end of file diff --git a/db/schema_migrations/20191106150931 b/db/schema_migrations/20191106150931 deleted file mode 100644 index 4df15f47d0a..00000000000 --- a/db/schema_migrations/20191106150931 +++ /dev/null @@ -1 +0,0 @@ -cfe610ad6a068c8c22710a6a48cd0d93a8f45121130ef52742368282cc562f18
\ No newline at end of file diff --git a/db/schema_migrations/20191107064946 b/db/schema_migrations/20191107064946 deleted file mode 100644 index 639d8c40e34..00000000000 --- a/db/schema_migrations/20191107064946 +++ /dev/null @@ -1 +0,0 @@ -e747df6c445659cde93e8c326486293f365d0b5fc6dc05c97e4d406d37133836
\ No newline at end of file diff --git a/db/schema_migrations/20191107173446 b/db/schema_migrations/20191107173446 deleted file mode 100644 index 30bbafae849..00000000000 --- a/db/schema_migrations/20191107173446 +++ /dev/null @@ -1 +0,0 @@ -135798e88a08ceec8b173693c449039d7ae786a3a5d9943f4f0e066a23a7ae53
\ No newline at end of file diff --git a/db/schema_migrations/20191107220314 b/db/schema_migrations/20191107220314 deleted file mode 100644 index 54dad8b9380..00000000000 --- a/db/schema_migrations/20191107220314 +++ /dev/null @@ -1 +0,0 @@ -90f8776f92c44e4bb386cfc398c3201a01d7a2d80ae33e2858cf389d5e4dde38
\ No newline at end of file diff --git a/db/schema_migrations/20191108031900 b/db/schema_migrations/20191108031900 deleted file mode 100644 index c1df584eb14..00000000000 --- a/db/schema_migrations/20191108031900 +++ /dev/null @@ -1 +0,0 @@ -5b220440fa19932a1abdc393077dfafd8427984b3bca688e0de7ed98cdab1605
\ No newline at end of file diff --git a/db/schema_migrations/20191108202723 b/db/schema_migrations/20191108202723 deleted file mode 100644 index dc8b603c3c1..00000000000 --- a/db/schema_migrations/20191108202723 +++ /dev/null @@ -1 +0,0 @@ -c474888c59cf63770087c49bdc8ae754c88596ceba9cd5eeae1adae962ce6794
\ No newline at end of file diff --git a/db/schema_migrations/20191111115229 b/db/schema_migrations/20191111115229 deleted file mode 100644 index 5b0967b499e..00000000000 --- a/db/schema_migrations/20191111115229 +++ /dev/null @@ -1 +0,0 @@ -c28d6365a0cb3002f008afeda995273a3d73586a80d3588929b383245a4de637
\ No newline at end of file diff --git a/db/schema_migrations/20191111115431 b/db/schema_migrations/20191111115431 deleted file mode 100644 index d65a53bad0b..00000000000 --- a/db/schema_migrations/20191111115431 +++ /dev/null @@ -1 +0,0 @@ -8c2976f2b7c0570299a93243212045a29376b7dba9d1d89860b08df4a20d431d
\ No newline at end of file diff --git a/db/schema_migrations/20191111121500 b/db/schema_migrations/20191111121500 deleted file mode 100644 index cd82fce59d7..00000000000 --- a/db/schema_migrations/20191111121500 +++ /dev/null @@ -1 +0,0 @@ -8dda577d540a309465d020297698d8295cc5e6be47aa5e6af6fe0e9fd513c476
\ No newline at end of file diff --git a/db/schema_migrations/20191111165017 b/db/schema_migrations/20191111165017 deleted file mode 100644 index 11184389d08..00000000000 --- a/db/schema_migrations/20191111165017 +++ /dev/null @@ -1 +0,0 @@ -166071d7da34dc22c015ff4df7a528d9fa7fd473c6b623a17c2f59a758346fef
\ No newline at end of file diff --git a/db/schema_migrations/20191111175230 b/db/schema_migrations/20191111175230 deleted file mode 100644 index 2fc2a91c160..00000000000 --- a/db/schema_migrations/20191111175230 +++ /dev/null @@ -1 +0,0 @@ -6ed2940f332eb4d670c212468caaeefe0c06b10f4c937fe7a8feb1b0d6f714f2
\ No newline at end of file diff --git a/db/schema_migrations/20191112023159 b/db/schema_migrations/20191112023159 deleted file mode 100644 index 38079c91cde..00000000000 --- a/db/schema_migrations/20191112023159 +++ /dev/null @@ -1 +0,0 @@ -a94bc4da20d7677abd04f50790970ee122c6da0a07387575d466516b5aebde22
\ No newline at end of file diff --git a/db/schema_migrations/20191112090226 b/db/schema_migrations/20191112090226 deleted file mode 100644 index 8bea3736831..00000000000 --- a/db/schema_migrations/20191112090226 +++ /dev/null @@ -1 +0,0 @@ -589e90c48569f0ef1825e917a636c37e9248b1d82b8f21af81ee05c32c57f678
\ No newline at end of file diff --git a/db/schema_migrations/20191112105448 b/db/schema_migrations/20191112105448 deleted file mode 100644 index 020f6d1343a..00000000000 --- a/db/schema_migrations/20191112105448 +++ /dev/null @@ -1 +0,0 @@ -b2a22bd43c758201433bbe147960f9357b3fd2291b917a17b5835c32503b89da
\ No newline at end of file diff --git a/db/schema_migrations/20191112115247 b/db/schema_migrations/20191112115247 deleted file mode 100644 index 589b69df54c..00000000000 --- a/db/schema_migrations/20191112115247 +++ /dev/null @@ -1 +0,0 @@ -e4724eacd46e73703be06bf6e65eb8eb870a713f21b39d4050f75f83b4bc9eaa
\ No newline at end of file diff --git a/db/schema_migrations/20191112115317 b/db/schema_migrations/20191112115317 deleted file mode 100644 index 9e7bc5fdaee..00000000000 --- a/db/schema_migrations/20191112115317 +++ /dev/null @@ -1 +0,0 @@ -ef8e1c9c9b75b6ace8f477f3da7a525b0b7ad79d6c12608709b6a27d69edd3df
\ No newline at end of file diff --git a/db/schema_migrations/20191112212815 b/db/schema_migrations/20191112212815 deleted file mode 100644 index a1ca271d144..00000000000 --- a/db/schema_migrations/20191112212815 +++ /dev/null @@ -1 +0,0 @@ -1cc9a4dce5a3225f13fb2f5ce7156384b3f8e82f01439177d4bbfa097bc2b87e
\ No newline at end of file diff --git a/db/schema_migrations/20191112214305 b/db/schema_migrations/20191112214305 deleted file mode 100644 index 84a639d72b6..00000000000 --- a/db/schema_migrations/20191112214305 +++ /dev/null @@ -1 +0,0 @@ -45926e876035749c9fc117bd7686f52d201212460d024f89a98163ab84a31534
\ No newline at end of file diff --git a/db/schema_migrations/20191112221821 b/db/schema_migrations/20191112221821 deleted file mode 100644 index 830817ed3ef..00000000000 --- a/db/schema_migrations/20191112221821 +++ /dev/null @@ -1 +0,0 @@ -68eef55b06171c97366d9abba1f4a9d022cf82b9e7cf591fa9d50886806ed00c
\ No newline at end of file diff --git a/db/schema_migrations/20191112232338 b/db/schema_migrations/20191112232338 deleted file mode 100644 index 51e6bda7d1b..00000000000 --- a/db/schema_migrations/20191112232338 +++ /dev/null @@ -1 +0,0 @@ -ffa4f057d920fe5b53d7e85bb4e9115dd155940ccdf324f3199d53788fa2e361
\ No newline at end of file diff --git a/db/schema_migrations/20191114132259 b/db/schema_migrations/20191114132259 deleted file mode 100644 index 6c6aaeff794..00000000000 --- a/db/schema_migrations/20191114132259 +++ /dev/null @@ -1 +0,0 @@ -411798b984888e8b59f1309592b586d83c00fe4fc947f770dbb82a793b003ec3
\ No newline at end of file diff --git a/db/schema_migrations/20191114173508 b/db/schema_migrations/20191114173508 deleted file mode 100644 index 662001b9558..00000000000 --- a/db/schema_migrations/20191114173508 +++ /dev/null @@ -1 +0,0 @@ -c12eb42c1a8dddfb3c7da69d438968196cd56fb6fce2e1b1ef52f2f8773b42a8
\ No newline at end of file diff --git a/db/schema_migrations/20191114173602 b/db/schema_migrations/20191114173602 deleted file mode 100644 index cde41af2032..00000000000 --- a/db/schema_migrations/20191114173602 +++ /dev/null @@ -1 +0,0 @@ -cd3d6a29af42beee5bb1669b5e4a86863390c8bf388258ee6080e75e1cfa9362
\ No newline at end of file diff --git a/db/schema_migrations/20191114173624 b/db/schema_migrations/20191114173624 deleted file mode 100644 index f6c76fb5763..00000000000 --- a/db/schema_migrations/20191114173624 +++ /dev/null @@ -1 +0,0 @@ -00755a10df51d6c4e9f7fa86b90d505fb87579297864d8b481e03e01a54a83e0
\ No newline at end of file diff --git a/db/schema_migrations/20191114201118 b/db/schema_migrations/20191114201118 deleted file mode 100644 index 22a5c7ccbdc..00000000000 --- a/db/schema_migrations/20191114201118 +++ /dev/null @@ -1 +0,0 @@ -dc95ddf9241cde3721a50dfb866280ca7050e351ebf014d77a5a89998eb0846a
\ No newline at end of file diff --git a/db/schema_migrations/20191114204343 b/db/schema_migrations/20191114204343 deleted file mode 100644 index 46c2dce360c..00000000000 --- a/db/schema_migrations/20191114204343 +++ /dev/null @@ -1 +0,0 @@ -e7df7c03d36c594f3d190e4222a8ee0c89c80618af1edc87bae7a5a16f94514b
\ No newline at end of file diff --git a/db/schema_migrations/20191115001123 b/db/schema_migrations/20191115001123 deleted file mode 100644 index 99643a61a91..00000000000 --- a/db/schema_migrations/20191115001123 +++ /dev/null @@ -1 +0,0 @@ -02df053be2ac9b0e158fe8c0d35cacff033e7c944dc480e2c47afe2eaedb537f
\ No newline at end of file diff --git a/db/schema_migrations/20191115001843 b/db/schema_migrations/20191115001843 deleted file mode 100644 index df8b7514477..00000000000 --- a/db/schema_migrations/20191115001843 +++ /dev/null @@ -1 +0,0 @@ -d582cfcee296995729a1f417e06058bb8fff0f57f28958efcae4620a5134b228
\ No newline at end of file diff --git a/db/schema_migrations/20191115091425 b/db/schema_migrations/20191115091425 deleted file mode 100644 index 0d558ded804..00000000000 --- a/db/schema_migrations/20191115091425 +++ /dev/null @@ -1 +0,0 @@ -02aabd27a5429ff0e589be7d7b4e13a8d380067e072e0bd14ec6fc9dc6d3fbe6
\ No newline at end of file diff --git a/db/schema_migrations/20191115114032 b/db/schema_migrations/20191115114032 deleted file mode 100644 index 70001f1996c..00000000000 --- a/db/schema_migrations/20191115114032 +++ /dev/null @@ -1 +0,0 @@ -e7e2f7dc65de62e55e0014369f670460cd7c6350630bd6c738e2f147717a5bce
\ No newline at end of file diff --git a/db/schema_migrations/20191115115043 b/db/schema_migrations/20191115115043 deleted file mode 100644 index 1b30e4a8183..00000000000 --- a/db/schema_migrations/20191115115043 +++ /dev/null @@ -1 +0,0 @@ -1e9d6316d394efec7427d18a7279b3019ebcec812f4a17394f9ea8a8d797c79a
\ No newline at end of file diff --git a/db/schema_migrations/20191115115522 b/db/schema_migrations/20191115115522 deleted file mode 100644 index b965534509a..00000000000 --- a/db/schema_migrations/20191115115522 +++ /dev/null @@ -1 +0,0 @@ -f5bdf36ce3005bf05a1bf5366ac640a7e05ae96db62baae562be06c725482fdb
\ No newline at end of file diff --git a/db/schema_migrations/20191118053631 b/db/schema_migrations/20191118053631 deleted file mode 100644 index 187f360cc52..00000000000 --- a/db/schema_migrations/20191118053631 +++ /dev/null @@ -1 +0,0 @@ -151cbd1c9e128ff84c980dfbf85f6a99ef13f243651d737b8392808f9c15d6c5
\ No newline at end of file diff --git a/db/schema_migrations/20191118155702 b/db/schema_migrations/20191118155702 deleted file mode 100644 index aab201563cc..00000000000 --- a/db/schema_migrations/20191118155702 +++ /dev/null @@ -1 +0,0 @@ -48c11c3018de0993c04d1dd57299516cc1598e2911976d8b9a58699d436c1952
\ No newline at end of file diff --git a/db/schema_migrations/20191118173522 b/db/schema_migrations/20191118173522 deleted file mode 100644 index 18836d14b27..00000000000 --- a/db/schema_migrations/20191118173522 +++ /dev/null @@ -1 +0,0 @@ -5d2e4a660af19488c53dcd6dd4ad66727c1fd4a1b3e00b41f8562ae1c8336c11
\ No newline at end of file diff --git a/db/schema_migrations/20191118182722 b/db/schema_migrations/20191118182722 deleted file mode 100644 index 072601540c1..00000000000 --- a/db/schema_migrations/20191118182722 +++ /dev/null @@ -1 +0,0 @@ -9353e82c3fc2c789a6b91e1d44379f98077af4ac8fef2366f5e97da08a60b4b4
\ No newline at end of file diff --git a/db/schema_migrations/20191118211629 b/db/schema_migrations/20191118211629 deleted file mode 100644 index abb5f214776..00000000000 --- a/db/schema_migrations/20191118211629 +++ /dev/null @@ -1 +0,0 @@ -38e968c5c9edcc270c6030e085ecb41734367865aa35c164a6c2d2bbfebb7ae2
\ No newline at end of file diff --git a/db/schema_migrations/20191119023952 b/db/schema_migrations/20191119023952 deleted file mode 100644 index ca2ddf46c8f..00000000000 --- a/db/schema_migrations/20191119023952 +++ /dev/null @@ -1 +0,0 @@ -508e64ebf857795c6ea728909de0fec27f0bdea23405bd0a436303f1c1cbd74e
\ No newline at end of file diff --git a/db/schema_migrations/20191119220425 b/db/schema_migrations/20191119220425 deleted file mode 100644 index 945d7467986..00000000000 --- a/db/schema_migrations/20191119220425 +++ /dev/null @@ -1 +0,0 @@ -9873f12705ded66ae03992d1673e38acaf368cc5392c0873557b07a6c3900c29
\ No newline at end of file diff --git a/db/schema_migrations/20191119221041 b/db/schema_migrations/20191119221041 deleted file mode 100644 index b831384a7db..00000000000 --- a/db/schema_migrations/20191119221041 +++ /dev/null @@ -1 +0,0 @@ -348663c95591af2fa10017d943424378cfc25249aaa94a037fe68bc3427c78a3
\ No newline at end of file diff --git a/db/schema_migrations/20191119231621 b/db/schema_migrations/20191119231621 deleted file mode 100644 index d65b128f7e6..00000000000 --- a/db/schema_migrations/20191119231621 +++ /dev/null @@ -1 +0,0 @@ -49442aded13f614815ad96300b884f5e2134be92598247af6ee7e90efd85db19
\ No newline at end of file diff --git a/db/schema_migrations/20191120084627 b/db/schema_migrations/20191120084627 deleted file mode 100644 index 474c68adc76..00000000000 --- a/db/schema_migrations/20191120084627 +++ /dev/null @@ -1 +0,0 @@ -d7aa131444de95fc618f52b185e13926670509f65f381b25e9d63391bca64aae
\ No newline at end of file diff --git a/db/schema_migrations/20191120115530 b/db/schema_migrations/20191120115530 deleted file mode 100644 index 3d2ddd86a82..00000000000 --- a/db/schema_migrations/20191120115530 +++ /dev/null @@ -1 +0,0 @@ -a5c2d8c38738909386be4de092f308d622dbcc380cc46e1a53dd860037c66fae
\ No newline at end of file diff --git a/db/schema_migrations/20191120200015 b/db/schema_migrations/20191120200015 deleted file mode 100644 index d7c7a00758a..00000000000 --- a/db/schema_migrations/20191120200015 +++ /dev/null @@ -1 +0,0 @@ -0b7f93e7251838b260a4e9f3ce1b89fd4b14f635a7b0544b3a556584d9ad41c3
\ No newline at end of file diff --git a/db/schema_migrations/20191121111621 b/db/schema_migrations/20191121111621 deleted file mode 100644 index a25a4b847e4..00000000000 --- a/db/schema_migrations/20191121111621 +++ /dev/null @@ -1 +0,0 @@ -800bedef05e9773b347e5d72b6ebae3cfa45ef045af94644fba3402474db362b
\ No newline at end of file diff --git a/db/schema_migrations/20191121121947 b/db/schema_migrations/20191121121947 deleted file mode 100644 index 19be93bc700..00000000000 --- a/db/schema_migrations/20191121121947 +++ /dev/null @@ -1 +0,0 @@ -0135cf6c1105d26d2c434e6d32314ad2b11222736b2931029b3cb4be39d172fc
\ No newline at end of file diff --git a/db/schema_migrations/20191121122856 b/db/schema_migrations/20191121122856 deleted file mode 100644 index d636d2f2e42..00000000000 --- a/db/schema_migrations/20191121122856 +++ /dev/null @@ -1 +0,0 @@ -b3de8ff4f58b8d20f4d34739087c8983ad2418f1efee0fdd50cb67012a409ed1
\ No newline at end of file diff --git a/db/schema_migrations/20191121161018 b/db/schema_migrations/20191121161018 deleted file mode 100644 index 36eb5aedf5e..00000000000 --- a/db/schema_migrations/20191121161018 +++ /dev/null @@ -1 +0,0 @@ -bcbb1859922137c6bd3d93899ce4be67bb1994497a052a887046c3eb7922f441
\ No newline at end of file diff --git a/db/schema_migrations/20191121193110 b/db/schema_migrations/20191121193110 deleted file mode 100644 index 9e048e03a75..00000000000 --- a/db/schema_migrations/20191121193110 +++ /dev/null @@ -1 +0,0 @@ -5cd3737b48cab74481dabf03e8fe8fe6ed3c2011d2fb7abdd4eca9fe969da530
\ No newline at end of file diff --git a/db/schema_migrations/20191122135327 b/db/schema_migrations/20191122135327 deleted file mode 100644 index 3b3c77194bb..00000000000 --- a/db/schema_migrations/20191122135327 +++ /dev/null @@ -1 +0,0 @@ -ef3315cca7339b5065a5cb4b3f8710262e905677def259590eb368a5e71b4d71
\ No newline at end of file diff --git a/db/schema_migrations/20191122161519 b/db/schema_migrations/20191122161519 deleted file mode 100644 index 8098e3a5efc..00000000000 --- a/db/schema_migrations/20191122161519 +++ /dev/null @@ -1 +0,0 @@ -9bc79a55cbece3adb9e2d5b4c138d9920f13169002c1a1cf2cf61dab984f060e
\ No newline at end of file diff --git a/db/schema_migrations/20191123062354 b/db/schema_migrations/20191123062354 deleted file mode 100644 index 1c0c5cab53c..00000000000 --- a/db/schema_migrations/20191123062354 +++ /dev/null @@ -1 +0,0 @@ -3ac43a9170cddcbd683bc6bc310127ac851cde57b521dbb3f2fc61a59f7e1257
\ No newline at end of file diff --git a/db/schema_migrations/20191123081456 b/db/schema_migrations/20191123081456 deleted file mode 100644 index ad3a78bee6e..00000000000 --- a/db/schema_migrations/20191123081456 +++ /dev/null @@ -1 +0,0 @@ -73d13f3061a9418c99753fd9e2c21eb829618fb37efc27c4c9f7dd53bd3f3490
\ No newline at end of file diff --git a/db/schema_migrations/20191124150431 b/db/schema_migrations/20191124150431 deleted file mode 100644 index 0b86b4d6cfc..00000000000 --- a/db/schema_migrations/20191124150431 +++ /dev/null @@ -1 +0,0 @@ -2a27f434c94f762d347964d69c19ddc082574ffde9ee0e8ca20d086986285e23
\ No newline at end of file diff --git a/db/schema_migrations/20191125024005 b/db/schema_migrations/20191125024005 deleted file mode 100644 index 73273065f07..00000000000 --- a/db/schema_migrations/20191125024005 +++ /dev/null @@ -1 +0,0 @@ -ce17e69c1031ac6f3b550053894dc4bd1e16afa70e24c426cc2ef393f08bbeaf
\ No newline at end of file diff --git a/db/schema_migrations/20191125114345 b/db/schema_migrations/20191125114345 deleted file mode 100644 index bd67bfa808a..00000000000 --- a/db/schema_migrations/20191125114345 +++ /dev/null @@ -1 +0,0 @@ -eede24af63df5cd182f1ef405480c32848f0b529d71c6a93d5a5141dd079abe8
\ No newline at end of file diff --git a/db/schema_migrations/20191125133353 b/db/schema_migrations/20191125133353 deleted file mode 100644 index 3b3d202a2cd..00000000000 --- a/db/schema_migrations/20191125133353 +++ /dev/null @@ -1 +0,0 @@ -c0b3895d513b2908e011ec3cdabaafcdb2bead67b919c8b680201e0aa841a22b
\ No newline at end of file diff --git a/db/schema_migrations/20191125140458 b/db/schema_migrations/20191125140458 deleted file mode 100644 index f44a26a1969..00000000000 --- a/db/schema_migrations/20191125140458 +++ /dev/null @@ -1 +0,0 @@ -7cb5f34aadb580710dbf1a49142ee379c8b17a10bf0b3819fb58b7acbd51ee33
\ No newline at end of file diff --git a/db/schema_migrations/20191126134210 b/db/schema_migrations/20191126134210 deleted file mode 100644 index b0ad9e0a513..00000000000 --- a/db/schema_migrations/20191126134210 +++ /dev/null @@ -1 +0,0 @@ -0bf3216da908ef4953875a5f1394106734149d0742937d16b6d24d690cac5e69
\ No newline at end of file diff --git a/db/schema_migrations/20191127030005 b/db/schema_migrations/20191127030005 deleted file mode 100644 index a3b3edd3efe..00000000000 --- a/db/schema_migrations/20191127030005 +++ /dev/null @@ -1 +0,0 @@ -bf8b4eee3ce310111dcfadf257ac1fb5e1e4c8a4409a9a8f8f35ab60ef767d09
\ No newline at end of file diff --git a/db/schema_migrations/20191127151619 b/db/schema_migrations/20191127151619 deleted file mode 100644 index 22b9d2403d1..00000000000 --- a/db/schema_migrations/20191127151619 +++ /dev/null @@ -1 +0,0 @@ -b47b88a03e32f98e50583ac85730e6d031ae77df0bc7cc815a6dd43878829b2b
\ No newline at end of file diff --git a/db/schema_migrations/20191127151629 b/db/schema_migrations/20191127151629 deleted file mode 100644 index becdf2e772a..00000000000 --- a/db/schema_migrations/20191127151629 +++ /dev/null @@ -1 +0,0 @@ -6720ca3efa4a504757aa9681652016bb8cf9e4f406821f06cdcc59abf12664de
\ No newline at end of file diff --git a/db/schema_migrations/20191127163053 b/db/schema_migrations/20191127163053 deleted file mode 100644 index 0f4e8d350cc..00000000000 --- a/db/schema_migrations/20191127163053 +++ /dev/null @@ -1 +0,0 @@ -5524515ba60ded269468da8343239c2c7f168cf876976b8338180987f9cc00d7
\ No newline at end of file diff --git a/db/schema_migrations/20191127221608 b/db/schema_migrations/20191127221608 deleted file mode 100644 index 905940ef6f2..00000000000 --- a/db/schema_migrations/20191127221608 +++ /dev/null @@ -1 +0,0 @@ -790d79b3198e433a423ca6368ab1ee8f5bfe7bb9f50f167eab5cd26343befd6d
\ No newline at end of file diff --git a/db/schema_migrations/20191128145231 b/db/schema_migrations/20191128145231 deleted file mode 100644 index 99088cbb0e0..00000000000 --- a/db/schema_migrations/20191128145231 +++ /dev/null @@ -1 +0,0 @@ -f37d6731aca878a9d9fc5d5d63c4c26064df92d5ff9234fe2f8bafa1a5a702c0
\ No newline at end of file diff --git a/db/schema_migrations/20191128145232 b/db/schema_migrations/20191128145232 deleted file mode 100644 index fdd4c03c66e..00000000000 --- a/db/schema_migrations/20191128145232 +++ /dev/null @@ -1 +0,0 @@ -9693807e665dd620f4d91ed9005214e92644a834fb9cc87a5a3fbb72561310c6
\ No newline at end of file diff --git a/db/schema_migrations/20191128145233 b/db/schema_migrations/20191128145233 deleted file mode 100644 index 67cfd23dc7e..00000000000 --- a/db/schema_migrations/20191128145233 +++ /dev/null @@ -1 +0,0 @@ -ded5dd8872c7bd294cc4f181beddad51d4f88c7c497522bc53b88a2070ca7f9f
\ No newline at end of file diff --git a/db/schema_migrations/20191128162854 b/db/schema_migrations/20191128162854 deleted file mode 100644 index 931cd3d3dc2..00000000000 --- a/db/schema_migrations/20191128162854 +++ /dev/null @@ -1 +0,0 @@ -d38c0cc2a3850ed3de1b9656a81224dee07d8c5a406e82da54be43dc2d63f973
\ No newline at end of file diff --git a/db/schema_migrations/20191129134844 b/db/schema_migrations/20191129134844 deleted file mode 100644 index dd4384a7877..00000000000 --- a/db/schema_migrations/20191129134844 +++ /dev/null @@ -1 +0,0 @@ -1618b03d59e3ad874830a3ff4cae7b8975cf5ea210b2d853b69058c0e1e5c1f7
\ No newline at end of file diff --git a/db/schema_migrations/20191129144630 b/db/schema_migrations/20191129144630 deleted file mode 100644 index 669b83f6b24..00000000000 --- a/db/schema_migrations/20191129144630 +++ /dev/null @@ -1 +0,0 @@ -f0c2bb375fc98f9252b84a2d5591f34612059aa0486bb7653010b2de2f21e901
\ No newline at end of file diff --git a/db/schema_migrations/20191129144631 b/db/schema_migrations/20191129144631 deleted file mode 100644 index 300c05098b1..00000000000 --- a/db/schema_migrations/20191129144631 +++ /dev/null @@ -1 +0,0 @@ -60a7466cabad9f758b6325ffdcfb70e0ef50d6730a90b9206169b1a814386326
\ No newline at end of file diff --git a/db/schema_migrations/20191202031812 b/db/schema_migrations/20191202031812 deleted file mode 100644 index 345863c4a78..00000000000 --- a/db/schema_migrations/20191202031812 +++ /dev/null @@ -1 +0,0 @@ -076331d9d33a8b4243d1d10f30729874bc738229780341225a5d16c7e5b83819
\ No newline at end of file diff --git a/db/schema_migrations/20191202181924 b/db/schema_migrations/20191202181924 deleted file mode 100644 index eeda8fe8a58..00000000000 --- a/db/schema_migrations/20191202181924 +++ /dev/null @@ -1 +0,0 @@ -d30901aa01b60fc2563a87d283b6129be500a35dd2f7bc546e916ca11524780a
\ No newline at end of file diff --git a/db/schema_migrations/20191203121729 b/db/schema_migrations/20191203121729 deleted file mode 100644 index 90598d8b7a7..00000000000 --- a/db/schema_migrations/20191203121729 +++ /dev/null @@ -1 +0,0 @@ -1756e668eead8c08d0c454e5f05d57e4606e027cd7944cec5856b9e7a26a91a6
\ No newline at end of file diff --git a/db/schema_migrations/20191204070713 b/db/schema_migrations/20191204070713 deleted file mode 100644 index 14231887fb4..00000000000 --- a/db/schema_migrations/20191204070713 +++ /dev/null @@ -1 +0,0 @@ -d071149c8a56e1af6afc1c10c3e6113fad2f71fefede9867d9d69121e91c41a3
\ No newline at end of file diff --git a/db/schema_migrations/20191204093410 b/db/schema_migrations/20191204093410 deleted file mode 100644 index 0a5dc3932ac..00000000000 --- a/db/schema_migrations/20191204093410 +++ /dev/null @@ -1 +0,0 @@ -037cbdf9a42a3b0c8dd46f3d52101f56d971c9999cfc94aae13fc48e8c670a7d
\ No newline at end of file diff --git a/db/schema_migrations/20191204114127 b/db/schema_migrations/20191204114127 deleted file mode 100644 index 57c598ad04d..00000000000 --- a/db/schema_migrations/20191204114127 +++ /dev/null @@ -1 +0,0 @@ -4c53b91c2d18650887c782f4dcf2584ea81b3b332f68c5e082b0458510390e0a
\ No newline at end of file diff --git a/db/schema_migrations/20191204192726 b/db/schema_migrations/20191204192726 deleted file mode 100644 index 5dc426cfec4..00000000000 --- a/db/schema_migrations/20191204192726 +++ /dev/null @@ -1 +0,0 @@ -4725cd3b4deb5757c26261a859ca6da50c610019c709b533f7ef1c4fa7f75853
\ No newline at end of file diff --git a/db/schema_migrations/20191205060723 b/db/schema_migrations/20191205060723 deleted file mode 100644 index 3bf073b1ba8..00000000000 --- a/db/schema_migrations/20191205060723 +++ /dev/null @@ -1 +0,0 @@ -7de885bae1daefc9215a3cadb2fd827f9b9317d8fa264e4f93db6049760abd6b
\ No newline at end of file diff --git a/db/schema_migrations/20191205084057 b/db/schema_migrations/20191205084057 deleted file mode 100644 index a6f81ff151e..00000000000 --- a/db/schema_migrations/20191205084057 +++ /dev/null @@ -1 +0,0 @@ -4c19ab1d92e17d8f4c1ede1bf531bb10f49ae7de652d1e095e8960b9389cc1ca
\ No newline at end of file diff --git a/db/schema_migrations/20191205094702 b/db/schema_migrations/20191205094702 deleted file mode 100644 index b3517ddf4a0..00000000000 --- a/db/schema_migrations/20191205094702 +++ /dev/null @@ -1 +0,0 @@ -05d06d068a1aa69a0cc98c2afbb29f56383c8a9f359a384c0f507a1772691364
\ No newline at end of file diff --git a/db/schema_migrations/20191205145647 b/db/schema_migrations/20191205145647 deleted file mode 100644 index 1b15d2b4678..00000000000 --- a/db/schema_migrations/20191205145647 +++ /dev/null @@ -1 +0,0 @@ -01fda9edd67623e926ef8f69df6b9bb513e104e946eb1792962c1a53300314ce
\ No newline at end of file diff --git a/db/schema_migrations/20191205212923 b/db/schema_migrations/20191205212923 deleted file mode 100644 index 772445da80a..00000000000 --- a/db/schema_migrations/20191205212923 +++ /dev/null @@ -1 +0,0 @@ -638b863fa43469ae13e1a6c26641ca78efd540f37c65e0cdde84ce50094d0b19
\ No newline at end of file diff --git a/db/schema_migrations/20191205212924 b/db/schema_migrations/20191205212924 deleted file mode 100644 index e50daa13b35..00000000000 --- a/db/schema_migrations/20191205212924 +++ /dev/null @@ -1 +0,0 @@ -63fbe631eb572d7f81f17ea6915677733d9b6721c63f1ef7deeaa59ee8d3ae73
\ No newline at end of file diff --git a/db/schema_migrations/20191206014412 b/db/schema_migrations/20191206014412 deleted file mode 100644 index a87cf83eddf..00000000000 --- a/db/schema_migrations/20191206014412 +++ /dev/null @@ -1 +0,0 @@ -69ef905f6d998d95d61d685c7779779cca9c92dc788d9a184de75db8c879473e
\ No newline at end of file diff --git a/db/schema_migrations/20191206022133 b/db/schema_migrations/20191206022133 deleted file mode 100644 index 92eb71e3845..00000000000 --- a/db/schema_migrations/20191206022133 +++ /dev/null @@ -1 +0,0 @@ -81aaa536db74a7a66d6ee0fcdfa76762b5c14a00394c22d503264585cb1200c7
\ No newline at end of file diff --git a/db/schema_migrations/20191206122926 b/db/schema_migrations/20191206122926 deleted file mode 100644 index c61d1af8d57..00000000000 --- a/db/schema_migrations/20191206122926 +++ /dev/null @@ -1 +0,0 @@ -a6f27e42abe8fed6bc3b0ee258cbf726c9333f668c8505f01b7e6315070bb558
\ No newline at end of file diff --git a/db/schema_migrations/20191207104000 b/db/schema_migrations/20191207104000 deleted file mode 100644 index c73265e1199..00000000000 --- a/db/schema_migrations/20191207104000 +++ /dev/null @@ -1 +0,0 @@ -6e187a835f10cce06751a1e947aa959b0e2d502a34f06b35f9d3cfdf2cebfb10
\ No newline at end of file diff --git a/db/schema_migrations/20191208071111 b/db/schema_migrations/20191208071111 deleted file mode 100644 index 036aa083776..00000000000 --- a/db/schema_migrations/20191208071111 +++ /dev/null @@ -1 +0,0 @@ -8981bd157b2f8d2b1266a6fb6010512db62b87c70de1697f823c9e640e7c388e
\ No newline at end of file diff --git a/db/schema_migrations/20191208071112 b/db/schema_migrations/20191208071112 deleted file mode 100644 index 5d31e770144..00000000000 --- a/db/schema_migrations/20191208071112 +++ /dev/null @@ -1 +0,0 @@ -605bf0362a0d8d49d90988b3d2cbae090b2e8581abb92917dc7a9386523078b0
\ No newline at end of file diff --git a/db/schema_migrations/20191208110214 b/db/schema_migrations/20191208110214 deleted file mode 100644 index 4dd809b90d4..00000000000 --- a/db/schema_migrations/20191208110214 +++ /dev/null @@ -1 +0,0 @@ -465e9e689823449a33572ee5a627d013588d7ccc5c76ae91de4c7c234e45e3ca
\ No newline at end of file diff --git a/db/schema_migrations/20191209143606 b/db/schema_migrations/20191209143606 deleted file mode 100644 index b6c338450ab..00000000000 --- a/db/schema_migrations/20191209143606 +++ /dev/null @@ -1 +0,0 @@ -d3d75b6d9ff04a962f6cb5658bae562283192c87abeb14e892acf0bb6687889c
\ No newline at end of file diff --git a/db/schema_migrations/20191209215316 b/db/schema_migrations/20191209215316 deleted file mode 100644 index 81aaae042b2..00000000000 --- a/db/schema_migrations/20191209215316 +++ /dev/null @@ -1 +0,0 @@ -e806129b477df3b35e1f07a3b99f0401b274501f3f31eb4129ce36ca0f74722e
\ No newline at end of file diff --git a/db/schema_migrations/20191210211253 b/db/schema_migrations/20191210211253 deleted file mode 100644 index 454b42ad4f7..00000000000 --- a/db/schema_migrations/20191210211253 +++ /dev/null @@ -1 +0,0 @@ -f6f67802ab8cc8afbe71665bbc64bec9aeb449e906cd5a56707397eb16a1fb66
\ No newline at end of file diff --git a/db/schema_migrations/20191212140117 b/db/schema_migrations/20191212140117 deleted file mode 100644 index 613824d8cad..00000000000 --- a/db/schema_migrations/20191212140117 +++ /dev/null @@ -1 +0,0 @@ -1d83c19bb8d866dd60dcc53f306a11a6316a854bb8d875ecab022460a2b07d1d
\ No newline at end of file diff --git a/db/schema_migrations/20191212162434 b/db/schema_migrations/20191212162434 deleted file mode 100644 index 4083063602c..00000000000 --- a/db/schema_migrations/20191212162434 +++ /dev/null @@ -1 +0,0 @@ -d1abf53b84833acf974c32a1d4223fdd47479d5022a292e349b6e24b3751c439
\ No newline at end of file diff --git a/db/schema_migrations/20191213104838 b/db/schema_migrations/20191213104838 deleted file mode 100644 index b3169815754..00000000000 --- a/db/schema_migrations/20191213104838 +++ /dev/null @@ -1 +0,0 @@ -fdfa2335789ddb9508fdf4a73e29df2a5a3dbfb397baf61d921ec317a6be969f
\ No newline at end of file diff --git a/db/schema_migrations/20191213120427 b/db/schema_migrations/20191213120427 deleted file mode 100644 index 0a082dd2505..00000000000 --- a/db/schema_migrations/20191213120427 +++ /dev/null @@ -1 +0,0 @@ -d24902d0d5dc88dded911c37e88dc0761fe78fc79a25e3fb8504ac220534afde
\ No newline at end of file diff --git a/db/schema_migrations/20191213143656 b/db/schema_migrations/20191213143656 deleted file mode 100644 index 3c45a480d46..00000000000 --- a/db/schema_migrations/20191213143656 +++ /dev/null @@ -1 +0,0 @@ -f9582688d3c2a1a28aab27d165e790e011aa2a5c0200469025d00d29c6b505e7
\ No newline at end of file diff --git a/db/schema_migrations/20191213184609 b/db/schema_migrations/20191213184609 deleted file mode 100644 index 16451d7305f..00000000000 --- a/db/schema_migrations/20191213184609 +++ /dev/null @@ -1 +0,0 @@ -fd170a2470e33efc2a6c0fd69afd4fc36865984c187182071a89085af5aea224
\ No newline at end of file diff --git a/db/schema_migrations/20191214175727 b/db/schema_migrations/20191214175727 deleted file mode 100644 index 045c2016393..00000000000 --- a/db/schema_migrations/20191214175727 +++ /dev/null @@ -1 +0,0 @@ -086133ceb36365c403246a6414b863b2997b2c7c74a1e8ee7c9c8992dfb3ccc3
\ No newline at end of file diff --git a/db/schema_migrations/20191216074800 b/db/schema_migrations/20191216074800 deleted file mode 100644 index 0b893f38a8a..00000000000 --- a/db/schema_migrations/20191216074800 +++ /dev/null @@ -1 +0,0 @@ -7de7138769fac2fb1ad346df12a3d88cb72b813df10f70d25fb26ab8b863e34a
\ No newline at end of file diff --git a/db/schema_migrations/20191216074802 b/db/schema_migrations/20191216074802 deleted file mode 100644 index 9f874f446a3..00000000000 --- a/db/schema_migrations/20191216074802 +++ /dev/null @@ -1 +0,0 @@ -1d934cb6bc07b0684cc0662dfc5416dcdddb29c01eb53de46735497a114b51f3
\ No newline at end of file diff --git a/db/schema_migrations/20191216074803 b/db/schema_migrations/20191216074803 deleted file mode 100644 index fa90882e2d5..00000000000 --- a/db/schema_migrations/20191216074803 +++ /dev/null @@ -1 +0,0 @@ -2f112fdcc370faa7a296a178c64970610e98957a877ca38b72e9a074e14f5f47
\ No newline at end of file diff --git a/db/schema_migrations/20191216094119 b/db/schema_migrations/20191216094119 deleted file mode 100644 index a84c0cd2c3d..00000000000 --- a/db/schema_migrations/20191216094119 +++ /dev/null @@ -1 +0,0 @@ -fb45283e30820a5e6df39bc2c7c9e573f5c3cc2f00ca61d69a9cea91d2e52652
\ No newline at end of file diff --git a/db/schema_migrations/20191216183531 b/db/schema_migrations/20191216183531 deleted file mode 100644 index 8dd707681f3..00000000000 --- a/db/schema_migrations/20191216183531 +++ /dev/null @@ -1 +0,0 @@ -0141e744f0690f8e21a7827eac9143e3e3da690e7c115e713da627a0c4969faa
\ No newline at end of file diff --git a/db/schema_migrations/20191216183532 b/db/schema_migrations/20191216183532 deleted file mode 100644 index 7ecab29585d..00000000000 --- a/db/schema_migrations/20191216183532 +++ /dev/null @@ -1 +0,0 @@ -1224e0bcf021942623b90572a3f90b9ae287db440057b5438826c28be10998d6
\ No newline at end of file diff --git a/db/schema_migrations/20191217165641 b/db/schema_migrations/20191217165641 deleted file mode 100644 index 27d596cc2e0..00000000000 --- a/db/schema_migrations/20191217165641 +++ /dev/null @@ -1 +0,0 @@ -a947d467ef4f0016822877103c5cc583976986260dac6bcbacbc72074f34ff41
\ No newline at end of file diff --git a/db/schema_migrations/20191217212348 b/db/schema_migrations/20191217212348 deleted file mode 100644 index dca07895c12..00000000000 --- a/db/schema_migrations/20191217212348 +++ /dev/null @@ -1 +0,0 @@ -4935f553417c0976253b01fe2ab1bfe1e1604b91f98ebd2449ca5d8093fd8fe0
\ No newline at end of file diff --git a/db/schema_migrations/20191218084115 b/db/schema_migrations/20191218084115 deleted file mode 100644 index be5900fb1c4..00000000000 --- a/db/schema_migrations/20191218084115 +++ /dev/null @@ -1 +0,0 @@ -5ae357b24a85d0b6af4a0431f15c484d438bffb43a326f5d480549a1cf7e54b9
\ No newline at end of file diff --git a/db/schema_migrations/20191218122457 b/db/schema_migrations/20191218122457 deleted file mode 100644 index 1184b0b01f0..00000000000 --- a/db/schema_migrations/20191218122457 +++ /dev/null @@ -1 +0,0 @@ -9294caff6d0f3378991fb01a27b42f91516370f79be80242ec3fb8198d42da12
\ No newline at end of file diff --git a/db/schema_migrations/20191218124915 b/db/schema_migrations/20191218124915 deleted file mode 100644 index 5018f9df047..00000000000 --- a/db/schema_migrations/20191218124915 +++ /dev/null @@ -1 +0,0 @@ -9e9c6d0f0a566baa34e8d0eefd1aefe83f410c7e9434f9656afe978d5b145f68
\ No newline at end of file diff --git a/db/schema_migrations/20191218125015 b/db/schema_migrations/20191218125015 deleted file mode 100644 index c82bca1a951..00000000000 --- a/db/schema_migrations/20191218125015 +++ /dev/null @@ -1 +0,0 @@ -355f5e7a57a7375463acac0ff65248342177deb7331c14058f6d99a43b8ded53
\ No newline at end of file diff --git a/db/schema_migrations/20191218190253 b/db/schema_migrations/20191218190253 deleted file mode 100644 index 9c9d23629bc..00000000000 --- a/db/schema_migrations/20191218190253 +++ /dev/null @@ -1 +0,0 @@ -8a922655ef936ae6e7bf908d72a2abd3f86e98d49f0368015f41037d542dcd6b
\ No newline at end of file diff --git a/db/schema_migrations/20191218225624 b/db/schema_migrations/20191218225624 deleted file mode 100644 index 94de7b6ba9f..00000000000 --- a/db/schema_migrations/20191218225624 +++ /dev/null @@ -1 +0,0 @@ -7b6353cddda5a112f07aab18d60a1f19b7642ff8e28c230cf7c70f60d9f72786
\ No newline at end of file diff --git a/db/schema_migrations/20191223124940 b/db/schema_migrations/20191223124940 deleted file mode 100644 index dc8f1cfabed..00000000000 --- a/db/schema_migrations/20191223124940 +++ /dev/null @@ -1 +0,0 @@ -301ed1f9806c487f4881a9a106e279886fee673f3a5a0b8286be42bef7dd71ca
\ No newline at end of file diff --git a/db/schema_migrations/20191225071320 b/db/schema_migrations/20191225071320 deleted file mode 100644 index a619481bc3d..00000000000 --- a/db/schema_migrations/20191225071320 +++ /dev/null @@ -1 +0,0 @@ -f121043e5aab5ea296d097aaa6d67578a79b5adf880b21131cb6acf47d9b4043
\ No newline at end of file diff --git a/db/schema_migrations/20191227140254 b/db/schema_migrations/20191227140254 deleted file mode 100644 index fdc502a2343..00000000000 --- a/db/schema_migrations/20191227140254 +++ /dev/null @@ -1 +0,0 @@ -6d6f619112cdee207974400e32c4de69de0c46886970e98c14f4f8bf2e8cba16
\ No newline at end of file diff --git a/db/schema_migrations/20191229140154 b/db/schema_migrations/20191229140154 deleted file mode 100644 index 206302fc44c..00000000000 --- a/db/schema_migrations/20191229140154 +++ /dev/null @@ -1 +0,0 @@ -88847b6705613c12002bd87adc5c3d966a4a6a68515a613e633ca56e0ec769f1
\ No newline at end of file diff --git a/doc/administration/auth/oidc.md b/doc/administration/auth/oidc.md index 6a037e75f54..12729f2050b 100644 --- a/doc/administration/auth/oidc.md +++ b/doc/administration/auth/oidc.md @@ -228,8 +228,7 @@ Azure B2C [offers two ways of defining the business logic for logging in a user] While cumbersome to configure, custom policies are required because standard Azure B2C user flows [do not send the OpenID `email` claim](https://github.com/MicrosoftDocs/azure-docs/issues/16566). In -other words, they do not work with the [`allow_single_sign_on` or `auto_link_user` -parameters](../../integration/omniauth.md#initial-omniauth-configuration). +other words, they do not work with the [`allow_single_sign_on` or `auto_link_user` parameters](../../integration/omniauth.md#initial-omniauth-configuration). With a standard Azure B2C policy, GitLab cannot create a new account or link to an existing one with an email address. diff --git a/doc/administration/geo/replication/troubleshooting.md b/doc/administration/geo/replication/troubleshooting.md index d8b1cd129ab..b7370d32056 100644 --- a/doc/administration/geo/replication/troubleshooting.md +++ b/doc/administration/geo/replication/troubleshooting.md @@ -292,9 +292,8 @@ be set on the **primary** database. In GitLab 9.4, we have made this setting default to 1. You may need to increase this value if you have more **secondary** nodes. -Be sure to restart PostgreSQL for this to take -effect. See the [PostgreSQL replication -setup](../setup/database.md#postgresql-replication) guide for more details. +Be sure to restart PostgreSQL for this to take effect. See the +[PostgreSQL replication setup](../setup/database.md#postgresql-replication) guide for more details. ### Message: `FATAL: could not start WAL streaming: ERROR: replication slot "geo_secondary_my_domain_com" does not exist`? diff --git a/doc/administration/invalidate_markdown_cache.md b/doc/administration/invalidate_markdown_cache.md index 7a880c81843..855910fec6a 100644 --- a/doc/administration/invalidate_markdown_cache.md +++ b/doc/administration/invalidate_markdown_cache.md @@ -15,8 +15,8 @@ in the cached text would still refer to the old URL. To avoid this problem, the administrator can invalidate the existing cache by increasing the `local_markdown_version` setting in application settings. This can -be done by [changing the application settings through -the API](../api/settings.md#change-application-settings): +be done by changing the application settings +[through the API](../api/settings.md#change-application-settings): ```shell curl --request PUT --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/application/settings?local_markdown_version=<increased_number>" diff --git a/doc/administration/operations/ssh_certificates.md b/doc/administration/operations/ssh_certificates.md index ad99007d078..77dc4eb180b 100644 --- a/doc/administration/operations/ssh_certificates.md +++ b/doc/administration/operations/ssh_certificates.md @@ -21,8 +21,7 @@ upload the new keys to GitLab. WARNING: OpenSSH version 6.9+ is required because that version introduced the `AuthorizedPrincipalsCommand` configuration option. If -using CentOS 6, you can [follow these -instructions](fast_ssh_key_lookup.html#compiling-a-custom-version-of-openssh-for-centos-6) +using CentOS 6, you can [follow these instructions](fast_ssh_key_lookup.md#compiling-a-custom-version-of-openssh-for-centos-6) to compile an up-to-date version. ## Why use OpenSSH certificates? diff --git a/doc/administration/packages/dependency_proxy.md b/doc/administration/packages/dependency_proxy.md index bb4a39ebc0d..a394a32fc18 100644 --- a/doc/administration/packages/dependency_proxy.md +++ b/doc/administration/packages/dependency_proxy.md @@ -29,7 +29,7 @@ To enable the dependency proxy feature: gitlab_rails['dependency_proxy_enabled'] = true ``` -1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab") for the changes to take effect. +1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect. 1. Enable the [Puma web server](../operations/puma.md). **Helm chart installations** @@ -88,7 +88,7 @@ To change the local storage path: gitlab_rails['dependency_proxy_storage_path'] = "/mnt/dependency_proxy" ``` -1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab") for the changes to take effect. +1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect. **Installations from source** @@ -145,7 +145,7 @@ This section describes the earlier configuration format. } ``` -1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab") for the changes to take effect. +1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect. **Installations from source** diff --git a/doc/administration/packages/index.md b/doc/administration/packages/index.md index 37473d35573..90f2d9127fe 100644 --- a/doc/administration/packages/index.md +++ b/doc/administration/packages/index.md @@ -68,7 +68,7 @@ To enable the Packages feature: gitlab_rails['packages_enabled'] = true ``` -1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab") for the changes to take effect. +1. Save the file and [reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect. **Installations from source** @@ -80,7 +80,7 @@ To enable the Packages feature: enabled: true ``` -1. [Restart GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure "How to reconfigure Omnibus GitLab") for the changes to take effect. +1. [Restart GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect. **Helm Chart installations** @@ -92,7 +92,7 @@ To enable the Packages feature: enabled: true ``` -1. [Restart GitLab](../restart_gitlab.md#helm-chart-installations "How to reconfigure Helm GitLab") for the changes to take effect. +1. [Restart GitLab](../restart_gitlab.md#helm-chart-installations) for the changes to take effect. ## Rate limits diff --git a/doc/administration/redis/standalone.md b/doc/administration/redis/standalone.md index 42482475d26..8a3b88780a1 100644 --- a/doc/administration/redis/standalone.md +++ b/doc/administration/redis/standalone.md @@ -44,8 +44,7 @@ Omnibus GitLab: 1. [Reconfigure Omnibus GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect. 1. Note the Redis node's IP address or hostname, port, and - Redis password. These will be necessary when [configuring the GitLab - application servers](#set-up-the-gitlab-rails-application-instance). + Redis password. These will be necessary when [configuring the GitLab application servers](#set-up-the-gitlab-rails-application-instance). [Advanced configuration options](https://docs.gitlab.com/omnibus/settings/redis.html) are supported and can be added if needed. diff --git a/doc/administration/reference_architectures/2k_users.md b/doc/administration/reference_architectures/2k_users.md index 4a7ecc7defb..23b15b563f7 100644 --- a/doc/administration/reference_architectures/2k_users.md +++ b/doc/administration/reference_architectures/2k_users.md @@ -303,8 +303,8 @@ further configuration steps. 1. [Reconfigure GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect. 1. Note the PostgreSQL node's IP address or hostname, port, and - plain text password. These will be necessary when configuring the [GitLab - application server](#configure-gitlab-rails) later. + plain text password. These will be necessary when configuring the + [GitLab application server](#configure-gitlab-rails) later. Advanced [configuration options](https://docs.gitlab.com/omnibus/settings/database.html) are supported and can be added if needed. @@ -386,8 +386,8 @@ Omnibus: 1. [Reconfigure Omnibus GitLab](../restart_gitlab.md#omnibus-gitlab-reconfigure) for the changes to take effect. 1. Note the Redis node's IP address or hostname, port, and - Redis password. These will be necessary when [configuring the GitLab - application servers](#configure-gitlab-rails) later. + Redis password. These will be necessary when + [configuring the GitLab application servers](#configure-gitlab-rails) later. Advanced [configuration options](https://docs.gitlab.com/omnibus/settings/redis.html) are supported and can be added if needed. diff --git a/doc/ci/docker/using_kaniko.md b/doc/ci/docker/using_kaniko.md index 853b1aaca42..69c4557dcbe 100644 --- a/doc/ci/docker/using_kaniko.md +++ b/doc/ci/docker/using_kaniko.md @@ -13,8 +13,8 @@ type: howto container images from a Dockerfile, inside a container or Kubernetes cluster. kaniko solves two problems with using the -[Docker-in-Docker -build](using_docker_build.md#use-the-docker-executor-with-the-docker-image-docker-in-docker) method: +[Docker-in-Docker build](using_docker_build.md#use-the-docker-executor-with-the-docker-image-docker-in-docker) +method: - Docker-in-Docker requires [privileged mode](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities) to function, which is a significant security concern. diff --git a/doc/ci/examples/end_to_end_testing_webdriverio/index.md b/doc/ci/examples/end_to_end_testing_webdriverio/index.md index 1fecd6b1b78..a9794afaf10 100644 --- a/doc/ci/examples/end_to_end_testing_webdriverio/index.md +++ b/doc/ci/examples/end_to_end_testing_webdriverio/index.md @@ -150,8 +150,8 @@ need to do for this: 1. Update our WebdriverIO configuration to use those browsers to visit the review apps. For the scope of this article, we've defined an additional [CI/CD stage](../../yaml/index.md#stages) -`confidence-check` that is executed _after_ the stage that deploys the review app. It uses the `node:latest` [Docker -image](../../docker/using_docker_images.md). However, WebdriverIO fires up actual browsers +`confidence-check` that is executed _after_ the stage that deploys the review app. It uses the `node:latest` +[Docker image](../../docker/using_docker_images.md). However, WebdriverIO fires up actual browsers to interact with your application, so we need to install and run them. Furthermore, WebdriverIO uses Selenium as a common interface to control different browsers, so we need to install and run Selenium as well. Luckily, the Selenium project provides the Docker images diff --git a/doc/development/sql.md b/doc/development/sql.md index 3483305c113..129280598fe 100644 --- a/doc/development/sql.md +++ b/doc/development/sql.md @@ -241,7 +241,7 @@ MergeRequest.where(source_project_id: Project.all.select(:id)) ``` The _only_ time you should use `pluck` is when you actually need to operate on -the values in Ruby itself (e.g. write them to a file). In almost all other cases +the values in Ruby itself (for example, writing them to a file). In almost all other cases you should ask yourself "Can I not just use a sub-query?". In line with our `CodeReuse/ActiveRecord` cop, you should only use forms like diff --git a/doc/development/testing_guide/end_to_end/dynamic_element_validation.md b/doc/development/testing_guide/end_to_end/dynamic_element_validation.md index 6c504e6fa28..8770a5d33cd 100644 --- a/doc/development/testing_guide/end_to_end/dynamic_element_validation.md +++ b/doc/development/testing_guide/end_to_end/dynamic_element_validation.md @@ -52,7 +52,7 @@ Simply put, a required element is a visible HTML element that appears on a UI co "Visible" can be defined as -- Not having any CSS preventing its display. E.g.: `display: none` or `width: 0px; height: 0px;` +- Not having any CSS preventing its display, for example, `display: none` or `width: 0px; height: 0px;` - Being able to be interacted with by the user "UI component" can be defined as diff --git a/doc/development/testing_guide/end_to_end/page_objects.md b/doc/development/testing_guide/end_to_end/page_objects.md index 9ffa7ea4f77..85ab4d479f9 100644 --- a/doc/development/testing_guide/end_to_end/page_objects.md +++ b/doc/development/testing_guide/end_to_end/page_objects.md @@ -105,7 +105,7 @@ code but **this is deprecated** in favor of the above method for two reasons: - Consistency: there is only one way to define an element - Separation of concerns: QA uses dedicated `data-qa-*` attributes instead of reusing code - or classes used by other components (e.g. `js-*` classes etc.) + or classes used by other components (for example, `js-*` classes etc.) ```ruby view 'app/views/my/view.html.haml' do diff --git a/doc/development/testing_guide/flaky_tests.md b/doc/development/testing_guide/flaky_tests.md index bfcd68dbaf3..9489020de5d 100644 --- a/doc/development/testing_guide/flaky_tests.md +++ b/doc/development/testing_guide/flaky_tests.md @@ -37,9 +37,9 @@ bin/rspec --tag quarantine Once a test is in quarantine, there are 3 choices: -- Should the test be fixed (i.e. get rid of its flakiness)? +- Should the test be fixed (that is, get rid of its flakiness)? - Should the test be moved to a lower level of testing? -- Should the test be removed entirely (e.g. because there's already a +- Should the test be removed entirely (for example, because there's already a lower-level test, or it's duplicating another same-level test, or it's testing too much etc.)? diff --git a/doc/development/windows.md b/doc/development/windows.md index d577e90932b..fb095b68939 100644 --- a/doc/development/windows.md +++ b/doc/development/windows.md @@ -136,7 +136,7 @@ PowerShell has aliases for all of the following commands so you don't have to le - `/` ---> `\` (path separator) - `cat` ---> `type` - `mv` ---> `move` -- Redirection works the same (i.e. `>` and `2>&1`) +- Redirection works the same (for example, `>` and `2>&1`) - `.\some.exe` to call a local executable - curl is available - `..` and `.` are available diff --git a/doc/operations/error_tracking.md b/doc/operations/error_tracking.md index b41fc5407ad..fe5ebce48ff 100644 --- a/doc/operations/error_tracking.md +++ b/doc/operations/error_tracking.md @@ -129,7 +129,7 @@ If another event occurs, the error reverts to unresolved. ## Integrated error tracking -> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/329596) in GitLab 14.3. +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/329596) in GitLab 14.4. Integrated error tracking is a lightweight alternative to Sentry backend. You still use Sentry SDK with your application. But you don't need to deploy Sentry @@ -143,8 +143,7 @@ Sentry integration. ### Project settings -The feature should be enabled on the project level. However, there is no UI to enable this feature yet. -You must use the GitLab API to enable it. +The feature should be enabled on the project level via the GitLab API. Once configured, users can setup their Error Tracking and DSN in the UI under Settings. #### How to enable diff --git a/doc/user/project/merge_requests/confidential.md b/doc/user/project/merge_requests/confidential.md index 6df84dd1dd1..ff2e6acf123 100644 --- a/doc/user/project/merge_requests/confidential.md +++ b/doc/user/project/merge_requests/confidential.md @@ -11,11 +11,11 @@ info: To determine the technical writer assigned to the Stage/Group associated w Merge requests in a public repository are also public, even when the merge request is created for a [confidential issue](../issues/confidential_issues.md). To avoid leaking confidential information when working on a confidential issue, -create your merge request from a private fork. +create your merge request from a private fork in the same namespace. Roles are inherited from parent groups. If you create your private fork in the -same group or subgroup as the original (public) repository, developers receive -the same permissions in your fork. This inheritance ensures: +same namespace (same group or subgroup) as the original (public) repository, +developers receive the same permissions in your fork. This inheritance ensures: - Developer users have the needed permissions to view confidential issues and resolve them. - You do not need grant individual users access to your fork. @@ -24,13 +24,17 @@ The [security practices for confidential merge requests](https://gitlab.com/gitl ## Create a confidential merge request -WARNING: -To create a confidential merge request, you must create a private fork. This fork -may expose confidential information, if you create your fork in another namespace -that may have other members. - Branches are public by default. To protect the confidentiality of your work, you -must create your changes in a private fork. +must create your branches and merge requests in the same namespace, but downstream +in a private fork. If you create your private fork in the same namespace as the +public repository, your fork inherits the permissions of the upstream public repository. +Users with the Developer role in the upstream public repository inherit those upstream +permissions in your downstream private fork without action by you. These users can +immediately push code to branches in your private fork to help fix the confidential issue. + +WARNING: +Your private fork may expose confidential information, if you create it in a different +namespace than the upstream repository. The two namespaces may not contain the same users. Prerequisites: @@ -56,16 +60,15 @@ To create a confidential merge request: branches must be available in your selected fork. 1. Select **Create**. -If you created a branch in your private fork, users with the Developer role in the -public repository can push code to that branch in your private fork to fix the -confidential issue. +This merge request targets your private fork, not the public upstream project. +Your branch, merge requests, and commits remain in your private fork. This prevents +prematurely revealing confidential information. -As your merge request targets your private fork, not the public upstream project, -your branch, merge request, and commits do not enter the public repository. This -prevents prematurely revealing confidential information. +Open a merge request +[from your fork to the upstream repository](../repository/forking_workflow.md#merging-upstream) when: -To make a confidential commit public, open a merge request from the private fork -to the public upstream project. +- You are satisfied the problem is resolved in your private fork. +- You are ready to make the confidential commits public. ## Related links diff --git a/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml index e0627b85aba..65a58130962 100644 --- a/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Jobs/DAST-Default-Branch-Deploy.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - DAST_AUTO_DEPLOY_IMAGE_VERSION: 'v2.12.0' + DAST_AUTO_DEPLOY_IMAGE_VERSION: 'v2.14.0' .dast-auto-deploy: image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:${DAST_AUTO_DEPLOY_IMAGE_VERSION}" diff --git a/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml index 2df985cfbb5..58f13746a1f 100644 --- a/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml +++ b/lib/gitlab/ci/templates/Jobs/Deploy.gitlab-ci.yml @@ -1,5 +1,5 @@ variables: - AUTO_DEPLOY_IMAGE_VERSION: 'v2.12.0' + AUTO_DEPLOY_IMAGE_VERSION: 'v2.14.0' .auto-deploy: image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-deploy-image:${AUTO_DEPLOY_IMAGE_VERSION}" diff --git a/scripts/verify-tff-mapping b/scripts/verify-tff-mapping index ca73d4f5f7a..ee86f9ecde5 100755 --- a/scripts/verify-tff-mapping +++ b/scripts/verify-tff-mapping @@ -102,14 +102,14 @@ tests = [ { explanation: 'Migration should map to its non-timestamped spec', - source: 'db/migrate/20191023152913_add_default_and_free_plans.rb', - expected: ['spec/migrations/add_default_and_free_plans_spec.rb'] + source: 'db/migrate/20200116175538_update_timestamp_softwarelicensespolicy.rb', + expected: ['spec/migrations/update_timestamp_softwarelicensespolicy_spec.rb'] }, { explanation: 'Migration should map to its timestamped spec', - source: 'db/post_migrate/20190924152703_migrate_issue_trackers_data.rb', - expected: ['spec/migrations/20190924152703_migrate_issue_trackers_data_spec.rb'] + source: 'db/post_migrate/20210915022415_cleanup_bigint_conversion_for_ci_builds.rb', + expected: ['spec/migrations/20210915022415_cleanup_bigint_conversion_for_ci_builds_spec.rb'] }, { diff --git a/spec/frontend/cycle_analytics/mock_data.js b/spec/frontend/cycle_analytics/mock_data.js index 1fbeafd5204..1882457960a 100644 --- a/spec/frontend/cycle_analytics/mock_data.js +++ b/spec/frontend/cycle_analytics/mock_data.js @@ -21,9 +21,10 @@ export const getStageByTitle = (stages, title) => stages.find((stage) => stage.title && stage.title.toLowerCase().trim() === title) || {}; const fixtureEndpoints = { - customizableCycleAnalyticsStagesAndEvents: 'projects/analytics/value_stream_analytics/stages', - stageEvents: (stage) => `projects/analytics/value_stream_analytics/events/${stage}`, - metricsData: 'projects/analytics/value_stream_analytics/summary', + customizableCycleAnalyticsStagesAndEvents: + 'projects/analytics/value_stream_analytics/stages.json', + stageEvents: (stage) => `projects/analytics/value_stream_analytics/events/${stage}.json`, + metricsData: 'projects/analytics/value_stream_analytics/summary.json', }; export const metricsData = getJSONFixture(fixtureEndpoints.metricsData); diff --git a/spec/frontend/fixtures/analytics.rb b/spec/frontend/fixtures/analytics.rb index 4a13d5051a8..b6a5ea6616d 100644 --- a/spec/frontend/fixtures/analytics.rb +++ b/spec/frontend/fixtures/analytics.rb @@ -22,7 +22,7 @@ RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do sign_in(user) end - it 'projects/analytics/value_stream_analytics/stages' do + it 'projects/analytics/value_stream_analytics/stages.json' do get(:index, params: params, format: :json) expect(response).to be_successful @@ -40,7 +40,7 @@ RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do end Gitlab::Analytics::CycleAnalytics::DefaultStages.all.each do |stage| - it "projects/analytics/value_stream_analytics/events/#{stage[:name]}" do + it "projects/analytics/value_stream_analytics/events/#{stage[:name]}.json" do get(stage[:name], params: params, format: :json) expect(response).to be_successful @@ -58,7 +58,7 @@ RSpec.describe 'Analytics (JavaScript fixtures)', :sidekiq_inline do sign_in(user) end - it "projects/analytics/value_stream_analytics/summary" do + it "projects/analytics/value_stream_analytics/summary.json" do get(:show, params: params, format: :json) expect(response).to be_successful diff --git a/spec/lib/gitlab/background_migration/fix_promoted_epics_discussion_ids_spec.rb b/spec/lib/gitlab/background_migration/fix_promoted_epics_discussion_ids_spec.rb index 452fc962c7b..35ec8be691a 100644 --- a/spec/lib/gitlab/background_migration/fix_promoted_epics_discussion_ids_spec.rb +++ b/spec/lib/gitlab/background_migration/fix_promoted_epics_discussion_ids_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::FixPromotedEpicsDiscussionIds, schema: 20190715193142 do +RSpec.describe Gitlab::BackgroundMigration::FixPromotedEpicsDiscussionIds, schema: 20181228175414 do let(:namespaces) { table(:namespaces) } let(:users) { table(:users) } let(:epics) { table(:epics) } diff --git a/spec/lib/gitlab/background_migration/fix_user_namespace_names_spec.rb b/spec/lib/gitlab/background_migration/fix_user_namespace_names_spec.rb index 0d0ad2cc39e..95509f9b897 100644 --- a/spec/lib/gitlab/background_migration/fix_user_namespace_names_spec.rb +++ b/spec/lib/gitlab/background_migration/fix_user_namespace_names_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::FixUserNamespaceNames, schema: 20190620112608 do +RSpec.describe Gitlab::BackgroundMigration::FixUserNamespaceNames, schema: 20181228175414 do let(:namespaces) { table(:namespaces) } let(:users) { table(:users) } let(:user) { users.create!(name: "The user's full name", projects_limit: 10, username: 'not-null', email: '1') } diff --git a/spec/lib/gitlab/background_migration/fix_user_project_route_names_spec.rb b/spec/lib/gitlab/background_migration/fix_user_project_route_names_spec.rb index 211693d917b..b4444df674e 100644 --- a/spec/lib/gitlab/background_migration/fix_user_project_route_names_spec.rb +++ b/spec/lib/gitlab/background_migration/fix_user_project_route_names_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::FixUserProjectRouteNames, schema: 20190620112608 do +RSpec.describe Gitlab::BackgroundMigration::FixUserProjectRouteNames, schema: 20181228175414 do let(:namespaces) { table(:namespaces) } let(:users) { table(:users) } let(:routes) { table(:routes) } diff --git a/spec/lib/gitlab/background_migration/migrate_null_private_profile_to_false_spec.rb b/spec/lib/gitlab/background_migration/migrate_null_private_profile_to_false_spec.rb deleted file mode 100644 index 6ff1157cb86..00000000000 --- a/spec/lib/gitlab/background_migration/migrate_null_private_profile_to_false_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Gitlab::BackgroundMigration::MigrateNullPrivateProfileToFalse, schema: 20190620105427 do - let(:users) { table(:users) } - - it 'correctly migrates nil private_profile to false' do - private_profile_true = users.create!(private_profile: true, projects_limit: 1, email: 'a@b.com') - private_profile_false = users.create!(private_profile: false, projects_limit: 1, email: 'b@c.com') - private_profile_nil = users.create!(private_profile: nil, projects_limit: 1, email: 'c@d.com') - - described_class.new.perform(private_profile_true.id, private_profile_nil.id) - - private_profile_true.reload - private_profile_false.reload - private_profile_nil.reload - - expect(private_profile_true.private_profile).to eq(true) - expect(private_profile_false.private_profile).to eq(false) - expect(private_profile_nil.private_profile).to eq(false) - end -end diff --git a/spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb b/spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb index 815dc2e73e5..b6d93b9ff54 100644 --- a/spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb +++ b/spec/lib/gitlab/background_migration/migrate_pages_metadata_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::MigratePagesMetadata, schema: 20190919040324 do +RSpec.describe Gitlab::BackgroundMigration::MigratePagesMetadata, schema: 20181228175414 do let(:projects) { table(:projects) } subject(:migrate_pages_metadata) { described_class.new } diff --git a/spec/lib/gitlab/background_migration/populate_merge_request_assignees_table_spec.rb b/spec/lib/gitlab/background_migration/populate_merge_request_assignees_table_spec.rb index 4e7872a9a1b..1d8eed53553 100644 --- a/spec/lib/gitlab/background_migration/populate_merge_request_assignees_table_spec.rb +++ b/spec/lib/gitlab/background_migration/populate_merge_request_assignees_table_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::PopulateMergeRequestAssigneesTable, schema: 20190315191339 do +RSpec.describe Gitlab::BackgroundMigration::PopulateMergeRequestAssigneesTable, schema: 20181228175414 do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:users) { table(:users) } diff --git a/spec/migrations/20190924152703_migrate_issue_trackers_data_spec.rb b/spec/migrations/20190924152703_migrate_issue_trackers_data_spec.rb deleted file mode 100644 index dad95760306..00000000000 --- a/spec/migrations/20190924152703_migrate_issue_trackers_data_spec.rb +++ /dev/null @@ -1,64 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration!('migrate_issue_trackers_data') - -RSpec.describe MigrateIssueTrackersData do - let(:services) { table(:services) } - let(:migration_class) { Gitlab::BackgroundMigration::MigrateIssueTrackersSensitiveData } - let(:migration_name) { migration_class.to_s.demodulize } - - let(:properties) do - { - 'url' => 'http://example.com' - } - end - - let!(:jira_integration) do - services.create!(type: 'JiraService', properties: properties, category: 'issue_tracker') - end - - let!(:jira_integration_nil) do - services.create!(type: 'JiraService', properties: nil, category: 'issue_tracker') - end - - let!(:bugzilla_integration) do - services.create!(type: 'BugzillaService', properties: properties, category: 'issue_tracker') - end - - let!(:youtrack_integration) do - services.create!(type: 'YoutrackService', properties: properties, category: 'issue_tracker') - end - - let!(:youtrack_integration_empty) do - services.create!(type: 'YoutrackService', properties: '', category: 'issue_tracker') - end - - let!(:gitlab_service) do - services.create!(type: 'GitlabIssueTrackerService', properties: properties, category: 'issue_tracker') - end - - let!(:gitlab_service_empty) do - services.create!(type: 'GitlabIssueTrackerService', properties: {}, category: 'issue_tracker') - end - - let!(:other_service) do - services.create!(type: 'OtherService', properties: properties, category: 'other_category') - end - - before do - stub_const("#{described_class}::BATCH_SIZE", 2) - end - - it 'schedules background migrations at correct time' do - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - expect(migration_name).to be_scheduled_delayed_migration(3.minutes, jira_integration.id, bugzilla_integration.id) - expect(migration_name).to be_scheduled_delayed_migration(6.minutes, youtrack_integration.id, gitlab_service.id) - expect(BackgroundMigrationWorker.jobs.size).to eq(2) - end - end - end -end diff --git a/spec/migrations/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects_spec.rb b/spec/migrations/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects_spec.rb deleted file mode 100644 index 731bc923910..00000000000 --- a/spec/migrations/20191015154408_drop_merge_requests_require_code_owner_approval_from_projects_spec.rb +++ /dev/null @@ -1,56 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration!('drop_merge_requests_require_code_owner_approval_from_projects') - -RSpec.describe DropMergeRequestsRequireCodeOwnerApprovalFromProjects do - let(:projects_table) { table(:projects) } - - subject(:migration) { described_class.new } - - describe "without running the migration" do - it "project_table has a :merge_requests_require_code_owner_approval column" do - expect(projects_table.column_names) - .to include("merge_requests_require_code_owner_approval") - end - - it "project_table has a :projects_requiring_code_owner_approval index" do - expect(ActiveRecord::Base.connection.indexes(:projects).collect(&:name)) - .to include("projects_requiring_code_owner_approval") - end - end - - describe '#up' do - context "without running " - before do - migrate! - end - - it "drops the :merge_requests_require_code_owner_approval column" do - expect(projects_table.column_names) - .not_to include("merge_requests_require_code_owner_approval") - end - - it "drops the :projects_requiring_code_owner_approval index" do - expect(ActiveRecord::Base.connection.indexes(:projects).collect(&:name)) - .not_to include("projects_requiring_code_owner_approval") - end - end - - describe "#down" do - before do - migration.up - migration.down - end - - it "project_table has a :merge_requests_require_code_owner_approval column" do - expect(projects_table.column_names) - .to include("merge_requests_require_code_owner_approval") - end - - it "project_table has a :projects_requiring_code_owner_approval index" do - expect(ActiveRecord::Base.connection.indexes(:projects).collect(&:name)) - .to include("projects_requiring_code_owner_approval") - end - end -end diff --git a/spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb b/spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb deleted file mode 100644 index 222a000c134..00000000000 --- a/spec/migrations/20191125114345_add_admin_mode_protected_path_spec.rb +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration!('add_admin_mode_protected_path') - -RSpec.describe AddAdminModeProtectedPath do - subject(:migration) { described_class.new } - - let(:admin_mode_endpoint) { '/admin/session' } - let(:application_settings) { table(:application_settings) } - - context 'no settings available' do - it 'makes no changes' do - expect { migrate! }.not_to change { application_settings.count } - end - end - - context 'protected_paths is null' do - before do - application_settings.create!(protected_paths: nil) - end - - it 'makes no changes' do - expect { migrate! }.not_to change { application_settings.first.protected_paths } - end - end - - it 'appends admin mode endpoint' do - application_settings.create!(protected_paths: '{a,b,c}') - - protected_paths_before = %w[a b c] - protected_paths_after = protected_paths_before.dup << admin_mode_endpoint - - expect { migrate! }.to change { application_settings.first.protected_paths }.from(protected_paths_before).to(protected_paths_after) - end - - it 'new default includes admin mode endpoint' do - settings_before = application_settings.create! - - expect(settings_before.protected_paths).not_to include(admin_mode_endpoint) - - migrate! - - application_settings.reset_column_information - settings_after = application_settings.create! - - expect(settings_after.protected_paths).to include(admin_mode_endpoint) - end -end diff --git a/spec/migrations/20191204114127_delete_legacy_triggers_spec.rb b/spec/migrations/20191204114127_delete_legacy_triggers_spec.rb deleted file mode 100644 index aba3a902888..00000000000 --- a/spec/migrations/20191204114127_delete_legacy_triggers_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration!('delete_legacy_triggers') - -RSpec.describe DeleteLegacyTriggers, schema: 2019_11_25_140458 do - let(:ci_trigger_table) { table(:ci_triggers) } - let(:user) { table(:users).create!(name: 'test', email: 'test@example.com', projects_limit: 1) } - - before do - @trigger_with_user = ci_trigger_table.create!(owner_id: user.id) - ci_trigger_table.create!(owner_id: nil) - ci_trigger_table.create!(owner_id: nil) - end - - it 'removes legacy triggers which has null owner_id' do - expect do - migrate! - end.to change(ci_trigger_table, :count).by(-2) - - expect(ci_trigger_table.all).to eq([@trigger_with_user]) - end -end diff --git a/spec/migrations/add_default_and_free_plans_spec.rb b/spec/migrations/add_default_and_free_plans_spec.rb deleted file mode 100644 index 7256e4928af..00000000000 --- a/spec/migrations/add_default_and_free_plans_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration!('add_default_and_free_plans') - -RSpec.describe AddDefaultAndFreePlans do - describe 'migrate' do - let(:plans) { table(:plans) } - - context 'when on Gitlab.com' do - before do - expect(Gitlab).to receive(:com?) { true } - end - - it 'creates free and default plans' do - expect { migrate! }.to change { plans.count }.by 2 - - expect(plans.last(2).pluck(:name)).to eq %w[free default] - end - end - - context 'when on self-hosted' do - before do - expect(Gitlab).to receive(:com?) { false } - end - - it 'creates only a default plan' do - expect { migrate! }.to change { plans.count }.by 1 - - expect(plans.last.name).to eq 'default' - end - end - end -end diff --git a/spec/migrations/add_unique_constraint_to_approvals_user_id_and_merge_request_id_spec.rb b/spec/migrations/add_unique_constraint_to_approvals_user_id_and_merge_request_id_spec.rb deleted file mode 100644 index 795de51d387..00000000000 --- a/spec/migrations/add_unique_constraint_to_approvals_user_id_and_merge_request_id_spec.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe AddUniqueConstraintToApprovalsUserIdAndMergeRequestId do - let(:migration) { described_class.new } - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:merge_requests) { table(:merge_requests) } - let(:approvals) { table(:approvals) } - - describe '#up' do - before do - namespaces.create!(id: 1, name: 'ns', path: 'ns') - projects.create!(id: 1, namespace_id: 1) - merge_requests.create!(id: 1, target_branch: 'master', source_branch: 'feature-1', target_project_id: 1) - merge_requests.create!(id: 2, target_branch: 'master', source_branch: 'feature-2', target_project_id: 1) - end - - it 'deletes duplicate records and keeps the first one' do - first_approval = approvals.create!(id: 1, merge_request_id: 1, user_id: 1) - approvals.create!(id: 2, merge_request_id: 1, user_id: 1) - - migration.up - - expect(approvals.all.to_a).to contain_exactly(first_approval) - end - - it 'does not delete unique records' do - unique_approvals = [ - approvals.create(id: 1, merge_request_id: 1, user_id: 1), - approvals.create(id: 2, merge_request_id: 1, user_id: 2), - approvals.create(id: 3, merge_request_id: 2, user_id: 1) - ] - - migration.up - - expect(approvals.all.to_a).to contain_exactly(*unique_approvals) - end - - it 'creates unique index' do - migration.up - - expect(migration.index_exists?(:approvals, [:user_id, :merge_request_id], unique: true)).to be_truthy - end - end - - describe '#down' do - it 'removes unique index' do - migration.up - migration.down - - expect(migration.index_exists?(:approvals, [:user_id, :merge_request_id], unique: true)).to be_falsey - end - end -end diff --git a/spec/migrations/backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table_spec.rb b/spec/migrations/backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table_spec.rb deleted file mode 100644 index ea6599fc122..00000000000 --- a/spec/migrations/backfill_and_add_not_null_constraint_to_released_at_column_on_releases_table_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe BackfillAndAddNotNullConstraintToReleasedAtColumnOnReleasesTable do - let(:releases) { table(:releases) } - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - - subject(:migration) { described_class.new } - - it 'fills released_at with the value of created_at' do - created_at_a = Time.zone.parse('2019-02-10T08:00:00Z') - created_at_b = Time.zone.parse('2019-03-10T18:00:00Z') - namespace = namespaces.create!(name: 'foo', path: 'foo') - project = projects.create!(namespace_id: namespace.id) - release_a = releases.create!(project_id: project.id, created_at: created_at_a) - release_b = releases.create!(project_id: project.id, created_at: created_at_b) - - disable_migrations_output { migration.up } - - release_a.reload - release_b.reload - expect(release_a.released_at).to eq(created_at_a) - expect(release_b.released_at).to eq(created_at_b) - end -end diff --git a/spec/migrations/backfill_operations_feature_flags_active_spec.rb b/spec/migrations/backfill_operations_feature_flags_active_spec.rb deleted file mode 100644 index a28f648c75a..00000000000 --- a/spec/migrations/backfill_operations_feature_flags_active_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe BackfillOperationsFeatureFlagsActive do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:flags) { table(:operations_feature_flags) } - - def setup - namespace = namespaces.create!(name: 'foo', path: 'foo') - projects.create!(namespace_id: namespace.id) - end - - it 'executes successfully when there are no flags in the table' do - setup - - disable_migrations_output { migrate! } - - expect(flags.count).to eq(0) - end - - it 'updates active to true' do - project = setup - flag = flags.create!(project_id: project.id, name: 'test_flag', active: false) - - disable_migrations_output { migrate! } - - expect(flag.reload.active).to eq(true) - end - - it 'updates active to true for multiple flags' do - project = setup - flag_a = flags.create!(project_id: project.id, name: 'test_flag', active: false) - flag_b = flags.create!(project_id: project.id, name: 'other_flag', active: false) - - disable_migrations_output { migrate! } - - expect(flag_a.reload.active).to eq(true) - expect(flag_b.reload.active).to eq(true) - end - - it 'leaves active true if it is already true' do - project = setup - flag = flags.create!(project_id: project.id, name: 'test_flag', active: true) - - disable_migrations_output { migrate! } - - expect(flag.reload.active).to eq(true) - end -end diff --git a/spec/migrations/backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps_spec.rb b/spec/migrations/backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps_spec.rb deleted file mode 100644 index 6e8bcfc050d..00000000000 --- a/spec/migrations/backfill_releases_table_updated_at_and_add_not_null_constraints_to_timestamps_spec.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe BackfillReleasesTableUpdatedAtAndAddNotNullConstraintsToTimestamps do - let(:releases) { table(:releases) } - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - - subject(:migration) { described_class.new } - - it 'fills null updated_at rows with the value of created_at' do - created_at_a = Time.zone.parse('2014-03-11T04:30:00Z') - created_at_b = Time.zone.parse('2019-09-10T12:00:00Z') - namespace = namespaces.create!(name: 'foo', path: 'foo') - project = projects.create!(namespace_id: namespace.id) - release_a = releases.create!(project_id: project.id, - released_at: Time.zone.parse('2014-12-10T06:00:00Z'), - created_at: created_at_a) - release_b = releases.create!(project_id: project.id, - released_at: Time.zone.parse('2019-09-11T06:00:00Z'), - created_at: created_at_b) - release_a.update!(updated_at: nil) - release_b.update!(updated_at: nil) - - disable_migrations_output { migrate! } - - release_a.reload - release_b.reload - expect(release_a.updated_at).to eq(created_at_a) - expect(release_b.updated_at).to eq(created_at_b) - end - - it 'does not change updated_at columns with a value' do - created_at_a = Time.zone.parse('2014-03-11T04:30:00Z') - updated_at_a = Time.zone.parse('2015-01-16T10:00:00Z') - created_at_b = Time.zone.parse('2019-09-10T12:00:00Z') - namespace = namespaces.create!(name: 'foo', path: 'foo') - project = projects.create!(namespace_id: namespace.id) - release_a = releases.create!(project_id: project.id, - released_at: Time.zone.parse('2014-12-10T06:00:00Z'), - created_at: created_at_a, - updated_at: updated_at_a) - release_b = releases.create!(project_id: project.id, - released_at: Time.zone.parse('2019-09-11T06:00:00Z'), - created_at: created_at_b) - release_b.update!(updated_at: nil) - - disable_migrations_output { migrate! } - - release_a.reload - release_b.reload - expect(release_a.updated_at).to eq(updated_at_a) - expect(release_b.updated_at).to eq(created_at_b) - end -end diff --git a/spec/migrations/backport_enterprise_schema_spec.rb b/spec/migrations/backport_enterprise_schema_spec.rb deleted file mode 100644 index de6821001b4..00000000000 --- a/spec/migrations/backport_enterprise_schema_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -require_migration! - -RSpec.describe BackportEnterpriseSchema, schema: 20190329085614 do - include MigrationsHelpers - - def drop_if_exists(table) - active_record_base.connection.drop_table(table) if active_record_base.connection.table_exists?(table) - end - - describe '#up' do - it 'creates new EE tables' do - migrate! - - expect(active_record_base.connection.table_exists?(:epics)).to be true - expect(active_record_base.connection.table_exists?(:geo_nodes)).to be true - end - - context 'missing EE columns' do - before do - drop_if_exists(:epics) - - active_record_base.connection.create_table "epics" do |t| - t.integer :group_id, null: false, index: true - t.integer :author_id, null: false, index: true - end - end - - after do - drop_if_exists(:epics) - end - - it 'flags an error' do - expect { migrate! }.to raise_error(/Your database is missing.*that is present for GitLab EE/) - end - end - end -end diff --git a/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb b/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb deleted file mode 100644 index 24e6f3480f9..00000000000 --- a/spec/migrations/change_outbound_local_requests_whitelist_default_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe ChangeOutboundLocalRequestsWhitelistDefault do - let(:application_settings) { table(:application_settings) } - - it 'defaults to empty array' do - setting = application_settings.create! - setting_with_value = application_settings.create!(outbound_local_requests_whitelist: '{a,b}') - - expect(application_settings.where(outbound_local_requests_whitelist: nil).count).to eq(1) - - migrate! - - expect(application_settings.where(outbound_local_requests_whitelist: nil).count).to eq(0) - expect(setting.reload.outbound_local_requests_whitelist).to eq([]) - expect(setting_with_value.reload.outbound_local_requests_whitelist).to eq(%w[a b]) - end -end diff --git a/spec/migrations/change_packages_size_defaults_in_project_statistics_spec.rb b/spec/migrations/change_packages_size_defaults_in_project_statistics_spec.rb deleted file mode 100644 index 5e3118b0dea..00000000000 --- a/spec/migrations/change_packages_size_defaults_in_project_statistics_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe ChangePackagesSizeDefaultsInProjectStatistics do - let(:project_statistics) { table(:project_statistics) } - let(:projects) { table(:projects) } - - it 'removes null packages_size' do - stats_to_migrate = 10 - - stats_to_migrate.times do |i| - p = projects.create!(name: "project #{i}", namespace_id: 1) - project_statistics.create!(project_id: p.id, namespace_id: p.namespace_id) - end - - expect { migrate! } - .to change { ProjectStatistics.where(packages_size: nil).count } - .from(stats_to_migrate) - .to(0) - end - - it 'defaults packages_size to 0' do - project = projects.create!(name: 'a new project', namespace_id: 2) - stat = project_statistics.create!(project_id: project.id, namespace_id: project.namespace_id) - - expect(stat.packages_size).to be_nil - - migrate! - - stat.reload - expect(stat.packages_size).to eq(0) - end -end diff --git a/spec/migrations/clean_up_noteable_id_for_notes_on_commits_spec.rb b/spec/migrations/clean_up_noteable_id_for_notes_on_commits_spec.rb deleted file mode 100644 index 8de30af13fd..00000000000 --- a/spec/migrations/clean_up_noteable_id_for_notes_on_commits_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe CleanUpNoteableIdForNotesOnCommits do - let(:notes) { table(:notes) } - - before do - notes.create!(noteable_type: 'Commit', commit_id: '3d0a182204cece4857f81c6462720e0ad1af39c9', noteable_id: 3, note: 'Test') - notes.create!(noteable_type: 'Commit', commit_id: '3d0a182204cece4857f81c6462720e0ad1af39c9', noteable_id: 3, note: 'Test') - notes.create!(noteable_type: 'Commit', commit_id: '3d0a182204cece4857f81c6462720e0ad1af39c9', noteable_id: 3, note: 'Test') - - notes.create!(noteable_type: 'Issue', noteable_id: 1, note: 'Test') - notes.create!(noteable_type: 'MergeRequest', noteable_id: 1, note: 'Test') - notes.create!(noteable_type: 'Snippet', noteable_id: 1, note: 'Test') - end - - it 'clears noteable_id for notes on commits' do - expect { migrate! }.to change { dirty_notes_on_commits.count }.from(3).to(0) - end - - it 'does not clear noteable_id for other notes' do - expect { migrate! }.not_to change { other_notes.count } - end - - def dirty_notes_on_commits - notes.where(noteable_type: 'Commit').where.not(noteable_id: nil) - end - - def other_notes - notes.where("noteable_type != 'Commit' AND noteable_id IS NOT NULL") - end -end diff --git a/spec/migrations/cleanup_legacy_artifact_migration_spec.rb b/spec/migrations/cleanup_legacy_artifact_migration_spec.rb deleted file mode 100644 index 6362965cc31..00000000000 --- a/spec/migrations/cleanup_legacy_artifact_migration_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration!('cleanup_legacy_artifact_migration') - -RSpec.describe CleanupLegacyArtifactMigration, :redis do - let(:migration) { spy('migration') } - - context 'when still legacy artifacts exist' do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:pipelines) { table(:ci_pipelines) } - let(:jobs) { table(:ci_builds) } - let(:job_artifacts) { table(:ci_job_artifacts) } - let(:namespace) { namespaces.create!(name: 'gitlab', path: 'gitlab-org') } - let(:project) { projects.create!(name: 'gitlab', path: 'gitlab-ce', namespace_id: namespace.id) } - let(:pipeline) { pipelines.create!(project_id: project.id, ref: 'master', sha: 'adf43c3a') } - let(:archive_file_type) { Gitlab::BackgroundMigration::MigrateLegacyArtifacts::ARCHIVE_FILE_TYPE } - let(:metadata_file_type) { Gitlab::BackgroundMigration::MigrateLegacyArtifacts::METADATA_FILE_TYPE } - let(:local_store) { ::ObjectStorage::Store::LOCAL } - let(:remote_store) { ::ObjectStorage::Store::REMOTE } - let(:legacy_location) { Gitlab::BackgroundMigration::MigrateLegacyArtifacts::LEGACY_PATH_FILE_LOCATION } - - before do - jobs.create!(id: 1, commit_id: pipeline.id, project_id: project.id, status: :success, artifacts_file: 'archive.zip') - jobs.create!(id: 2, commit_id: pipeline.id, project_id: project.id, status: :failed, artifacts_metadata: 'metadata.gz') - jobs.create!(id: 3, commit_id: pipeline.id, project_id: project.id, status: :failed, artifacts_file: 'archive.zip', artifacts_metadata: 'metadata.gz') - jobs.create!(id: 4, commit_id: pipeline.id, project_id: project.id, status: :running) - jobs.create!(id: 5, commit_id: pipeline.id, project_id: project.id, status: :success, artifacts_file: 'archive.zip', artifacts_file_store: remote_store, artifacts_metadata: 'metadata.gz') - jobs.create!(id: 6, commit_id: pipeline.id, project_id: project.id, status: :failed, artifacts_file: 'archive.zip', artifacts_metadata: 'metadata.gz') - end - - it 'steals sidekiq jobs from MigrateLegacyArtifacts background migration' do - expect(Gitlab::BackgroundMigration).to receive(:steal).with('MigrateLegacyArtifacts') - - migrate! - end - - it 'migrates legacy artifacts to ci_job_artifacts table' do - migrate! - - expect(job_artifacts.order(:job_id, :file_type).pluck('project_id, job_id, file_type, file_store, size, expire_at, file, file_sha256, file_location')) - .to eq([[project.id, 1, archive_file_type, local_store, nil, nil, 'archive.zip', nil, legacy_location], - [project.id, 3, archive_file_type, local_store, nil, nil, 'archive.zip', nil, legacy_location], - [project.id, 3, metadata_file_type, local_store, nil, nil, 'metadata.gz', nil, legacy_location], - [project.id, 5, archive_file_type, remote_store, nil, nil, 'archive.zip', nil, legacy_location], - [project.id, 5, metadata_file_type, local_store, nil, nil, 'metadata.gz', nil, legacy_location], - [project.id, 6, archive_file_type, local_store, nil, nil, 'archive.zip', nil, legacy_location], - [project.id, 6, metadata_file_type, local_store, nil, nil, 'metadata.gz', nil, legacy_location]]) - end - end -end diff --git a/spec/migrations/drop_project_ci_cd_settings_merge_trains_enabled_spec.rb b/spec/migrations/drop_project_ci_cd_settings_merge_trains_enabled_spec.rb deleted file mode 100644 index 3093cd85ced..00000000000 --- a/spec/migrations/drop_project_ci_cd_settings_merge_trains_enabled_spec.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe DropProjectCiCdSettingsMergeTrainsEnabled do - let!(:project_ci_cd_setting) { table(:project_ci_cd_settings) } - - it 'correctly migrates up and down' do - reversible_migration do |migration| - migration.before -> { - expect(project_ci_cd_setting.column_names).to include("merge_trains_enabled") - } - - migration.after -> { - project_ci_cd_setting.reset_column_information - expect(project_ci_cd_setting.column_names).not_to include("merge_trains_enabled") - } - end - end -end diff --git a/spec/migrations/encrypt_feature_flags_clients_tokens_spec.rb b/spec/migrations/encrypt_feature_flags_clients_tokens_spec.rb deleted file mode 100644 index 62bd0dafb8e..00000000000 --- a/spec/migrations/encrypt_feature_flags_clients_tokens_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe EncryptFeatureFlagsClientsTokens do - let(:migration) { described_class.new } - let(:feature_flags_clients) { table(:operations_feature_flags_clients) } - let(:projects) { table(:projects) } - let(:plaintext) { "secret-token" } - let(:ciphertext) { Gitlab::CryptoHelper.aes256_gcm_encrypt(plaintext, nonce: Gitlab::CryptoHelper::AES256_GCM_IV_STATIC) } - - describe '#up' do - it 'keeps plaintext token the same and populates token_encrypted if not present' do - project = projects.create!(id: 123, name: 'gitlab1', path: 'gitlab1', namespace_id: 123) - feature_flags_client = feature_flags_clients.create!(project_id: project.id, token: plaintext) - - migration.up - - expect(feature_flags_client.reload.token).to eq(plaintext) - expect(feature_flags_client.reload.token_encrypted).to eq(ciphertext) - end - end - - describe '#down' do - it 'decrypts encrypted token and saves it' do - project = projects.create!(id: 123, name: 'gitlab1', path: 'gitlab1', namespace_id: 123) - feature_flags_client = feature_flags_clients.create!(project_id: project.id, token_encrypted: ciphertext) - - migration.down - - expect(feature_flags_client.reload.token).to eq(plaintext) - expect(feature_flags_client.reload.token_encrypted).to eq(ciphertext) - end - end -end diff --git a/spec/migrations/encrypt_plaintext_attributes_on_application_settings_spec.rb b/spec/migrations/encrypt_plaintext_attributes_on_application_settings_spec.rb deleted file mode 100644 index 2e233816b8b..00000000000 --- a/spec/migrations/encrypt_plaintext_attributes_on_application_settings_spec.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe EncryptPlaintextAttributesOnApplicationSettings do - let(:migration) { described_class.new } - let(:application_settings) { table(:application_settings) } - let(:plaintext) { 'secret-token' } - - plaintext_attributes = %w[ - akismet_api_key - elasticsearch_aws_secret_access_key - recaptcha_private_key - recaptcha_site_key - slack_app_secret - slack_app_verification_token - ].freeze - - describe '#up' do - it 'encrypts token and saves it' do - application_setting = application_settings.create! - application_setting.update_columns( - plaintext_attributes.each_with_object({}) do |plaintext_attribute, attributes| - attributes[plaintext_attribute] = plaintext - end - ) - - migration.up - - application_setting.reload - plaintext_attributes.each do |plaintext_attribute| - expect(application_setting[plaintext_attribute]).not_to be_nil - expect(application_setting["encrypted_#{plaintext_attribute}"]).not_to be_nil - expect(application_setting["encrypted_#{plaintext_attribute}_iv"]).not_to be_nil - end - end - end - - describe '#down' do - it 'decrypts encrypted token and saves it' do - application_setting = application_settings.create!( - plaintext_attributes.each_with_object({}) do |plaintext_attribute, attributes| - attributes[plaintext_attribute] = plaintext - end - ) - - migration.down - - application_setting.reload - plaintext_attributes.each do |plaintext_attribute| - expect(application_setting[plaintext_attribute]).to eq(plaintext) - expect(application_setting["encrypted_#{plaintext_attribute}"]).to be_nil - expect(application_setting["encrypted_#{plaintext_attribute}_iv"]).to be_nil - end - end - end -end diff --git a/spec/migrations/enqueue_reset_merge_status_second_run_spec.rb b/spec/migrations/enqueue_reset_merge_status_second_run_spec.rb deleted file mode 100644 index 49698f60964..00000000000 --- a/spec/migrations/enqueue_reset_merge_status_second_run_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe EnqueueResetMergeStatusSecondRun do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:namespace) { namespaces.create!(name: 'gitlab', path: 'gitlab-org') } - let(:project) { projects.create!(namespace_id: namespace.id, name: 'foo') } - let(:merge_requests) { table(:merge_requests) } - - def create_merge_request(id, extra_params = {}) - params = { - id: id, - target_project_id: project.id, - target_branch: 'master', - source_project_id: project.id, - source_branch: 'mr name', - title: "mr name#{id}" - }.merge(extra_params) - - merge_requests.create!(params) - end - - it 'correctly schedules background migrations' do - create_merge_request(1, state: 'opened', merge_status: 'can_be_merged') - create_merge_request(2, state: 'opened', merge_status: 'can_be_merged') - create_merge_request(3, state: 'opened', merge_status: 'can_be_merged') - create_merge_request(4, state: 'merged', merge_status: 'can_be_merged') - create_merge_request(5, state: 'opened', merge_status: 'unchecked') - - stub_const("#{described_class.name}::BATCH_SIZE", 2) - - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - expect(described_class::MIGRATION) - .to be_scheduled_delayed_migration(5.minutes, 1, 2) - - expect(described_class::MIGRATION) - .to be_scheduled_delayed_migration(10.minutes, 3, 4) - - expect(described_class::MIGRATION) - .to be_scheduled_delayed_migration(15.minutes, 5, 5) - - expect(BackgroundMigrationWorker.jobs.size).to eq(3) - end - end - end -end diff --git a/spec/migrations/enqueue_reset_merge_status_spec.rb b/spec/migrations/enqueue_reset_merge_status_spec.rb deleted file mode 100644 index d62c99b80bc..00000000000 --- a/spec/migrations/enqueue_reset_merge_status_spec.rb +++ /dev/null @@ -1,52 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe EnqueueResetMergeStatus do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:namespace) { namespaces.create!(name: 'gitlab', path: 'gitlab-org') } - let(:project) { projects.create!(namespace_id: namespace.id, name: 'foo') } - let(:merge_requests) { table(:merge_requests) } - - def create_merge_request(id, extra_params = {}) - params = { - id: id, - target_project_id: project.id, - target_branch: 'master', - source_project_id: project.id, - source_branch: 'mr name', - title: "mr name#{id}" - }.merge(extra_params) - - merge_requests.create!(params) - end - - it 'correctly schedules background migrations' do - create_merge_request(1, state: 'opened', merge_status: 'can_be_merged') - create_merge_request(2, state: 'opened', merge_status: 'can_be_merged') - create_merge_request(3, state: 'opened', merge_status: 'can_be_merged') - create_merge_request(4, state: 'merged', merge_status: 'can_be_merged') - create_merge_request(5, state: 'opened', merge_status: 'unchecked') - - stub_const("#{described_class.name}::BATCH_SIZE", 2) - - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - expect(described_class::MIGRATION) - .to be_scheduled_delayed_migration(5.minutes, 1, 2) - - expect(described_class::MIGRATION) - .to be_scheduled_delayed_migration(10.minutes, 3, 4) - - expect(described_class::MIGRATION) - .to be_scheduled_delayed_migration(15.minutes, 5, 5) - - expect(BackgroundMigrationWorker.jobs.size).to eq(3) - end - end - end -end diff --git a/spec/migrations/fill_productivity_analytics_start_date_spec.rb b/spec/migrations/fill_productivity_analytics_start_date_spec.rb deleted file mode 100644 index b348067a752..00000000000 --- a/spec/migrations/fill_productivity_analytics_start_date_spec.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe FillProductivityAnalyticsStartDate do - let(:settings_table) { table('application_settings') } - let(:metrics_table) { table('merge_request_metrics') } - - before do - settings_table.create! - end - - context 'with NO productivity analytics data available' do - it 'sets start_date to NOW' do - expect { migrate! }.to change { - settings_table.first&.productivity_analytics_start_date - }.to(be_like_time(Time.now)) - end - end - - context 'with productivity analytics data available' do - before do - ActiveRecord::Base.transaction do - ActiveRecord::Base.connection.execute('ALTER TABLE merge_request_metrics DISABLE TRIGGER ALL') - metrics_table.create!(merged_at: Time.parse('2019-09-09'), commits_count: nil, merge_request_id: 3) - metrics_table.create!(merged_at: Time.parse('2019-10-10'), commits_count: 5, merge_request_id: 1) - metrics_table.create!(merged_at: Time.parse('2019-11-11'), commits_count: 10, merge_request_id: 2) - ActiveRecord::Base.connection.execute('ALTER TABLE merge_request_metrics ENABLE TRIGGER ALL') - end - end - - it 'set start_date to earliest merged_at value with PA data available' do - expect { migrate! }.to change { - settings_table.first&.productivity_analytics_start_date - }.to(be_like_time(Time.parse('2019-10-10'))) - end - end -end diff --git a/spec/migrations/fix_max_pages_size_spec.rb b/spec/migrations/fix_max_pages_size_spec.rb deleted file mode 100644 index 97cf026df5c..00000000000 --- a/spec/migrations/fix_max_pages_size_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe FixMaxPagesSize do - let(:application_settings) { table(:application_settings) } - let!(:default_setting) { application_settings.create! } - let!(:max_possible_setting) { application_settings.create!(max_pages_size: described_class::MAX_SIZE) } - let!(:higher_than_maximum_setting) { application_settings.create!(max_pages_size: described_class::MAX_SIZE + 1) } - - it 'correctly updates settings only if needed' do - migrate! - - expect(default_setting.reload.max_pages_size).to eq(100) - expect(max_possible_setting.reload.max_pages_size).to eq(described_class::MAX_SIZE) - expect(higher_than_maximum_setting.reload.max_pages_size).to eq(described_class::MAX_SIZE) - end -end diff --git a/spec/migrations/fix_null_type_labels_spec.rb b/spec/migrations/fix_null_type_labels_spec.rb deleted file mode 100644 index 4f902b92393..00000000000 --- a/spec/migrations/fix_null_type_labels_spec.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe FixNullTypeLabels do - let(:migration) { described_class.new } - let(:projects) { table(:projects) } - let(:namespaces) { table(:namespaces) } - let(:labels) { table(:labels) } - - before do - group = namespaces.create!(name: 'labels-test-project', path: 'labels-test-project', type: 'Group') - project = projects.create!(namespace_id: group.id, name: 'labels-test-group', path: 'labels-test-group') - - @template_label = labels.create!(title: 'template', template: true) - @project_label = labels.create!(title: 'project label', project_id: project.id, type: 'ProjectLabel') - @group_label = labels.create!(title: 'group_label', group_id: group.id, type: 'GroupLabel') - @broken_label_1 = labels.create!(title: 'broken 1', project_id: project.id) - @broken_label_2 = labels.create!(title: 'broken 2', project_id: project.id) - end - - describe '#up' do - it 'fix labels with type missing' do - migration.up - - # Labels that requires type change - expect(@broken_label_1.reload.type).to eq('ProjectLabel') - expect(@broken_label_2.reload.type).to eq('ProjectLabel') - # Labels out of scope - expect(@template_label.reload.type).to be_nil - expect(@project_label.reload.type).to eq('ProjectLabel') - expect(@group_label.reload.type).to eq('GroupLabel') - end - end -end diff --git a/spec/migrations/fix_pool_repository_source_project_id_spec.rb b/spec/migrations/fix_pool_repository_source_project_id_spec.rb deleted file mode 100644 index 2ee4c458c3c..00000000000 --- a/spec/migrations/fix_pool_repository_source_project_id_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe FixPoolRepositorySourceProjectId do - let(:projects) { table(:projects) } - let(:pool_repositories) { table(:pool_repositories) } - let(:shards) { table(:shards) } - - it 'fills in source_project_ids' do - shard = shards.create!(name: 'default') - - # gitaly is a project with a pool repository that has a source_project_id - gitaly = projects.create!(name: 'gitaly', path: 'gitlab-org/gitaly', namespace_id: 1) - pool_repository = pool_repositories.create!(shard_id: shard.id, source_project_id: gitaly.id) - gitaly.update_column(:pool_repository_id, pool_repository.id) - - # gitlab is a project with a pool repository that's missing a source_project_id - pool_repository_without_source_project = pool_repositories.create!(shard_id: shard.id, source_project_id: nil) - gitlab = projects.create!(name: 'gitlab', path: 'gitlab-org/gitlab-ce', namespace_id: 1, pool_repository_id: pool_repository_without_source_project.id) - projects.create!(name: 'gitlab-fork-1', path: 'my-org-1/gitlab-ce', namespace_id: 1, pool_repository_id: pool_repository_without_source_project.id) - - migrate! - - expect(pool_repositories.find(pool_repository_without_source_project.id).source_project_id).to eq(gitlab.id) - expect(pool_repositories.find(pool_repository.id).source_project_id).to eq(gitaly.id) - end -end diff --git a/spec/migrations/fix_wrong_pages_access_level_spec.rb b/spec/migrations/fix_wrong_pages_access_level_spec.rb deleted file mode 100644 index 00a620b4426..00000000000 --- a/spec/migrations/fix_wrong_pages_access_level_spec.rb +++ /dev/null @@ -1,99 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe FixWrongPagesAccessLevel, :sidekiq_might_not_need_inline, schema: 20190628185004 do - using RSpec::Parameterized::TableSyntax - - let(:migration_class) { described_class::MIGRATION } - let(:migration_name) { migration_class.to_s.demodulize } - - project_class = ::Gitlab::BackgroundMigration::FixPagesAccessLevel::Project - feature_class = ::Gitlab::BackgroundMigration::FixPagesAccessLevel::ProjectFeature - - let(:namespaces_table) { table(:namespaces) } - let(:projects_table) { table(:projects) } - let(:features_table) { table(:project_features) } - - let(:subgroup) do - root_group = namespaces_table.create!(path: "group", name: "group") - namespaces_table.create!(path: "subgroup", name: "group", parent_id: root_group.id) - end - - def create_project_feature(path, project_visibility, pages_access_level) - project = projects_table.create!(path: path, visibility_level: project_visibility, - namespace_id: subgroup.id) - features_table.create!(project_id: project.id, pages_access_level: pages_access_level) - end - - it 'correctly schedules background migrations' do - Sidekiq::Testing.fake! do - freeze_time do - first_id = create_project_feature("project1", project_class::PRIVATE, feature_class::PRIVATE).id - last_id = create_project_feature("project2", project_class::PRIVATE, feature_class::PUBLIC).id - - migrate! - - expect(migration_name).to be_scheduled_delayed_migration(2.minutes, first_id, last_id) - expect(BackgroundMigrationWorker.jobs.size).to eq(1) - end - end - end - - def expect_migration - expect do - perform_enqueued_jobs do - migrate! - end - end - end - - where(:project_visibility, :pages_access_level, :access_control_is_enabled, - :pages_deployed, :resulting_pages_access_level) do - # update settings for public projects regardless of access_control being enabled - project_class::PUBLIC | feature_class::PUBLIC | true | true | feature_class::ENABLED - project_class::PUBLIC | feature_class::PUBLIC | false | true | feature_class::ENABLED - # don't update public level for private and internal projects - project_class::PRIVATE | feature_class::PUBLIC | true | true | feature_class::PUBLIC - project_class::INTERNAL | feature_class::PUBLIC | true | true | feature_class::PUBLIC - - # if access control is disabled but pages are deployed we make them public - project_class::INTERNAL | feature_class::ENABLED | false | true | feature_class::PUBLIC - # don't change anything if one of the conditions is not satisfied - project_class::INTERNAL | feature_class::ENABLED | true | true | feature_class::ENABLED - project_class::INTERNAL | feature_class::ENABLED | true | false | feature_class::ENABLED - - # private projects - # if access control is enabled update pages_access_level to private regardless of deployment - project_class::PRIVATE | feature_class::ENABLED | true | true | feature_class::PRIVATE - project_class::PRIVATE | feature_class::ENABLED | true | false | feature_class::PRIVATE - # if access control is disabled and pages are deployed update pages_access_level to public - project_class::PRIVATE | feature_class::ENABLED | false | true | feature_class::PUBLIC - # if access control is disabled but pages aren't deployed update pages_access_level to private - project_class::PRIVATE | feature_class::ENABLED | false | false | feature_class::PRIVATE - end - - with_them do - let!(:project_feature) do - create_project_feature("projectpath", project_visibility, pages_access_level) - end - - before do - tested_path = File.join(Settings.pages.path, "group/subgroup/projectpath", "public") - allow(Dir).to receive(:exist?).with(tested_path).and_return(pages_deployed) - - stub_pages_setting(access_control: access_control_is_enabled) - end - - it "sets proper pages_access_level" do - expect(project_feature.reload.pages_access_level).to eq(pages_access_level) - - perform_enqueued_jobs do - migrate! - end - - expect(project_feature.reload.pages_access_level).to eq(resulting_pages_access_level) - end - end -end diff --git a/spec/migrations/generate_lets_encrypt_private_key_spec.rb b/spec/migrations/generate_lets_encrypt_private_key_spec.rb deleted file mode 100644 index 8525a7bbd1c..00000000000 --- a/spec/migrations/generate_lets_encrypt_private_key_spec.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe GenerateLetsEncryptPrivateKey do - describe '#up' do - it 'does not fail' do - expect do - described_class.new.up - end.not_to raise_error - end - end -end diff --git a/spec/migrations/insert_project_hooks_plan_limits_spec.rb b/spec/migrations/insert_project_hooks_plan_limits_spec.rb deleted file mode 100644 index 365dd679d76..00000000000 --- a/spec/migrations/insert_project_hooks_plan_limits_spec.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe InsertProjectHooksPlanLimits do - let(:migration) { described_class.new } - let(:plans) { table(:plans) } - let(:plan_limits) { table(:plan_limits) } - - before do - plans.create!(id: 34, name: 'free') - plans.create!(id: 2, name: 'bronze') - plans.create!(id: 3, name: 'silver') - plans.create!(id: 4, name: 'gold') - plan_limits.create!(plan_id: 34, ci_active_jobs: 5) - end - - context 'when on Gitlab.com' do - before do - expect(Gitlab).to receive(:com?).at_most(:twice).and_return(true) - end - - describe '#up' do - it 'updates the project_hooks plan limits' do - migration.up - - expect(plan_limits.pluck(:plan_id, :project_hooks, :ci_active_jobs)) - .to match_array([[34, 10, 5], [2, 20, 0], [3, 30, 0], [4, 100, 0]]) - end - end - - describe '#down' do - it 'updates the project_hooks plan limits to 0' do - migration.up - migration.down - - expect(plan_limits.pluck(:plan_id, :project_hooks, :ci_active_jobs)) - .to match_array([[34, 0, 5], [2, 0, 0], [3, 0, 0], [4, 0, 0]]) - end - end - end - - context 'when on self-hosted' do - before do - expect(Gitlab).to receive(:com?).and_return(false) - end - - describe '#up' do - it 'does not update the plan limits' do - migration.up - - expect(plan_limits.pluck(:plan_id, :project_hooks, :ci_active_jobs)) - .to match_array([[34, 0, 5]]) - end - end - - describe '#down' do - it 'does not update the plan limits' do - migration.down - - expect(plan_limits.pluck(:plan_id, :project_hooks, :ci_active_jobs)) - .to match_array([[34, 0, 5]]) - end - end - end -end diff --git a/spec/migrations/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb b/spec/migrations/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb deleted file mode 100644 index a836fb4bfb9..00000000000 --- a/spec/migrations/migrate_auto_dev_ops_domain_to_cluster_domain_spec.rb +++ /dev/null @@ -1,114 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe MigrateAutoDevOpsDomainToClusterDomain do - include MigrationHelpers::ClusterHelpers - - let(:migration) { described_class.new } - let(:project_auto_devops_table) { table(:project_auto_devops) } - let(:clusters_table) { table(:clusters) } - let(:cluster_projects_table) { table(:cluster_projects) } - - # Following lets are needed by MigrationHelpers::ClusterHelpers - let(:cluster_kubernetes_namespaces_table) { table(:clusters_kubernetes_namespaces) } - let(:projects_table) { table(:projects) } - let(:namespaces_table) { table(:namespaces) } - let(:provider_gcp_table) { table(:cluster_providers_gcp) } - let(:platform_kubernetes_table) { table(:cluster_platforms_kubernetes) } - - before do - setup_cluster_projects_with_domain(quantity: 20, domain: domain) - end - - context 'with ProjectAutoDevOps with no domain' do - let(:domain) { nil } - - it 'does not update cluster project' do - migrate! - - expect(clusters_without_domain.count).to eq(clusters_table.count) - end - end - - context 'with ProjectAutoDevOps with domain' do - let(:domain) { 'example-domain.com' } - - it 'updates all cluster projects' do - migrate! - - expect(clusters_with_domain.count).to eq(clusters_table.count) - end - end - - context 'when only some ProjectAutoDevOps have domain set' do - let(:domain) { 'example-domain.com' } - - before do - setup_cluster_projects_with_domain(quantity: 25, domain: nil) - end - - it 'only updates specific cluster projects' do - migrate! - - expect(clusters_with_domain.count).to eq(20) - - project_auto_devops_with_domain.each do |project_auto_devops| - cluster_project = find_cluster_project(project_auto_devops.project_id) - cluster = find_cluster(cluster_project.cluster_id) - - expect(cluster.domain).to be_present - end - - expect(clusters_without_domain.count).to eq(25) - - project_auto_devops_without_domain.each do |project_auto_devops| - cluster_project = find_cluster_project(project_auto_devops.project_id) - cluster = find_cluster(cluster_project.cluster_id) - - expect(cluster.domain).not_to be_present - end - end - end - - def setup_cluster_projects_with_domain(quantity:, domain:) - create_cluster_project_list(quantity) - - cluster_projects = cluster_projects_table.last(quantity) - - cluster_projects.each do |cluster_project| - specific_domain = "#{cluster_project.id}-#{domain}" if domain - - project_auto_devops_table.create!( - project_id: cluster_project.project_id, - enabled: true, - domain: specific_domain - ) - end - end - - def find_cluster_project(project_id) - cluster_projects_table.find_by(project_id: project_id) - end - - def find_cluster(cluster_id) - clusters_table.find_by(id: cluster_id) - end - - def project_auto_devops_with_domain - project_auto_devops_table.where.not("domain IS NULL OR domain = ''") - end - - def project_auto_devops_without_domain - project_auto_devops_table.where("domain IS NULL OR domain = ''") - end - - def clusters_with_domain - clusters_table.where.not("domain IS NULL OR domain = ''") - end - - def clusters_without_domain - clusters_table.where("domain IS NULL OR domain = ''") - end -end diff --git a/spec/migrations/migrate_code_owner_approval_status_to_protected_branches_in_batches_spec.rb b/spec/migrations/migrate_code_owner_approval_status_to_protected_branches_in_batches_spec.rb deleted file mode 100644 index 121ff3d6622..00000000000 --- a/spec/migrations/migrate_code_owner_approval_status_to_protected_branches_in_batches_spec.rb +++ /dev/null @@ -1,63 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe MigrateCodeOwnerApprovalStatusToProtectedBranchesInBatches do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:protected_branches) { table(:protected_branches) } - - let(:namespace) do - namespaces.create!( - path: 'gitlab-instance-administrators', - name: 'GitLab Instance Administrators' - ) - end - - let(:project) do - projects.create!( - namespace_id: namespace.id, - name: 'GitLab Instance Administration' - ) - end - - let!(:protected_branch_1) do - protected_branches.create!( - name: "branch name", - project_id: project.id - ) - end - - describe '#up' do - context "when there's no projects needing approval" do - it "doesn't change any protected branch records" do - expect { migrate! } - .not_to change { ProtectedBranch.where(code_owner_approval_required: true).count } - end - end - - context "when there's a project needing approval" do - let!(:project_needing_approval) do - projects.create!( - namespace_id: namespace.id, - name: 'GitLab Instance Administration', - merge_requests_require_code_owner_approval: true - ) - end - - let!(:protected_branch_2) do - protected_branches.create!( - name: "branch name", - project_id: project_needing_approval.id - ) - end - - it "changes N protected branch records" do - expect { migrate! } - .to change { ProtectedBranch.where(code_owner_approval_required: true).count } - .by(1) - end - end - end -end diff --git a/spec/migrations/migrate_discussion_id_on_promoted_epics_spec.rb b/spec/migrations/migrate_discussion_id_on_promoted_epics_spec.rb deleted file mode 100644 index e42baab9927..00000000000 --- a/spec/migrations/migrate_discussion_id_on_promoted_epics_spec.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe MigrateDiscussionIdOnPromotedEpics do - let(:migration_class) { described_class::MIGRATION } - let(:migration_name) { migration_class.to_s.demodulize } - - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:users) { table(:users) } - let(:issues) { table(:issues) } - let(:epics) { table(:epics) } - let(:notes) { table(:notes) } - let(:system_note_metadata) { table(:system_note_metadata) } - - let(:user) { users.create!(email: 'test@example.com', projects_limit: 100, username: 'test') } - let(:namespace) { namespaces.create!(name: 'gitlab', path: 'gitlab-org') } - - def create_promotion_note(model, id) - note = create_note(model, id, { system: true, - note: 'promoted from issue XXX' }) - system_note_metadata.create!(note_id: note.id, action: 'moved') - end - - def create_epic - epics.create!(author_id: user.id, iid: epics.maximum(:iid).to_i + 1, - group_id: namespace.id, - title: 'Epic with discussion', - title_html: 'Epic with discussion') - end - - def create_note(model, id, extra_params = {}) - params = { - note: 'note', - noteable_id: model.id, - noteable_type: model.class.name, - discussion_id: id - }.merge(extra_params) - - notes.create!(params) - end - - context 'with promoted epic' do - let(:epic1) { create_epic } - let!(:note1) { create_promotion_note(epic1, 'id1') } - - it 'correctly schedules background migrations in batches' do - create_note(epic1, 'id2') - create_note(epic1, 'id3') - - stub_const("#{described_class.name}::BATCH_SIZE", 2) - - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - expect(migration_name).to be_scheduled_delayed_migration(2.minutes, %w(id1 id2)) - expect(migration_name).to be_scheduled_delayed_migration(4.minutes, %w(id3)) - expect(BackgroundMigrationWorker.jobs.size).to eq(2) - end - end - end - - it 'schedules only promoted epics' do - issue = issues.create!(description: 'first', state: 'opened') - create_promotion_note(issue, 'id2') - create_note(create_epic, 'id3') - - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - expect(migration_name).to be_scheduled_delayed_migration(2.minutes, %w(id1)) - expect(BackgroundMigrationWorker.jobs.size).to eq(1) - end - end - end - end -end diff --git a/spec/migrations/migrate_k8s_service_integration_spec.rb b/spec/migrations/migrate_k8s_service_integration_spec.rb deleted file mode 100644 index ba6071b72e4..00000000000 --- a/spec/migrations/migrate_k8s_service_integration_spec.rb +++ /dev/null @@ -1,162 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe MigrateK8sServiceIntegration do - context 'template service' do - context 'with namespace' do - let!(:service) do - MigrateK8sServiceIntegration::Service.create!( - active: true, - template: true, - category: 'deployment', - type: 'KubernetesService', - properties: "{\"namespace\":\"prod\",\"api_url\":\"https://sample.kubernetes.com\",\"ca_pem\":\"ca_pem-sample\",\"token\":\"token-sample\"}" - ) - end - - let(:cluster) { MigrateK8sServiceIntegration::Cluster.instance_type.last! } - let(:platform) { cluster.platform_kubernetes } - - it 'migrates the KubernetesService template to Platform::Kubernetes' do - expect { migrate! }.to change { MigrateK8sServiceIntegration::Cluster.count }.by(1) - - expect(cluster).to be_enabled - expect(cluster).to be_user - expect(cluster).not_to be_managed - expect(cluster.environment_scope).to eq('*') - expect(platform.api_url).to eq('https://sample.kubernetes.com') - expect(platform.ca_cert).to eq('ca_pem-sample') - expect(platform.namespace).to eq('prod') - expect(platform.token).to eq('token-sample') - end - end - - context 'without namespace' do - let!(:service) do - MigrateK8sServiceIntegration::Service.create!( - active: true, - template: true, - category: 'deployment', - type: 'KubernetesService', - properties: "{\"namespace\":\"\",\"api_url\":\"https://sample.kubernetes.com\",\"ca_pem\":\"ca_pem-sample\",\"token\":\"token-sample\"}" - ) - end - - let(:cluster) { MigrateK8sServiceIntegration::Cluster.instance_type.last! } - let(:platform) { cluster.platform_kubernetes } - - it 'migrates the KubernetesService template to Platform::Kubernetes' do - expect { migrate! }.to change { MigrateK8sServiceIntegration::Cluster.count }.by(1) - - expect(cluster).to be_enabled - expect(cluster).to be_user - expect(cluster).not_to be_managed - expect(cluster.environment_scope).to eq('*') - expect(platform.api_url).to eq('https://sample.kubernetes.com') - expect(platform.ca_cert).to eq('ca_pem-sample') - expect(platform.namespace).to be_nil - expect(platform.token).to eq('token-sample') - end - end - - context 'with nullified parameters' do - let!(:service) do - MigrateK8sServiceIntegration::Service.create!( - active: true, - template: true, - category: 'deployment', - type: 'KubernetesService', - properties: "{}" - ) - end - - it 'does not migrate the KubernetesService' do - expect { migrate! }.not_to change { MigrateK8sServiceIntegration::Cluster.count } - end - end - - context 'when disabled' do - let!(:service) do - MigrateK8sServiceIntegration::Service.create!( - active: false, - template: true, - category: 'deployment', - type: 'KubernetesService', - properties: "{\"namespace\":\"prod\",\"api_url\":\"https://sample.kubernetes.com\",\"ca_pem\":\"ca_pem-sample\",\"token\":\"token-sample\"}" - ) - end - - let(:cluster) { MigrateK8sServiceIntegration::Cluster.instance_type.last! } - let(:platform) { cluster.platform_kubernetes } - - it 'migrates the KubernetesService template to Platform::Kubernetes' do - expect { migrate! }.to change { MigrateK8sServiceIntegration::Cluster.count }.by(1) - - expect(cluster).not_to be_enabled - expect(cluster).to be_user - expect(cluster).not_to be_managed - expect(cluster.environment_scope).to eq('*') - expect(platform.api_url).to eq('https://sample.kubernetes.com') - expect(platform.ca_cert).to eq('ca_pem-sample') - expect(platform.namespace).to eq('prod') - expect(platform.token).to eq('token-sample') - end - end - - context 'when an instance cluster already exists' do - let!(:service) do - MigrateK8sServiceIntegration::Service.create!( - active: true, - template: true, - category: 'deployment', - type: 'KubernetesService', - properties: "{\"namespace\":\"prod\",\"api_url\":\"https://sample.kubernetes.com\",\"ca_pem\":\"ca_pem-sample\",\"token\":\"token-sample\"}" - ) - end - - let!(:existing_cluster) do - MigrateK8sServiceIntegration::Cluster.create!( - name: 'test-cluster', - cluster_type: :instance_type, - managed: true, - provider_type: :user, - platform_type: :kubernetes - ) - end - - let(:new_cluster) { MigrateK8sServiceIntegration::Cluster.instance_type.last! } - let(:platform) { new_cluster.platform_kubernetes } - - it 'migrates the KubernetesService template to disabled Platform::Kubernetes' do - expect { migrate! }.to change { MigrateK8sServiceIntegration::Cluster.count }.by(1) - - expect(new_cluster).not_to be_enabled - expect(new_cluster).to be_user - expect(new_cluster).not_to be_managed - expect(new_cluster.environment_scope).to eq('*') - expect(platform.api_url).to eq('https://sample.kubernetes.com') - expect(platform.ca_cert).to eq('ca_pem-sample') - expect(platform.namespace).to eq('prod') - expect(platform.token).to eq('token-sample') - end - end - end - - context 'non-template service' do - let!(:service) do - MigrateK8sServiceIntegration::Service.create!( - active: true, - template: false, - category: 'deployment', - type: 'KubernetesService', - properties: "{\"namespace\":\"prod\",\"api_url\":\"https://sample.kubernetes.com\",\"ca_pem\":\"ca_pem-sample\",\"token\":\"token-sample\"}" - ) - end - - it 'does not migrate the KubernetesService' do - expect { migrate! }.not_to change { MigrateK8sServiceIntegration::Cluster.count } - end - end -end diff --git a/spec/migrations/migrate_legacy_managed_clusters_to_unmanaged_spec.rb b/spec/migrations/migrate_legacy_managed_clusters_to_unmanaged_spec.rb deleted file mode 100644 index 3d8685c7619..00000000000 --- a/spec/migrations/migrate_legacy_managed_clusters_to_unmanaged_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe MigrateLegacyManagedClustersToUnmanaged do - let(:cluster_type) { 'project_type' } - let(:created_at) { 1.hour.ago } - - let!(:cluster) do - table(:clusters).create!( - name: 'cluster', - cluster_type: described_class::Cluster.cluster_types[cluster_type], - managed: true, - created_at: created_at - ) - end - - it 'marks the cluster as unmanaged' do - migrate! - expect(cluster.reload).not_to be_managed - end - - context 'cluster is not project type' do - let(:cluster_type) { 'group_type' } - - it 'does not update the cluster' do - migrate! - expect(cluster.reload).to be_managed - end - end - - context 'cluster has a kubernetes namespace associated' do - before do - table(:clusters_kubernetes_namespaces).create!( - cluster_id: cluster.id, - namespace: 'namespace' - ) - end - - it 'does not update the cluster' do - migrate! - expect(cluster.reload).to be_managed - end - end - - context 'cluster was recently created' do - let(:created_at) { 2.minutes.ago } - - it 'does not update the cluster' do - migrate! - expect(cluster.reload).to be_managed - end - end -end diff --git a/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb b/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb deleted file mode 100644 index b753b84ae55..00000000000 --- a/spec/migrations/migrate_managed_clusters_with_no_token_to_unmanaged_spec.rb +++ /dev/null @@ -1,59 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe MigrateManagedClustersWithNoTokenToUnmanaged do - let(:cluster_type) { 'project_type' } - let(:created_at) { Date.new(2018, 11, 1).midnight } - - let!(:cluster) do - table(:clusters).create!( - name: 'cluster', - cluster_type: described_class::Cluster.cluster_types[cluster_type], - managed: true, - created_at: created_at - ) - end - - let!(:kubernetes_namespace) do - table(:clusters_kubernetes_namespaces).create!( - cluster_id: cluster.id, - namespace: 'namespace' - ) - end - - it 'marks the cluster as unmanaged' do - migrate! - expect(cluster.reload).not_to be_managed - end - - context 'cluster is not project type' do - let(:cluster_type) { 'group_type' } - - it 'does not update the cluster' do - migrate! - expect(cluster.reload).to be_managed - end - end - - context 'kubernetes namespace has a service account token' do - before do - kubernetes_namespace.update!(encrypted_service_account_token: "TOKEN") - end - - it 'does not update the cluster' do - migrate! - expect(cluster.reload).to be_managed - end - end - - context 'cluster was created after the cutoff' do - let(:created_at) { Date.new(2019, 1, 1).midnight } - - it 'does not update the cluster' do - migrate! - expect(cluster.reload).to be_managed - end - end -end diff --git a/spec/migrations/migrate_ops_feature_flags_scopes_target_user_ids_spec.rb b/spec/migrations/migrate_ops_feature_flags_scopes_target_user_ids_spec.rb deleted file mode 100644 index 5caf03992dd..00000000000 --- a/spec/migrations/migrate_ops_feature_flags_scopes_target_user_ids_spec.rb +++ /dev/null @@ -1,135 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe MigrateOpsFeatureFlagsScopesTargetUserIds do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:flags) { table(:operations_feature_flags) } - let(:scopes) { table(:operations_feature_flag_scopes) } - - def setup - namespace = namespaces.create!(name: 'foo', path: 'foo') - project = projects.create!(namespace_id: namespace.id) - flags.create!(project_id: project.id, active: true, name: 'test_flag') - end - - it 'migrates successfully when there are no scopes in the database' do - setup - - disable_migrations_output { migrate! } - - expect(scopes.count).to eq(0) - end - - it 'migrates a disabled scope with gradualRolloutUserId and userWithId strategies' do - flag = setup - scope = scopes.create!(feature_flag_id: flag.id, active: false, strategies: [ - { name: 'gradualRolloutUserId', parameters: { groupId: 'default', percentage: '50' } }, - { name: 'userWithId', parameters: { userIds: '5' } } - ]) - - disable_migrations_output { migrate! } - - scope.reload - expect(scope.active).to eq(true) - expect(scope.strategies).to eq([{ 'name' => 'userWithId', 'parameters' => { 'userIds' => '5' } }]) - end - - it 'migrates a disabled scope with default and userWithId strategies' do - flag = setup - scope = scopes.create!(feature_flag_id: flag.id, active: false, strategies: [ - { name: 'default', parameters: {} }, - { name: 'userWithId', parameters: { userIds: 'amy@gmail.com,karen@gmail.com' } } - ]) - - disable_migrations_output { migrate! } - - scope.reload - expect(scope.active).to eq(true) - expect(scope.strategies).to eq([{ 'name' => 'userWithId', 'parameters' => { 'userIds' => 'amy@gmail.com,karen@gmail.com' } }]) - end - - it 'migrates an enabled scope with default and userWithId strategies' do - flag = setup - scope = scopes.create!(feature_flag_id: flag.id, active: true, strategies: [ - { name: 'default', parameters: {} }, - { name: 'userWithId', parameters: { userIds: 'tim' } } - ]) - - disable_migrations_output { migrate! } - - scope.reload - expect(scope.active).to eq(true) - expect(scope.strategies).to eq([{ 'name' => 'default', 'parameters' => {} }]) - end - - it 'does not alter an enabled scope with gradualRolloutUserId and userWithId strategies' do - flag = setup - scope = scopes.create!(feature_flag_id: flag.id, active: true, strategies: [ - { name: 'gradualRolloutUserId', parameters: { groupId: 'default', percentage: '50' } }, - { name: 'userWithId', parameters: { userIds: '5' } } - ]) - - disable_migrations_output { migrate! } - - scope.reload - expect(scope.active).to eq(true) - expect(scope.strategies).to eq([ - { 'name' => 'gradualRolloutUserId', 'parameters' => { 'groupId' => 'default', 'percentage' => '50' } }, - { 'name' => 'userWithId', 'parameters' => { 'userIds' => '5' } } - ]) - end - - it 'does not alter a disabled scope without a userWithId strategy' do - flag = setup - scope = scopes.create!(feature_flag_id: flag.id, active: false, strategies: [ - { name: 'gradualRolloutUserId', parameters: { percentage: '60' } } - ]) - - disable_migrations_output { migrate! } - - scope.reload - expect(scope.active).to eq(false) - expect(scope.strategies).to eq([ - { 'name' => 'gradualRolloutUserId', 'parameters' => { 'percentage' => '60' } } - ]) - end - - it 'does not alter an enabled scope without a userWithId strategy' do - flag = setup - scope = scopes.create!(feature_flag_id: flag.id, active: true, strategies: [ - { name: 'default', parameters: {} } - ]) - - disable_migrations_output { migrate! } - - scope.reload - expect(scope.active).to eq(true) - expect(scope.strategies).to eq([ - { 'name' => 'default', 'parameters' => {} } - ]) - end - - it 'migrates multiple scopes' do - flag = setup - scope_a = scopes.create!(feature_flag_id: flag.id, active: false, strategies: [ - { name: 'gradualRolloutUserId', parameters: { groupId: 'default', percentage: '50' } }, - { name: 'userWithId', parameters: { userIds: '5,6,7' } } - ]) - scope_b = scopes.create!(feature_flag_id: flag.id, active: false, environment_scope: 'production', strategies: [ - { name: 'default', parameters: {} }, - { name: 'userWithId', parameters: { userIds: 'lisa,carol' } } - ]) - - disable_migrations_output { migrate! } - - scope_a.reload - scope_b.reload - expect(scope_a.active).to eq(true) - expect(scope_a.strategies).to eq([{ 'name' => 'userWithId', 'parameters' => { 'userIds' => '5,6,7' } }]) - expect(scope_b.active).to eq(true) - expect(scope_b.strategies).to eq([{ 'name' => 'userWithId', 'parameters' => { 'userIds' => 'lisa,carol' } }]) - end -end diff --git a/spec/migrations/migrate_storage_migrator_sidekiq_queue_spec.rb b/spec/migrations/migrate_storage_migrator_sidekiq_queue_spec.rb deleted file mode 100644 index 4db819f2fa1..00000000000 --- a/spec/migrations/migrate_storage_migrator_sidekiq_queue_spec.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe MigrateStorageMigratorSidekiqQueue, :redis do - include Gitlab::Database::MigrationHelpers - include StubWorker - - context 'when there are jobs in the queues' do - it 'correctly migrates queue when migrating up' do - Sidekiq::Testing.disable! do - stub_worker(queue: :storage_migrator).perform_async(1, 5) - - described_class.new.up - - expect(sidekiq_queue_length('storage_migrator')).to eq 0 - expect(sidekiq_queue_length('hashed_storage:hashed_storage_migrator')).to eq 1 - end - end - - it 'correctly migrates queue when migrating down' do - Sidekiq::Testing.disable! do - stub_worker(queue: :'hashed_storage:hashed_storage_migrator').perform_async(1, 5) - - described_class.new.down - - expect(sidekiq_queue_length('storage_migrator')).to eq 1 - expect(sidekiq_queue_length('hashed_storage:hashed_storage_migrator')).to eq 0 - end - end - end - - context 'when there are no jobs in the queues' do - it 'does not raise error when migrating up' do - expect { described_class.new.up }.not_to raise_error - end - - it 'does not raise error when migrating down' do - expect { described_class.new.down }.not_to raise_error - end - end -end diff --git a/spec/migrations/move_limits_from_plans_spec.rb b/spec/migrations/move_limits_from_plans_spec.rb deleted file mode 100644 index 92ac804733f..00000000000 --- a/spec/migrations/move_limits_from_plans_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe MoveLimitsFromPlans do - let(:plans) { table(:plans) } - let(:plan_limits) { table(:plan_limits) } - - let!(:gold_plan) { plans.create!(name: 'gold', title: 'Gold', active_pipelines_limit: 20, pipeline_size_limit: 21, active_jobs_limit: 22) } - let!(:silver_plan) { plans.create!(name: 'silver', title: 'Silver', active_pipelines_limit: 30, pipeline_size_limit: 31, active_jobs_limit: 32) } - let!(:bronze_plan) { plans.create!(name: 'bronze', title: 'Bronze', active_pipelines_limit: 40, pipeline_size_limit: 41, active_jobs_limit: 42) } - let!(:free_plan) { plans.create!(name: 'free', title: 'Free', active_pipelines_limit: 50, pipeline_size_limit: 51, active_jobs_limit: 52) } - let!(:other_plan) { plans.create!(name: 'other', title: 'Other', active_pipelines_limit: nil, pipeline_size_limit: nil, active_jobs_limit: 0) } - - describe 'migrate' do - it 'populates plan_limits from all the records in plans' do - expect { migrate! }.to change { plan_limits.count }.by 5 - end - - it 'copies plan limits and plan.id into to plan_limits table' do - migrate! - - new_data = plan_limits.pluck(:plan_id, :ci_active_pipelines, :ci_pipeline_size, :ci_active_jobs) - expected_data = [ - [gold_plan.id, 20, 21, 22], - [silver_plan.id, 30, 31, 32], - [bronze_plan.id, 40, 41, 42], - [free_plan.id, 50, 51, 52], - [other_plan.id, 0, 0, 0] - ] - expect(new_data).to contain_exactly(*expected_data) - end - end -end diff --git a/spec/migrations/nullify_users_role_spec.rb b/spec/migrations/nullify_users_role_spec.rb deleted file mode 100644 index 11056d9cf0c..00000000000 --- a/spec/migrations/nullify_users_role_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe NullifyUsersRole do - let(:users) { table(:users) } - - before do - allow(Gitlab).to receive(:com?).and_return(true) - - users.create!(role: 0, updated_at: '2019-11-04 12:08:00', projects_limit: 0, email: '1') - users.create!(role: 1, updated_at: '2019-11-04 12:08:00', projects_limit: 0, email: '2') - users.create!(role: 0, updated_at: '2019-11-06 12:08:00', projects_limit: 0, email: '3') - - migrate! - end - - it 'nullifies the role of the user with updated_at < 2019-11-05 12:08:00 and a role of 0' do - expect(users.where(role: nil).count).to eq(1) - expect(users.find_by(role: nil).email).to eq('1') - end - - it 'leaves the user with role of 1' do - expect(users.where(role: 1).count).to eq(1) - expect(users.find_by(role: 1).email).to eq('2') - end - - it 'leaves the user with updated_at > 2019-11-05 12:08:00' do - expect(users.where(role: 0).count).to eq(1) - expect(users.find_by(role: 0).email).to eq('3') - end -end diff --git a/spec/migrations/populate_project_statistics_packages_size_spec.rb b/spec/migrations/populate_project_statistics_packages_size_spec.rb deleted file mode 100644 index af9237f4bd6..00000000000 --- a/spec/migrations/populate_project_statistics_packages_size_spec.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe PopulateProjectStatisticsPackagesSize do - let(:project_statistics) { table(:project_statistics) } - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:packages) { table(:packages_packages) } - let(:package_files) { table(:packages_package_files) } - - let(:file_size) { 1.kilobyte } - let(:repo_size) { 2.megabytes } - let(:lfs_size) { 3.gigabytes } - let(:artifacts_size) { 4.terabytes } - let(:storage_size) { repo_size + lfs_size + artifacts_size } - - let(:namespace) { namespaces.create!(name: 'foo', path: 'foo') } - let(:package) { packages.create!(project_id: project.id, name: 'a package', package_type: 1) } - let(:project) { projects.create!(namespace_id: namespace.id) } - - let!(:statistics) { project_statistics.create!(project_id: project.id, namespace_id: namespace.id, storage_size: storage_size, repository_size: repo_size, lfs_objects_size: lfs_size, build_artifacts_size: artifacts_size) } - let!(:package_file) { package_files.create!(package_id: package.id, file: 'a file.txt', file_name: 'a file.txt', size: file_size)} - - it 'backfills ProjectStatistics packages_size' do - expect { migrate! } - .to change { statistics.reload.packages_size } - .from(nil).to(file_size) - end - - it 'updates ProjectStatistics storage_size' do - expect { migrate! } - .to change { statistics.reload.storage_size } - .by(file_size) - end -end diff --git a/spec/migrations/populate_rule_type_on_approval_merge_request_rules_spec.rb b/spec/migrations/populate_rule_type_on_approval_merge_request_rules_spec.rb deleted file mode 100644 index 7dc3f5a1004..00000000000 --- a/spec/migrations/populate_rule_type_on_approval_merge_request_rules_spec.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe PopulateRuleTypeOnApprovalMergeRequestRules do - let(:migration) { described_class.new } - - describe '#up' do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:merge_requests) { table(:merge_requests) } - let(:approval_rules) { table(:approval_merge_request_rules) } - - # We use integers here since at the time of writing CE does not yet have the - # appropriate models and enum definitions. - let(:regular_rule_type) { 1 } - let(:code_owner_rule_type) { 2 } - - before do - namespaces.create!(id: 11, name: 'gitlab', path: 'gitlab') - projects.create!(id: 101, namespace_id: 11, name: 'gitlab', path: 'gitlab') - merge_requests.create!(id: 1, target_project_id: 101, source_project_id: 101, target_branch: 'feature', source_branch: 'master') - - approval_rules.create!(id: 1, merge_request_id: 1, name: "Default", code_owner: false, rule_type: regular_rule_type) - approval_rules.create!(id: 2, merge_request_id: 1, name: "Code Owners", code_owner: true, rule_type: regular_rule_type) - end - - it 'backfills ApprovalMergeRequestRules code_owner rule_type' do - expect(approval_rules.where(rule_type: regular_rule_type).pluck(:id)).to contain_exactly(1, 2) - expect(approval_rules.where(rule_type: code_owner_rule_type).pluck(:id)).to be_empty - - migrate! - - expect(approval_rules.where(rule_type: regular_rule_type).pluck(:id)).to contain_exactly(1) - expect(approval_rules.where(rule_type: code_owner_rule_type).pluck(:id)).to contain_exactly(2) - end - end -end diff --git a/spec/migrations/remove_empty_github_service_templates_spec.rb b/spec/migrations/remove_empty_github_service_templates_spec.rb deleted file mode 100644 index ad84187c298..00000000000 --- a/spec/migrations/remove_empty_github_service_templates_spec.rb +++ /dev/null @@ -1,55 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe RemoveEmptyGithubServiceTemplates do - subject(:migration) { described_class.new } - - let(:services) do - table(:services).tap do |klass| - klass.class_eval do - serialize :properties, JSON - end - end - end - - before do - services.delete_all - - create_service(properties: nil) - create_service(properties: {}) - create_service(properties: { some: :value }) - create_service(properties: {}, template: false) - create_service(properties: {}, type: 'SomeType') - end - - def all_service_properties - services.where(template: true, type: 'GithubService').pluck(:properties) - end - - it 'correctly migrates up and down service templates' do - reversible_migration do |migration| - migration.before -> do - expect(services.count).to eq(5) - - expect(all_service_properties) - .to match(a_collection_containing_exactly(nil, {}, { 'some' => 'value' })) - end - - migration.after -> do - expect(services.count).to eq(4) - - expect(all_service_properties) - .to match(a_collection_containing_exactly(nil, { 'some' => 'value' })) - end - end - end - - def create_service(params) - data = { template: true, type: 'GithubService' } - data.merge!(params) - - services.create!(data) - end -end diff --git a/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb b/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb deleted file mode 100644 index 45bd5073d55..00000000000 --- a/spec/migrations/schedule_fill_valid_time_for_pages_domain_certificates_spec.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe ScheduleFillValidTimeForPagesDomainCertificates do - let(:migration_class) { described_class::MIGRATION } - let(:migration_name) { migration_class.to_s.demodulize } - - let(:domains_table) { table(:pages_domains) } - - let(:certificate) do - File.read('spec/fixtures/passphrase_x509_certificate.crt') - end - - before do - domains_table.create!(domain: "domain1.example.com", verification_code: "123") - domains_table.create!(domain: "domain2.example.com", verification_code: "123", certificate: '') - domains_table.create!(domain: "domain3.example.com", verification_code: "123", certificate: certificate) - domains_table.create!(domain: "domain4.example.com", verification_code: "123", certificate: certificate) - end - - it 'correctly schedules background migrations' do - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - first_id = domains_table.find_by_domain("domain3.example.com").id - last_id = domains_table.find_by_domain("domain4.example.com").id - - expect(migration_name).to be_scheduled_delayed_migration(5.minutes, first_id, last_id) - expect(BackgroundMigrationWorker.jobs.size).to eq(1) - end - end - end - - it 'sets certificate valid_not_before/not_after', :sidekiq_might_not_need_inline do - perform_enqueued_jobs do - migrate! - - domain = domains_table.find_by_domain("domain3.example.com") - expect(domain.certificate_valid_not_before) - .to eq(Time.parse("2018-03-23 14:02:08 UTC")) - expect(domain.certificate_valid_not_after) - .to eq(Time.parse("2019-03-23 14:02:08 UTC")) - end - end -end diff --git a/spec/migrations/schedule_pages_metadata_migration_spec.rb b/spec/migrations/schedule_pages_metadata_migration_spec.rb deleted file mode 100644 index 96fbc1f9f51..00000000000 --- a/spec/migrations/schedule_pages_metadata_migration_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe SchedulePagesMetadataMigration do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - - before do - stub_const("#{described_class.name}::BATCH_SIZE", 1) - - namespaces.create!(id: 11, name: 'gitlab', path: 'gitlab-org') - projects.create!(id: 111, namespace_id: 11, name: 'Project 111') - projects.create!(id: 114, namespace_id: 11, name: 'Project 114') - end - - it 'schedules pages metadata migration' do - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - expect(described_class::MIGRATION).to be_scheduled_delayed_migration(2.minutes, 111, 111) - expect(described_class::MIGRATION).to be_scheduled_delayed_migration(4.minutes, 114, 114) - expect(BackgroundMigrationWorker.jobs.size).to eq(2) - end - end - end -end diff --git a/spec/migrations/schedule_populate_merge_request_assignees_table_spec.rb b/spec/migrations/schedule_populate_merge_request_assignees_table_spec.rb deleted file mode 100644 index 3caab64a72d..00000000000 --- a/spec/migrations/schedule_populate_merge_request_assignees_table_spec.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe SchedulePopulateMergeRequestAssigneesTable do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:namespace) { namespaces.create!(name: 'gitlab', path: 'gitlab-org') } - let(:project) { projects.create!(namespace_id: namespace.id, name: 'foo') } - let(:merge_requests) { table(:merge_requests) } - - def create_merge_request(id) - params = { - id: id, - target_project_id: project.id, - target_branch: 'master', - source_project_id: project.id, - source_branch: 'mr name', - title: "mr name#{id}" - } - - merge_requests.create!(params) - end - - it 'correctly schedules background migrations' do - create_merge_request(1) - create_merge_request(2) - create_merge_request(3) - - stub_const("#{described_class.name}::BATCH_SIZE", 2) - - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - expect(described_class::MIGRATION) - .to be_scheduled_delayed_migration(8.minutes, 1, 2) - - expect(described_class::MIGRATION) - .to be_scheduled_delayed_migration(16.minutes, 3, 3) - - expect(BackgroundMigrationWorker.jobs.size).to eq(2) - end - end - end -end diff --git a/spec/migrations/schedule_sync_issuables_state_id_spec.rb b/spec/migrations/schedule_sync_issuables_state_id_spec.rb deleted file mode 100644 index 5a7105a0c84..00000000000 --- a/spec/migrations/schedule_sync_issuables_state_id_spec.rb +++ /dev/null @@ -1,81 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe ScheduleSyncIssuablesStateId do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:merge_requests) { table(:merge_requests) } - let(:issues) { table(:issues) } - let(:migration) { described_class.new } - let(:group) { namespaces.create!(name: 'gitlab', path: 'gitlab') } - let(:project) { projects.create!(namespace_id: group.id) } - - shared_examples 'scheduling migrations' do - before do - Sidekiq::Worker.clear_all - stub_const("#{described_class.name}::BATCH_SIZE", 2) - end - - it 'correctly schedules issuable sync background migration' do - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - expect(migration).to be_scheduled_delayed_migration(120.seconds, resource_1.id, resource_2.id) - expect(migration).to be_scheduled_delayed_migration(240.seconds, resource_3.id, resource_4.id) - expect(BackgroundMigrationWorker.jobs.size).to eq(2) - end - end - end - end - - describe '#up' do - context 'issues' do - it 'migrates state column to integer', :sidekiq_might_not_need_inline do - opened_issue = issues.create!(description: 'first', state: 'opened') - closed_issue = issues.create!(description: 'second', state: 'closed') - invalid_state_issue = issues.create!(description: 'fourth', state: 'not valid') - - migrate! - - expect(opened_issue.reload.state_id).to eq(Issue.available_states[:opened]) - expect(closed_issue.reload.state_id).to eq(Issue.available_states[:closed]) - expect(invalid_state_issue.reload.state_id).to be_nil - end - - it_behaves_like 'scheduling migrations' do - let(:migration) { described_class::ISSUES_MIGRATION } - let!(:resource_1) { issues.create!(description: 'first', state: 'opened') } - let!(:resource_2) { issues.create!(description: 'second', state: 'closed') } - let!(:resource_3) { issues.create!(description: 'third', state: 'closed') } - let!(:resource_4) { issues.create!(description: 'fourth', state: 'closed') } - end - end - - context 'merge requests' do - it 'migrates state column to integer', :sidekiq_might_not_need_inline do - opened_merge_request = merge_requests.create!(state: 'opened', target_project_id: project.id, target_branch: 'feature1', source_branch: 'master') - closed_merge_request = merge_requests.create!(state: 'closed', target_project_id: project.id, target_branch: 'feature2', source_branch: 'master') - merged_merge_request = merge_requests.create!(state: 'merged', target_project_id: project.id, target_branch: 'feature3', source_branch: 'master') - locked_merge_request = merge_requests.create!(state: 'locked', target_project_id: project.id, target_branch: 'feature4', source_branch: 'master') - - migrate! - - expect(opened_merge_request.reload.state_id).to eq(MergeRequest.available_states[:opened]) - expect(closed_merge_request.reload.state_id).to eq(MergeRequest.available_states[:closed]) - expect(merged_merge_request.reload.state_id).to eq(MergeRequest.available_states[:merged]) - expect(locked_merge_request.reload.state_id).to eq(MergeRequest.available_states[:locked]) - end - - it_behaves_like 'scheduling migrations' do - let(:migration) { described_class::MERGE_REQUESTS_MIGRATION } - let!(:resource_1) { merge_requests.create!(state: 'opened', target_project_id: project.id, target_branch: 'feature1', source_branch: 'master') } - let!(:resource_2) { merge_requests.create!(state: 'closed', target_project_id: project.id, target_branch: 'feature2', source_branch: 'master') } - let!(:resource_3) { merge_requests.create!(state: 'merged', target_project_id: project.id, target_branch: 'feature3', source_branch: 'master') } - let!(:resource_4) { merge_requests.create!(state: 'locked', target_project_id: project.id, target_branch: 'feature4', source_branch: 'master') } - end - end - end -end diff --git a/spec/migrations/schedule_sync_issuables_state_id_where_nil_spec.rb b/spec/migrations/schedule_sync_issuables_state_id_where_nil_spec.rb deleted file mode 100644 index d8eaaa1df04..00000000000 --- a/spec/migrations/schedule_sync_issuables_state_id_where_nil_spec.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe ScheduleSyncIssuablesStateIdWhereNil do - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:merge_requests) { table(:merge_requests) } - let(:issues) { table(:issues) } - let(:migration) { described_class.new } - let(:group) { namespaces.create!(name: 'gitlab', path: 'gitlab') } - let(:project) { projects.create!(namespace_id: group.id) } - - shared_examples 'scheduling migrations' do - before do - Sidekiq::Worker.clear_all - stub_const("#{described_class.name}::BATCH_SIZE", 2) - end - - it 'correctly schedules issuable sync background migration' do - Sidekiq::Testing.fake! do - freeze_time do - migrate! - - expect(migration).to be_scheduled_delayed_migration(120.seconds, resource_1.id, resource_3.id) - expect(migration).to be_scheduled_delayed_migration(240.seconds, resource_5.id, resource_5.id) - expect(BackgroundMigrationWorker.jobs.size).to eq(2) - end - end - end - end - - describe '#up' do - context 'issues' do - it_behaves_like 'scheduling migrations' do - let(:migration) { described_class::ISSUES_MIGRATION } - let!(:resource_1) { issues.create!(description: 'first', state: 'opened', state_id: nil) } - let!(:resource_2) { issues.create!(description: 'second', state: 'closed', state_id: 2) } - let!(:resource_3) { issues.create!(description: 'third', state: 'closed', state_id: nil) } - let!(:resource_4) { issues.create!(description: 'fourth', state: 'closed', state_id: 2) } - let!(:resource_5) { issues.create!(description: 'fifth', state: 'closed', state_id: nil) } - end - end - - context 'merge requests' do - it_behaves_like 'scheduling migrations' do - let(:migration) { described_class::MERGE_REQUESTS_MIGRATION } - let!(:resource_1) { merge_requests.create!(state: 'opened', state_id: nil, target_project_id: project.id, target_branch: 'feature1', source_branch: 'master') } - let!(:resource_2) { merge_requests.create!(state: 'closed', state_id: 2, target_project_id: project.id, target_branch: 'feature2', source_branch: 'master') } - let!(:resource_3) { merge_requests.create!(state: 'merged', state_id: nil, target_project_id: project.id, target_branch: 'feature3', source_branch: 'master') } - let!(:resource_4) { merge_requests.create!(state: 'locked', state_id: 3, target_project_id: project.id, target_branch: 'feature4', source_branch: 'master') } - let!(:resource_5) { merge_requests.create!(state: 'locked', state_id: nil, target_project_id: project.id, target_branch: 'feature4', source_branch: 'master') } - end - end - end -end diff --git a/spec/migrations/set_issue_id_for_all_versions_spec.rb b/spec/migrations/set_issue_id_for_all_versions_spec.rb deleted file mode 100644 index 78bc4bbce1c..00000000000 --- a/spec/migrations/set_issue_id_for_all_versions_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe SetIssueIdForAllVersions do - let(:projects) { table(:projects) } - let(:issues) { table(:issues) } - let(:designs) { table(:design_management_designs) } - let(:designs_versions) { table(:design_management_designs_versions) } - let(:versions) { table(:design_management_versions) } - - before do - @project = projects.create!(name: 'gitlab', path: 'gitlab-org/gitlab-ce', namespace_id: 1) - - @issue_1 = issues.create!(description: 'first', project_id: @project.id) - @issue_2 = issues.create!(description: 'second', project_id: @project.id) - - @design_1 = designs.create!(issue_id: @issue_1.id, filename: 'homepage-1.jpg', project_id: @project.id) - @design_2 = designs.create!(issue_id: @issue_2.id, filename: 'homepage-2.jpg', project_id: @project.id) - - @version_1 = versions.create!(sha: 'foo') - @version_2 = versions.create!(sha: 'bar') - - designs_versions.create!(version_id: @version_1.id, design_id: @design_1.id) - designs_versions.create!(version_id: @version_2.id, design_id: @design_2.id) - end - - it 'correctly sets issue_id' do - expect(versions.where(issue_id: nil).count).to eq(2) - - migrate! - - expect(versions.where(issue_id: nil).count).to eq(0) - expect(versions.find(@version_1.id).issue_id).to eq(@issue_1.id) - expect(versions.find(@version_2.id).issue_id).to eq(@issue_2.id) - end -end diff --git a/spec/migrations/sync_issuables_state_id_spec.rb b/spec/migrations/sync_issuables_state_id_spec.rb deleted file mode 100644 index 67403893f74..00000000000 --- a/spec/migrations/sync_issuables_state_id_spec.rb +++ /dev/null @@ -1,41 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe SyncIssuablesStateId do - let(:migration) { described_class.new } - - describe '#up' do - let(:issues) { table(:issues) } - let(:namespaces) { table(:namespaces) } - let(:projects) { table(:projects) } - let(:merge_requests) { table(:merge_requests) } - let(:group) { namespaces.create!(name: 'gitlab', path: 'gitlab') } - let(:project) { projects.create!(namespace_id: group.id) } - # These state_ids should be the same defined on Issue/MergeRequest models - let(:state_ids) { { opened: 1, closed: 2, merged: 3, locked: 4 } } - - it 'migrates state column to state_id as integer' do - opened_issue = issues.create!(description: 'first', state: 'opened') - closed_issue = issues.create!(description: 'second', state: 'closed') - unknown_state_issue = issues.create!(description: 'second', state: 'unknown') - opened_merge_request = merge_requests.create!(state: 'opened', target_project_id: project.id, target_branch: 'feature1', source_branch: 'master') - closed_merge_request = merge_requests.create!(state: 'closed', target_project_id: project.id, target_branch: 'feature2', source_branch: 'master') - merged_merge_request = merge_requests.create!(state: 'merged', target_project_id: project.id, target_branch: 'feature3', source_branch: 'master') - locked_merge_request = merge_requests.create!(state: 'locked', target_project_id: project.id, target_branch: 'feature4', source_branch: 'master') - unknown_state_merge_request = merge_requests.create!(state: 'unknown', target_project_id: project.id, target_branch: 'feature4', source_branch: 'master') - - migrate! - - expect(opened_issue.reload.state_id).to eq(state_ids[:opened]) - expect(closed_issue.reload.state_id).to eq(state_ids[:closed]) - expect(unknown_state_issue.reload.state_id).to eq(state_ids[:closed]) - expect(opened_merge_request.reload.state_id).to eq(state_ids[:opened]) - expect(closed_merge_request.reload.state_id).to eq(state_ids[:closed]) - expect(merged_merge_request.reload.state_id).to eq(state_ids[:merged]) - expect(locked_merge_request.reload.state_id).to eq(state_ids[:locked]) - expect(unknown_state_merge_request.reload.state_id).to eq(state_ids[:closed]) - end - end -end diff --git a/spec/migrations/truncate_user_fullname_spec.rb b/spec/migrations/truncate_user_fullname_spec.rb deleted file mode 100644 index dc5bef06cdc..00000000000 --- a/spec/migrations/truncate_user_fullname_spec.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe TruncateUserFullname do - let(:users) { table(:users) } - - let(:user_short) { create_user(name: 'abc', email: 'test_short@example.com') } - let(:user_long) { create_user(name: 'a' * 200 + 'z', email: 'test_long@example.com') } - - def create_user(params) - users.create!(params.merge(projects_limit: 0)) - end - - it 'truncates user full name to the first 128 characters' do - expect { migrate! }.to change { user_long.reload.name }.to('a' * 128) - end - - it 'does not truncate short names' do - expect { migrate! }.not_to change { user_short.reload.name.length } - end -end diff --git a/spec/migrations/update_minimum_password_length_spec.rb b/spec/migrations/update_minimum_password_length_spec.rb deleted file mode 100644 index e40d090fd77..00000000000 --- a/spec/migrations/update_minimum_password_length_spec.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe UpdateMinimumPasswordLength do - let(:application_settings) { table(:application_settings) } - let(:application_setting) do - application_settings.create!( - minimum_password_length: ApplicationSetting::DEFAULT_MINIMUM_PASSWORD_LENGTH - ) - end - - before do - stub_const('ApplicationSetting::DEFAULT_MINIMUM_PASSWORD_LENGTH', 10) - allow(Devise).to receive(:password_length).and_return(12..20) - end - - it 'correctly migrates minimum_password_length' do - reversible_migration do |migration| - migration.before -> { - expect(application_setting.reload.minimum_password_length).to eq(10) - } - - migration.after -> { - expect(application_setting.reload.minimum_password_length).to eq(12) - } - end - end -end |