diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /db | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) | |
download | gitlab-ce-d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb.tar.gz |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'db')
1182 files changed, 12969 insertions, 16129 deletions
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/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb b/db/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb index 5db39334550..3d81db87143 100644 --- a/db/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb +++ b/db/migrate/20210629031900_associate_existing_dast_builds_with_variables.rb @@ -20,6 +20,7 @@ class AssociateExistingDastBuildsWithVariables < ActiveRecord::Migration[6.1] class Build < ApplicationRecord self.table_name = 'ci_builds' self.inheritance_column = :_type_disabled + self.gitlab_schema = :gitlab_ci default_scope { where(name: :dast, stage: :dast) } # rubocop:disable Cop/DefaultScope end diff --git a/db/migrate/20210819185500_create_external_audit_event_destinations_table.rb b/db/migrate/20210819185500_create_external_audit_event_destinations_table.rb new file mode 100644 index 00000000000..bf0725a77a0 --- /dev/null +++ b/db/migrate/20210819185500_create_external_audit_event_destinations_table.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CreateExternalAuditEventDestinationsTable < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + create_table :audit_events_external_audit_event_destinations do |t| + t.references :namespace, index: false, null: false, foreign_key: { on_delete: :cascade } + t.text :destination_url, null: false, limit: 255 # rubocop:disable Migration/AddLimitToTextColumns + t.timestamps_with_timezone null: false + + t.index [:namespace_id, :destination_url], unique: true, name: 'index_external_audit_event_destinations_on_namespace_id' + end + end +end diff --git a/db/migrate/20210908195506_add_data_to_vulnerability_finding_evidence.rb b/db/migrate/20210908195506_add_data_to_vulnerability_finding_evidence.rb new file mode 100644 index 00000000000..447508d3d5b --- /dev/null +++ b/db/migrate/20210908195506_add_data_to_vulnerability_finding_evidence.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddDataToVulnerabilityFindingEvidence < Gitlab::Database::Migration[1.0] + def change + add_column :vulnerability_finding_evidences, :data, :jsonb, default: {}, null: false + end +end diff --git a/db/migrate/20210910014741_add_dependency_proxy_ttl_group_policy_worker_capacity_to_application_settings.rb b/db/migrate/20210910014741_add_dependency_proxy_ttl_group_policy_worker_capacity_to_application_settings.rb new file mode 100644 index 00000000000..52fab5a63ee --- /dev/null +++ b/db/migrate/20210910014741_add_dependency_proxy_ttl_group_policy_worker_capacity_to_application_settings.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddDependencyProxyTtlGroupPolicyWorkerCapacityToApplicationSettings < Gitlab::Database::Migration[1.0] + def change + add_column :application_settings, + :dependency_proxy_ttl_group_policy_worker_capacity, + :smallint, + default: 2, + null: false + end +end diff --git a/db/migrate/20210910015047_add_app_settings_dep_proxy_ttl_worker_capacity_check_constraint.rb b/db/migrate/20210910015047_add_app_settings_dep_proxy_ttl_worker_capacity_check_constraint.rb new file mode 100644 index 00000000000..9b522f2874f --- /dev/null +++ b/db/migrate/20210910015047_add_app_settings_dep_proxy_ttl_worker_capacity_check_constraint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddAppSettingsDepProxyTtlWorkerCapacityCheckConstraint < Gitlab::Database::Migration[1.0] + CONSTRAINT_NAME = 'app_settings_dep_proxy_ttl_policies_worker_capacity_positive' + + disable_ddl_transaction! + + def up + add_check_constraint :application_settings, 'dependency_proxy_ttl_group_policy_worker_capacity >= 0', CONSTRAINT_NAME + end + + def down + remove_check_constraint :application_settings, CONSTRAINT_NAME + end +end diff --git a/db/migrate/20210910192921_add_report_type_into_approval_project_rules.rb b/db/migrate/20210910192921_add_report_type_into_approval_project_rules.rb new file mode 100644 index 00000000000..4b147034657 --- /dev/null +++ b/db/migrate/20210910192921_add_report_type_into_approval_project_rules.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddReportTypeIntoApprovalProjectRules < Gitlab::Database::Migration[1.0] + def up + add_column :approval_project_rules, :report_type, :integer, limit: 2 + end + + def down + remove_column :approval_project_rules, :report_type + end +end diff --git a/db/migrate/20210912034903_add_runner_features_to_ci_builds_metadata.rb b/db/migrate/20210912034903_add_runner_features_to_ci_builds_metadata.rb new file mode 100644 index 00000000000..83eddf2fb0d --- /dev/null +++ b/db/migrate/20210912034903_add_runner_features_to_ci_builds_metadata.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddRunnerFeaturesToCiBuildsMetadata < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + add_column :ci_builds_metadata, :runner_features, :jsonb, default: {}, null: false + end +end diff --git a/db/migrate/20210913224558_update_dependency_proxy_manifests_uniqueness_constraint.rb b/db/migrate/20210913224558_update_dependency_proxy_manifests_uniqueness_constraint.rb new file mode 100644 index 00000000000..845697c28b5 --- /dev/null +++ b/db/migrate/20210913224558_update_dependency_proxy_manifests_uniqueness_constraint.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class UpdateDependencyProxyManifestsUniquenessConstraint < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + NEW_INDEX_NAME = 'index_dep_prox_manifests_on_group_id_file_name_and_status' + OLD_INDEX_NAME = 'index_dependency_proxy_manifests_on_group_id_and_file_name' + + def up + add_concurrent_index :dependency_proxy_manifests, [:group_id, :file_name, :status], unique: true, name: NEW_INDEX_NAME + remove_concurrent_index_by_name :dependency_proxy_manifests, OLD_INDEX_NAME + end + + def down + add_concurrent_index :dependency_proxy_manifests, [:group_id, :file_name], unique: true, name: OLD_INDEX_NAME + remove_concurrent_index_by_name :dependency_proxy_manifests, NEW_INDEX_NAME + end +end diff --git a/db/migrate/20210914145810_add_throttle_deprecated_api_columns.rb b/db/migrate/20210914145810_add_throttle_deprecated_api_columns.rb new file mode 100644 index 00000000000..6e57429bca8 --- /dev/null +++ b/db/migrate/20210914145810_add_throttle_deprecated_api_columns.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddThrottleDeprecatedApiColumns < Gitlab::Database::Migration[1.0] + def change + add_column :application_settings, :throttle_unauthenticated_deprecated_api_requests_per_period, :integer, default: 3600, null: false + add_column :application_settings, :throttle_unauthenticated_deprecated_api_period_in_seconds, :integer, default: 3600, null: false + add_column :application_settings, :throttle_unauthenticated_deprecated_api_enabled, :boolean, default: false, null: false + + add_column :application_settings, :throttle_authenticated_deprecated_api_requests_per_period, :integer, default: 3600, null: false + add_column :application_settings, :throttle_authenticated_deprecated_api_period_in_seconds, :integer, default: 1800, null: false + add_column :application_settings, :throttle_authenticated_deprecated_api_enabled, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20210914172202_add_status_index_to_dependency_proxy_tables.rb b/db/migrate/20210914172202_add_status_index_to_dependency_proxy_tables.rb new file mode 100644 index 00000000000..9b593fbe540 --- /dev/null +++ b/db/migrate/20210914172202_add_status_index_to_dependency_proxy_tables.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddStatusIndexToDependencyProxyTables < Gitlab::Database::Migration[1.0] + MANIFEST_INDEX_NAME = 'index_dependency_proxy_manifests_on_status' + BLOB_INDEX_NAME = 'index_dependency_proxy_blobs_on_status' + + disable_ddl_transaction! + + def up + add_concurrent_index :dependency_proxy_manifests, :status, name: MANIFEST_INDEX_NAME + add_concurrent_index :dependency_proxy_blobs, :status, name: BLOB_INDEX_NAME + end + + def down + remove_concurrent_index_by_name :dependency_proxy_manifests, MANIFEST_INDEX_NAME + remove_concurrent_index_by_name :dependency_proxy_blobs, BLOB_INDEX_NAME + end +end diff --git a/db/migrate/20210915000453_add_index_on_clusters_integration_prometheus_enabled.rb b/db/migrate/20210915000453_add_index_on_clusters_integration_prometheus_enabled.rb new file mode 100644 index 00000000000..35cd18c1da9 --- /dev/null +++ b/db/migrate/20210915000453_add_index_on_clusters_integration_prometheus_enabled.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnClustersIntegrationPrometheusEnabled < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_clusters_integration_prometheus_enabled' + + def up + add_concurrent_index(:clusters_integration_prometheus, [:enabled, :created_at, :cluster_id], name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name(:clusters_integration_prometheus, INDEX_NAME) + end +end diff --git a/db/migrate/20210915001242_add_index_on_clusters_integration_elastic_stack_enabled.rb b/db/migrate/20210915001242_add_index_on_clusters_integration_elastic_stack_enabled.rb new file mode 100644 index 00000000000..bdaa84f27fe --- /dev/null +++ b/db/migrate/20210915001242_add_index_on_clusters_integration_elastic_stack_enabled.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnClustersIntegrationElasticStackEnabled < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_clusters_integration_elasticstack_enabled' + + def up + add_concurrent_index(:clusters_integration_elasticstack, [:enabled, :created_at, :cluster_id], name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name(:clusters_integration_elasticstack, INDEX_NAME) + end +end diff --git a/db/migrate/20210915070423_add_avatar_and_description_to_topic.rb b/db/migrate/20210915070423_add_avatar_and_description_to_topic.rb new file mode 100644 index 00000000000..2ceeb53cd1e --- /dev/null +++ b/db/migrate/20210915070423_add_avatar_and_description_to_topic.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddAvatarAndDescriptionToTopic < Gitlab::Database::Migration[1.0] + # rubocop:disable Migration/AddLimitToTextColumns + def up + add_column :topics, :avatar, :text + add_column :topics, :description, :text + end + # rubocop:enable Migration/AddLimitToTextColumns + + def down + remove_column :topics, :avatar + remove_column :topics, :description + end +end diff --git a/db/migrate/20210916132547_add_process_mode_to_resource_groups.rb b/db/migrate/20210916132547_add_process_mode_to_resource_groups.rb new file mode 100644 index 00000000000..6bac264fcf4 --- /dev/null +++ b/db/migrate/20210916132547_add_process_mode_to_resource_groups.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddProcessModeToResourceGroups < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + PROCESS_MODE_UNORDERED = 0 + + def up + add_column :ci_resource_groups, :process_mode, :integer, default: PROCESS_MODE_UNORDERED, null: false, limit: 2 + end + + def down + remove_column :ci_resource_groups, :process_mode + end +end diff --git a/db/migrate/20210917134321_remove_temporary_index_for_project_topics_on_taggings.rb b/db/migrate/20210917134321_remove_temporary_index_for_project_topics_on_taggings.rb new file mode 100644 index 00000000000..ac4821b8007 --- /dev/null +++ b/db/migrate/20210917134321_remove_temporary_index_for_project_topics_on_taggings.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RemoveTemporaryIndexForProjectTopicsOnTaggings < Gitlab::Database::Migration[1.0] + MIGRATION = 'ExtractProjectTopicsIntoSeparateTable' + INDEX_NAME = 'tmp_index_taggings_on_id_where_taggable_type_project' + INDEX_CONDITION = "taggable_type = 'Project'" + + disable_ddl_transaction! + + def up + # Ensure that no background jobs of 20210730104800_schedule_extract_project_topics_into_separate_table remain + finalize_background_migration MIGRATION + # this index was used in 20210730104800_schedule_extract_project_topics_into_separate_table + remove_concurrent_index_by_name :taggings, INDEX_NAME + end + + def down + add_concurrent_index :taggings, :id, where: INDEX_CONDITION, name: INDEX_NAME # rubocop:disable Migration/PreventIndexCreation + end +end diff --git a/db/migrate/20210917153645_remove_pipeline_fk_from_packages_build_infos.rb b/db/migrate/20210917153645_remove_pipeline_fk_from_packages_build_infos.rb new file mode 100644 index 00000000000..456788de521 --- /dev/null +++ b/db/migrate/20210917153645_remove_pipeline_fk_from_packages_build_infos.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemovePipelineFkFromPackagesBuildInfos < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:packages_build_infos, :ci_pipelines) + end + end + + def down + add_concurrent_foreign_key(:packages_build_infos, :ci_pipelines, column: :pipeline_id, on_delete: :nullify) + end +end diff --git a/db/migrate/20210917153905_remove_pipeline_fk_from_packages_package_file_build_infos.rb b/db/migrate/20210917153905_remove_pipeline_fk_from_packages_package_file_build_infos.rb new file mode 100644 index 00000000000..187ddc8a088 --- /dev/null +++ b/db/migrate/20210917153905_remove_pipeline_fk_from_packages_package_file_build_infos.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemovePipelineFkFromPackagesPackageFileBuildInfos < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:packages_package_file_build_infos, :ci_pipelines) + end + end + + def down + add_concurrent_foreign_key(:packages_package_file_build_infos, :ci_pipelines, column: :pipeline_id, on_delete: :nullify) + end +end diff --git a/db/migrate/20210917224419_add_registration_objective_to_user_detail.rb b/db/migrate/20210917224419_add_registration_objective_to_user_detail.rb new file mode 100644 index 00000000000..ee7a474928e --- /dev/null +++ b/db/migrate/20210917224419_add_registration_objective_to_user_detail.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddRegistrationObjectiveToUserDetail < Gitlab::Database::Migration[1.0] + def change + add_column :user_details, :registration_objective, :smallint + end +end diff --git a/db/migrate/20210920104446_add_text_limit_to_topics_description_and_avatar.rb b/db/migrate/20210920104446_add_text_limit_to_topics_description_and_avatar.rb new file mode 100644 index 00000000000..83ceaa58ff4 --- /dev/null +++ b/db/migrate/20210920104446_add_text_limit_to_topics_description_and_avatar.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddTextLimitToTopicsDescriptionAndAvatar < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :topics, :description, 1024 + add_text_limit :topics, :avatar, 255 + end + + def down + remove_text_limit :topics, :avatar + remove_text_limit :topics, :description + end +end diff --git a/db/migrate/20210921032008_add_suggest_pipeline_enabled_to_application_settings.rb b/db/migrate/20210921032008_add_suggest_pipeline_enabled_to_application_settings.rb new file mode 100644 index 00000000000..5ac12eccc7d --- /dev/null +++ b/db/migrate/20210921032008_add_suggest_pipeline_enabled_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddSuggestPipelineEnabledToApplicationSettings < Gitlab::Database::Migration[1.0] + def change + add_column :application_settings, :suggest_pipeline_enabled, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20210921063924_index_labels_using_varchar_pattern_ops.rb b/db/migrate/20210921063924_index_labels_using_varchar_pattern_ops.rb new file mode 100644 index 00000000000..67975636488 --- /dev/null +++ b/db/migrate/20210921063924_index_labels_using_varchar_pattern_ops.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +class IndexLabelsUsingVarcharPatternOps < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + NEW_TITLE_INDEX_NAME = 'index_labels_on_title_varchar' + NEW_PROJECT_ID_TITLE_INDEX_NAME = 'index_labels_on_project_id_and_title_varchar_unique' + NEW_GROUP_ID_TITLE_INDEX_NAME = 'index_labels_on_group_id_and_title_varchar_unique' + NEW_GROUP_ID_INDEX_NAME = 'index_labels_on_group_id' + + OLD_TITLE_INDEX_NAME = 'index_labels_on_title' + OLD_PROJECT_ID_TITLE_INDEX_NAME = 'index_labels_on_project_id_and_title_unique' + OLD_GROUP_ID_TITLE_INDEX_NAME = 'index_labels_on_group_id_and_title_unique' + OLD_GROUP_ID_PROJECT_ID_TITLE_INDEX_NAME = 'index_labels_on_group_id_and_project_id_and_title' + + def up + add_concurrent_index :labels, :title, order: { title: :varchar_pattern_ops }, name: NEW_TITLE_INDEX_NAME + add_concurrent_index :labels, [:project_id, :title], where: "labels.group_id IS NULL", unique: true, order: { title: :varchar_pattern_ops }, name: NEW_PROJECT_ID_TITLE_INDEX_NAME + add_concurrent_index :labels, [:group_id, :title], where: "labels.project_id IS NULL", unique: true, order: { title: :varchar_pattern_ops }, name: NEW_GROUP_ID_TITLE_INDEX_NAME + add_concurrent_index :labels, :group_id, name: NEW_GROUP_ID_INDEX_NAME + + remove_concurrent_index_by_name :labels, OLD_TITLE_INDEX_NAME + remove_concurrent_index_by_name :labels, OLD_PROJECT_ID_TITLE_INDEX_NAME + remove_concurrent_index_by_name :labels, OLD_GROUP_ID_TITLE_INDEX_NAME + remove_concurrent_index_by_name :labels, OLD_GROUP_ID_PROJECT_ID_TITLE_INDEX_NAME + end + + def down + add_concurrent_index :labels, :title, name: OLD_TITLE_INDEX_NAME + add_concurrent_index :labels, [:project_id, :title], where: "labels.group_id IS NULL", unique: true, name: OLD_PROJECT_ID_TITLE_INDEX_NAME + add_concurrent_index :labels, [:group_id, :title], where: "labels.project_id IS NULL", unique: true, name: OLD_GROUP_ID_TITLE_INDEX_NAME + add_concurrent_index :labels, [:group_id, :project_id, :title], unique: true, name: OLD_GROUP_ID_PROJECT_ID_TITLE_INDEX_NAME + + remove_concurrent_index_by_name :labels, NEW_TITLE_INDEX_NAME + remove_concurrent_index_by_name :labels, NEW_PROJECT_ID_TITLE_INDEX_NAME + remove_concurrent_index_by_name :labels, NEW_GROUP_ID_TITLE_INDEX_NAME + remove_concurrent_index_by_name :labels, NEW_GROUP_ID_INDEX_NAME + end +end diff --git a/db/migrate/20210921191010_add_report_type_index_into_approval_project_rules.rb b/db/migrate/20210921191010_add_report_type_index_into_approval_project_rules.rb new file mode 100644 index 00000000000..c03c463b9bb --- /dev/null +++ b/db/migrate/20210921191010_add_report_type_index_into_approval_project_rules.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddReportTypeIndexIntoApprovalProjectRules < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_approval_project_rules_report_type' + + def up + add_concurrent_index :approval_project_rules, :report_type, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :approval_project_rules, name: INDEX_NAME + end +end diff --git a/db/migrate/20210922172056_add_unique_namespaces_index_on_name_parent_id_and_type.rb b/db/migrate/20210922172056_add_unique_namespaces_index_on_name_parent_id_and_type.rb new file mode 100644 index 00000000000..6cbbe582ff6 --- /dev/null +++ b/db/migrate/20210922172056_add_unique_namespaces_index_on_name_parent_id_and_type.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddUniqueNamespacesIndexOnNameParentIdAndType < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_namespaces_name_parent_id_type' + + disable_ddl_transaction! + + def up + add_concurrent_index :namespaces, [:name, :parent_id, :type], unique: true, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :namespaces, INDEX_NAME + end +end diff --git a/db/migrate/20210922172156_drop_unique_namespaces_index_on_name_and_parent_id.rb b/db/migrate/20210922172156_drop_unique_namespaces_index_on_name_and_parent_id.rb new file mode 100644 index 00000000000..001f3a6964b --- /dev/null +++ b/db/migrate/20210922172156_drop_unique_namespaces_index_on_name_and_parent_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropUniqueNamespacesIndexOnNameAndParentId < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_namespaces_on_name_and_parent_id' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :namespaces, INDEX_NAME + end + + def down + add_concurrent_index :namespaces, [:name, :parent_id], unique: true, name: INDEX_NAME + end +end diff --git a/db/migrate/20210922215740_create_issue_customer_relations_contacts.rb b/db/migrate/20210922215740_create_issue_customer_relations_contacts.rb new file mode 100644 index 00000000000..2d89d295608 --- /dev/null +++ b/db/migrate/20210922215740_create_issue_customer_relations_contacts.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class CreateIssueCustomerRelationsContacts < Gitlab::Database::Migration[1.0] + def change + create_table :issue_customer_relations_contacts do |t| + t.bigint :issue_id, null: false + t.bigint :contact_id, null: false + t.timestamps_with_timezone null: false + + t.index :contact_id + t.index [:issue_id, :contact_id], unique: true, name: :index_issue_crm_contacts_on_issue_id_and_contact_id + end + end +end diff --git a/db/migrate/20210922220104_add_issue_customer_relations_contacts_foreign_keys.rb b/db/migrate/20210922220104_add_issue_customer_relations_contacts_foreign_keys.rb new file mode 100644 index 00000000000..7be465ca31a --- /dev/null +++ b/db/migrate/20210922220104_add_issue_customer_relations_contacts_foreign_keys.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class AddIssueCustomerRelationsContactsForeignKeys < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :issue_customer_relations_contacts, :issues, column: :issue_id + add_concurrent_foreign_key :issue_customer_relations_contacts, :customer_relations_contacts, column: :contact_id + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :issue_customer_relations_contacts, column: :issue_id + end + + with_lock_retries do + remove_foreign_key_if_exists :issue_customer_relations_contacts, column: :contact_id + end + end +end diff --git a/db/migrate/20210923042323_add_meta_data_to_user_credit_card_validations.rb b/db/migrate/20210923042323_add_meta_data_to_user_credit_card_validations.rb new file mode 100644 index 00000000000..2958285e7a5 --- /dev/null +++ b/db/migrate/20210923042323_add_meta_data_to_user_credit_card_validations.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddMetaDataToUserCreditCardValidations < Gitlab::Database::Migration[1.0] + # rubocop:disable Migration/AddLimitToTextColumns + def change + change_table :user_credit_card_validations do |t| + t.date :expiration_date + t.integer :last_digits, limit: 2 # last 4 digits + t.text :holder_name + end + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20210923042324_limit_holder_name_on_user_credit_card_validations.rb b/db/migrate/20210923042324_limit_holder_name_on_user_credit_card_validations.rb new file mode 100644 index 00000000000..11d436093b7 --- /dev/null +++ b/db/migrate/20210923042324_limit_holder_name_on_user_credit_card_validations.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class LimitHolderNameOnUserCreditCardValidations < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :user_credit_card_validations, :holder_name, 26 # ISO IEC 7813 + + add_check_constraint(:user_credit_card_validations, 'last_digits BETWEEN 0 AND 9999', constraint_name) + end + + def down + remove_text_limit :user_credit_card_validations, :holder_name + + remove_check_constraint(:user_credit_card_validations, constraint_name) + end + + private + + def constraint_name + check_constraint_name(:user_credit_card_validations, :last_digits, 'range') + end +end diff --git a/db/migrate/20210923042325_index_meta_data_on_user_credit_card_validations.rb b/db/migrate/20210923042325_index_meta_data_on_user_credit_card_validations.rb new file mode 100644 index 00000000000..cc4f4d35f09 --- /dev/null +++ b/db/migrate/20210923042325_index_meta_data_on_user_credit_card_validations.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class IndexMetaDataOnUserCreditCardValidations < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_user_credit_card_validations_meta_data_full_match' + + def up + add_concurrent_index :user_credit_card_validations, + [:holder_name, :expiration_date, :last_digits, :credit_card_validated_at], + name: INDEX_NAME + end + + def down + remove_concurrent_index :user_credit_card_validations, + [:holder_name, :expiration_date, :last_digits, :credit_card_validated_at], + name: INDEX_NAME + end +end diff --git a/db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb b/db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb new file mode 100644 index 00000000000..fc4cc1945f3 --- /dev/null +++ b/db/migrate/20210923151641_change_default_for_integrated_error_tracking.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class ChangeDefaultForIntegratedErrorTracking < Gitlab::Database::Migration[1.0] + def up + change_column_default :project_error_tracking_settings, :integrated, from: false, to: true + end + + def down + change_column_default :project_error_tracking_settings, :integrated, from: true, to: false + end +end diff --git a/db/migrate/20210928155022_improve_index_for_error_tracking.rb b/db/migrate/20210928155022_improve_index_for_error_tracking.rb new file mode 100644 index 00000000000..ec8427670d7 --- /dev/null +++ b/db/migrate/20210928155022_improve_index_for_error_tracking.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +class ImproveIndexForErrorTracking < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_concurrent_index :error_tracking_errors, %i(project_id status last_seen_at id), + order: { last_seen_at: :desc, id: :desc }, + name: 'index_et_errors_on_project_id_and_status_last_seen_at_id_desc' + + add_concurrent_index :error_tracking_errors, %i(project_id status first_seen_at id), + order: { first_seen_at: :desc, id: :desc }, + name: 'index_et_errors_on_project_id_and_status_first_seen_at_id_desc' + + add_concurrent_index :error_tracking_errors, %i(project_id status events_count id), + order: { events_count: :desc, id: :desc }, + name: 'index_et_errors_on_project_id_and_status_events_count_id_desc' + + remove_concurrent_index :error_tracking_errors, [:project_id, :status, :last_seen_at], name: 'index_et_errors_on_project_id_and_status_and_last_seen_at' + remove_concurrent_index :error_tracking_errors, [:project_id, :status, :first_seen_at], name: 'index_et_errors_on_project_id_and_status_and_first_seen_at' + remove_concurrent_index :error_tracking_errors, [:project_id, :status, :events_count], name: 'index_et_errors_on_project_id_and_status_and_events_count' + end + + def down + add_concurrent_index :error_tracking_errors, [:project_id, :status, :last_seen_at], name: 'index_et_errors_on_project_id_and_status_and_last_seen_at' + add_concurrent_index :error_tracking_errors, [:project_id, :status, :first_seen_at], name: 'index_et_errors_on_project_id_and_status_and_first_seen_at' + add_concurrent_index :error_tracking_errors, [:project_id, :status, :events_count], name: 'index_et_errors_on_project_id_and_status_and_events_count' + + remove_concurrent_index :error_tracking_errors, [:project_id, :status, :last_seen_at, :id], name: 'index_et_errors_on_project_id_and_status_last_seen_at_id_desc' + remove_concurrent_index :error_tracking_errors, [:project_id, :status, :first_seen_at, :id], name: 'index_et_errors_on_project_id_and_status_first_seen_at_id_desc' + remove_concurrent_index :error_tracking_errors, [:project_id, :status, :events_count, :id], name: 'index_et_errors_on_project_id_and_status_events_count_id_desc' + end +end diff --git a/db/migrate/20210928171122_add_group_id_status_id_index_to_dependency_proxy_tables.rb b/db/migrate/20210928171122_add_group_id_status_id_index_to_dependency_proxy_tables.rb new file mode 100644 index 00000000000..ef437641f2c --- /dev/null +++ b/db/migrate/20210928171122_add_group_id_status_id_index_to_dependency_proxy_tables.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddGroupIdStatusIdIndexToDependencyProxyTables < Gitlab::Database::Migration[1.0] + MANIFEST_INDEX_NAME = 'index_dependency_proxy_manifests_on_group_id_status_and_id' + BLOB_INDEX_NAME = 'index_dependency_proxy_blobs_on_group_id_status_and_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :dependency_proxy_manifests, [:group_id, :status, :id], name: MANIFEST_INDEX_NAME + add_concurrent_index :dependency_proxy_blobs, [:group_id, :status, :id], name: BLOB_INDEX_NAME + end + + def down + remove_concurrent_index_by_name :dependency_proxy_manifests, MANIFEST_INDEX_NAME + remove_concurrent_index_by_name :dependency_proxy_blobs, BLOB_INDEX_NAME + end +end diff --git a/db/migrate/20210929025600_add_phone_to_user_details.rb b/db/migrate/20210929025600_add_phone_to_user_details.rb new file mode 100644 index 00000000000..9bcfd4ab7e3 --- /dev/null +++ b/db/migrate/20210929025600_add_phone_to_user_details.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddPhoneToUserDetails < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + # rubocop:disable Migration/AddLimitToTextColumns + def up + add_column :user_details, :phone, :text, comment: 'JiHu-specific column' + end + # rubocop:enable Migration/AddLimitToTextColumns + + def down + remove_column :user_details, :phone + end +end diff --git a/db/migrate/20210929030834_add_text_limit_to_user_details_phone.rb b/db/migrate/20210929030834_add_text_limit_to_user_details_phone.rb new file mode 100644 index 00000000000..f250aad3253 --- /dev/null +++ b/db/migrate/20210929030834_add_text_limit_to_user_details_phone.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToUserDetailsPhone < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :user_details, :phone, 32 + end + + def down + remove_text_limit :user_details, :phone + end +end diff --git a/db/migrate/20210929031049_add_unique_index_phone_on_user_details.rb b/db/migrate/20210929031049_add_unique_index_phone_on_user_details.rb new file mode 100644 index 00000000000..e0cf7aa8a44 --- /dev/null +++ b/db/migrate/20210929031049_add_unique_index_phone_on_user_details.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddUniqueIndexPhoneOnUserDetails < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_user_details_on_phone' + + def up + add_concurrent_index :user_details, :phone, unique: true, where: 'phone IS NOT NULL', name: INDEX_NAME, comment: 'JiHu-specific index' + end + + def down + remove_concurrent_index_by_name :user_details, INDEX_NAME + end +end diff --git a/db/migrate/20210929032555_create_verification_codes.rb b/db/migrate/20210929032555_create_verification_codes.rb new file mode 100644 index 00000000000..ad743641b9c --- /dev/null +++ b/db/migrate/20210929032555_create_verification_codes.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +class CreateVerificationCodes < Gitlab::Database::Migration[1.0] + include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers + + def up + constraint_visitor_id_code = check_constraint_name('verification_codes', 'visitor_id_code', 'max_length') + constraint_code = check_constraint_name('verification_codes', 'code', 'max_length') + constraint_phone = check_constraint_name('verification_codes', 'phone', 'max_length') + + execute(<<~SQL) + CREATE TABLE verification_codes ( + created_at timestamp with time zone NOT NULL DEFAULT NOW(), + visitor_id_code text, + code text, + phone text, + PRIMARY KEY (created_at, visitor_id_code, code, phone), + CONSTRAINT #{constraint_visitor_id_code} CHECK ((char_length(visitor_id_code) <= 64)), + CONSTRAINT #{constraint_code} CHECK ((char_length(code) <= 8)), + CONSTRAINT #{constraint_phone} CHECK ((char_length(phone) <= 32)) + ) PARTITION BY RANGE (created_at); + COMMENT ON TABLE verification_codes IS 'JiHu-specific table'; + + CREATE UNIQUE INDEX index_verification_codes_on_phone_and_visitor_id_code ON verification_codes (visitor_id_code, phone, created_at); + COMMENT ON INDEX index_verification_codes_on_phone_and_visitor_id_code IS 'JiHu-specific index'; + SQL + + min_date = Date.today - 1.month + max_date = Date.today + 1.month + create_daterange_partitions('verification_codes', 'created_at', min_date, max_date) + end + + def down + drop_table :verification_codes + end +end diff --git a/db/migrate/20210929115340_add_security_policy_configurations_management_project_id_foreign_key.rb b/db/migrate/20210929115340_add_security_policy_configurations_management_project_id_foreign_key.rb new file mode 100644 index 00000000000..1335c06cf1f --- /dev/null +++ b/db/migrate/20210929115340_add_security_policy_configurations_management_project_id_foreign_key.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddSecurityPolicyConfigurationsManagementProjectIdForeignKey < Gitlab::Database::Migration[1.0] + CONSTRAINT_NAME = 'fk_security_policy_configurations_management_project_id' + OLD_CONSTRAINT_NAME = 'fk_rails_42ed6c25ec' + + disable_ddl_transaction! + + def up + add_concurrent_foreign_key(:security_orchestration_policy_configurations, :projects, column: :security_policy_management_project_id, on_delete: :cascade, name: CONSTRAINT_NAME) + remove_foreign_key_if_exists(:security_orchestration_policy_configurations, column: :security_policy_management_project_id, on_delete: :restrict, name: OLD_CONSTRAINT_NAME) + end + + def down + add_concurrent_foreign_key(:security_orchestration_policy_configurations, :projects, column: :security_policy_management_project_id, on_delete: :restrict, name: OLD_CONSTRAINT_NAME) + remove_foreign_key_if_exists(:security_orchestration_policy_configurations, column: :security_policy_management_project_id, on_delete: :cascade, name: CONSTRAINT_NAME) + end +end diff --git a/db/migrate/20210929121516_add_releases_author_id_id_created_at_index.rb b/db/migrate/20210929121516_add_releases_author_id_id_created_at_index.rb new file mode 100644 index 00000000000..60ca3040d70 --- /dev/null +++ b/db/migrate/20210929121516_add_releases_author_id_id_created_at_index.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true +class AddReleasesAuthorIdIdCreatedAtIndex < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_releases_on_author_id_id_created_at' + + def up + add_concurrent_index :releases, [:author_id, :id, :created_at], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :releases, INDEX_NAME + end +end diff --git a/db/migrate/20210930081208_fix_deprecated_api_throttle_defaults.rb b/db/migrate/20210930081208_fix_deprecated_api_throttle_defaults.rb new file mode 100644 index 00000000000..be82b16ee8c --- /dev/null +++ b/db/migrate/20210930081208_fix_deprecated_api_throttle_defaults.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class FixDeprecatedApiThrottleDefaults < Gitlab::Database::Migration[1.0] + def change + change_column_default :application_settings, :throttle_unauthenticated_deprecated_api_requests_per_period, from: 3600, to: 1800 + change_column_default :application_settings, :throttle_authenticated_deprecated_api_period_in_seconds, from: 1800, to: 3600 + end +end diff --git a/db/migrate/20211001001222_add_source_version_to_bulk_imports.rb b/db/migrate/20211001001222_add_source_version_to_bulk_imports.rb new file mode 100644 index 00000000000..d0eb4a32cac --- /dev/null +++ b/db/migrate/20211001001222_add_source_version_to_bulk_imports.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddSourceVersionToBulkImports < Gitlab::Database::Migration[1.0] + def change + add_column :bulk_imports, :source_version, :text # rubocop:disable Migration/AddLimitToTextColumns + end +end diff --git a/db/migrate/20211004062942_create_coverage_fuzzing_corpuses.rb b/db/migrate/20211004062942_create_coverage_fuzzing_corpuses.rb new file mode 100644 index 00000000000..c24883b626d --- /dev/null +++ b/db/migrate/20211004062942_create_coverage_fuzzing_corpuses.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateCoverageFuzzingCorpuses < Gitlab::Database::Migration[1.0] + def change + create_table :coverage_fuzzing_corpuses do |t| + t.bigint :project_id, null: false + t.bigint :user_id + t.bigint :package_id, null: false + + t.datetime_with_timezone :file_updated_at, null: false, default: -> { 'NOW()' } + t.timestamps_with_timezone null: false + + t.index :project_id + t.index :user_id + t.index :package_id + end + end +end diff --git a/db/migrate/20211004075629_add_topics_name_gin_index.rb b/db/migrate/20211004075629_add_topics_name_gin_index.rb new file mode 100644 index 00000000000..94634a4cb2f --- /dev/null +++ b/db/migrate/20211004075629_add_topics_name_gin_index.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddTopicsNameGinIndex < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_topics_on_name_trigram' + + disable_ddl_transaction! + + def up + add_concurrent_index :topics, :name, name: INDEX_NAME, using: :gin, opclass: { name: :gin_trgm_ops } + end + + def down + remove_concurrent_index_by_name :topics, INDEX_NAME + end +end diff --git a/db/migrate/20211004081911_add_external_event_destination_limit_to_plan_limits.rb b/db/migrate/20211004081911_add_external_event_destination_limit_to_plan_limits.rb new file mode 100644 index 00000000000..3e44c388617 --- /dev/null +++ b/db/migrate/20211004081911_add_external_event_destination_limit_to_plan_limits.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddExternalEventDestinationLimitToPlanLimits < Gitlab::Database::Migration[1.0] + def change + add_column(:plan_limits, :external_audit_event_destinations, :integer, default: 5, null: false) + end +end diff --git a/db/migrate/20211005063519_add_foreign_key_to_corpuses_on_project.rb b/db/migrate/20211005063519_add_foreign_key_to_corpuses_on_project.rb new file mode 100644 index 00000000000..ba1fb443343 --- /dev/null +++ b/db/migrate/20211005063519_add_foreign_key_to_corpuses_on_project.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddForeignKeyToCorpusesOnProject < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :coverage_fuzzing_corpuses, :projects, column: :project_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :coverage_fuzzing_corpuses, column: :project_id + end + end +end diff --git a/db/migrate/20211005063616_add_foreign_key_to_corpuses_on_user.rb b/db/migrate/20211005063616_add_foreign_key_to_corpuses_on_user.rb new file mode 100644 index 00000000000..da08ab97acf --- /dev/null +++ b/db/migrate/20211005063616_add_foreign_key_to_corpuses_on_user.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddForeignKeyToCorpusesOnUser < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :coverage_fuzzing_corpuses, :users, column: :user_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :coverage_fuzzing_corpuses, column: :user_id + end + end +end diff --git a/db/migrate/20211005063723_add_foreign_key_to_corpuses_on_package.rb b/db/migrate/20211005063723_add_foreign_key_to_corpuses_on_package.rb new file mode 100644 index 00000000000..74ba7b070d0 --- /dev/null +++ b/db/migrate/20211005063723_add_foreign_key_to_corpuses_on_package.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddForeignKeyToCorpusesOnPackage < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :coverage_fuzzing_corpuses, :packages_packages, column: :package_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :coverage_fuzzing_corpuses, column: :package_id + end + end +end diff --git a/db/migrate/20211005092428_drop_time_range_partitioned_loose_fk.rb b/db/migrate/20211005092428_drop_time_range_partitioned_loose_fk.rb new file mode 100644 index 00000000000..2aaf5e4cf87 --- /dev/null +++ b/db/migrate/20211005092428_drop_time_range_partitioned_loose_fk.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class DropTimeRangePartitionedLooseFk < Gitlab::Database::Migration[1.0] + include Gitlab::Database::PartitioningMigrationHelpers + + def up + # the table is not in use + drop_table :loose_foreign_keys_deleted_records # rubocop: disable Migration/DropTable + end + + def down + constraint_name = check_constraint_name('loose_foreign_keys_deleted_records', 'deleted_table_name', 'max_length') + execute(<<~SQL) + CREATE TABLE loose_foreign_keys_deleted_records ( + created_at timestamp with time zone NOT NULL DEFAULT NOW(), + deleted_table_name text NOT NULL, + deleted_table_primary_key_value bigint NOT NULL, + PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value), + CONSTRAINT #{constraint_name} CHECK ((char_length(deleted_table_name) <= 63)) + ) PARTITION BY RANGE (created_at); + SQL + + min_date = Date.today - 1.month + max_date = Date.today + 3.months + create_daterange_partitions('loose_foreign_keys_deleted_records', 'created_at', min_date, max_date) + end +end diff --git a/db/migrate/20211005093558_add_range_partitioned_loose_fk_table.rb b/db/migrate/20211005093558_add_range_partitioned_loose_fk_table.rb new file mode 100644 index 00000000000..6f52b6ec63b --- /dev/null +++ b/db/migrate/20211005093558_add_range_partitioned_loose_fk_table.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class AddRangePartitionedLooseFkTable < Gitlab::Database::Migration[1.0] + include Gitlab::Database::PartitioningMigrationHelpers::TableManagementHelpers + + def up + constraint_name = check_constraint_name('loose_foreign_keys_deleted_records', 'fully_qualified_table_name', 'max_length') + execute(<<~SQL) + CREATE TABLE loose_foreign_keys_deleted_records ( + id BIGSERIAL NOT NULL, + partition bigint NOT NULL, + primary_key_value bigint NOT NULL, + status smallint NOT NULL DEFAULT 1, + created_at timestamp with time zone NOT NULL DEFAULT NOW(), + fully_qualified_table_name text NOT NULL, + PRIMARY KEY (partition, id), + CONSTRAINT #{constraint_name} CHECK ((char_length(fully_qualified_table_name) <= 150)) + ) PARTITION BY LIST (partition); + + CREATE TABLE gitlab_partitions_static.loose_foreign_keys_deleted_records_1 + PARTITION OF loose_foreign_keys_deleted_records + FOR VALUES IN (1); + SQL + end + + def down + drop_table :loose_foreign_keys_deleted_records + end +end diff --git a/db/migrate/20211005100112_recreate_loose_fk_insert_function.rb b/db/migrate/20211005100112_recreate_loose_fk_insert_function.rb new file mode 100644 index 00000000000..b03ad069eba --- /dev/null +++ b/db/migrate/20211005100112_recreate_loose_fk_insert_function.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +class RecreateLooseFkInsertFunction < Gitlab::Database::Migration[1.0] + include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers + + def up + execute(<<~SQL) + CREATE OR REPLACE FUNCTION #{DELETED_RECORDS_INSERT_FUNCTION_NAME}() + RETURNS TRIGGER AS + $$ + BEGIN + INSERT INTO loose_foreign_keys_deleted_records + (partition, fully_qualified_table_name, primary_key_value) + SELECT 1, TG_TABLE_SCHEMA || '.' || TG_TABLE_NAME, old_table.id FROM old_table + ON CONFLICT DO NOTHING; + + RETURN NULL; + END + $$ LANGUAGE PLPGSQL + SQL + end + + def down + # old function + execute(<<~SQL) + CREATE OR REPLACE FUNCTION #{DELETED_RECORDS_INSERT_FUNCTION_NAME}() + RETURNS TRIGGER AS + $$ + BEGIN + INSERT INTO loose_foreign_keys_deleted_records + (deleted_table_name, deleted_table_primary_key_value) + SELECT TG_TABLE_NAME, old_table.id FROM old_table + ON CONFLICT DO NOTHING; + + RETURN NULL; + END + $$ LANGUAGE PLPGSQL + SQL + end +end diff --git a/db/migrate/20211006060254_add_topics_total_projects_count_cache.rb b/db/migrate/20211006060254_add_topics_total_projects_count_cache.rb new file mode 100644 index 00000000000..ebca4c70879 --- /dev/null +++ b/db/migrate/20211006060254_add_topics_total_projects_count_cache.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddTopicsTotalProjectsCountCache < Gitlab::Database::Migration[1.0] + def up + add_column :topics, :total_projects_count, :bigint, null: false, default: 0 + end + + def down + remove_column :topics, :total_projects_count + end +end diff --git a/db/migrate/20211006103122_change_helm_channel_length.rb b/db/migrate/20211006103122_change_helm_channel_length.rb new file mode 100644 index 00000000000..6579ca4053b --- /dev/null +++ b/db/migrate/20211006103122_change_helm_channel_length.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class ChangeHelmChannelLength < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :packages_helm_file_metadata, :channel, 255, constraint_name: check_constraint_name(:packages_helm_file_metadata, :channel, 'max_length_v2') + remove_text_limit :packages_helm_file_metadata, :channel, constraint_name: check_constraint_name(:packages_helm_file_metadata, :channel, 'max_length') + end + + def down + # no-op: Danger of failing if there are records with length(channel) > 63 + end +end diff --git a/db/migrate/20211006122010_add_topics_total_projects_count_index.rb b/db/migrate/20211006122010_add_topics_total_projects_count_index.rb new file mode 100644 index 00000000000..bd969a9ff0a --- /dev/null +++ b/db/migrate/20211006122010_add_topics_total_projects_count_index.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddTopicsTotalProjectsCountIndex < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_topics_total_projects_count' + + disable_ddl_transaction! + + def up + add_concurrent_index :topics, [:total_projects_count, :id], order: { total_projects_count: :desc }, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :topics, INDEX_NAME + end +end diff --git a/db/migrate/20211007113136_add_status_column_to_security_scans_table.rb b/db/migrate/20211007113136_add_status_column_to_security_scans_table.rb new file mode 100644 index 00000000000..d60171dead7 --- /dev/null +++ b/db/migrate/20211007113136_add_status_column_to_security_scans_table.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddStatusColumnToSecurityScansTable < Gitlab::Database::Migration[1.0] + def change + add_column :security_scans, :status, :integer, limit: 1, default: 0, null: false + end +end diff --git a/db/migrate/20211008181451_add_shared_runners_duration_to_ci_namespace_monthly_usages.rb b/db/migrate/20211008181451_add_shared_runners_duration_to_ci_namespace_monthly_usages.rb new file mode 100644 index 00000000000..862d1a26867 --- /dev/null +++ b/db/migrate/20211008181451_add_shared_runners_duration_to_ci_namespace_monthly_usages.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddSharedRunnersDurationToCiNamespaceMonthlyUsages < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + add_column :ci_namespace_monthly_usages, :shared_runners_duration, :integer, default: 0, null: false + end +end diff --git a/db/migrate/20211008182954_add_shared_runners_duration_to_ci_project_monthly_usages.rb b/db/migrate/20211008182954_add_shared_runners_duration_to_ci_project_monthly_usages.rb new file mode 100644 index 00000000000..76bb7356f0f --- /dev/null +++ b/db/migrate/20211008182954_add_shared_runners_duration_to_ci_project_monthly_usages.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddSharedRunnersDurationToCiProjectMonthlyUsages < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + add_column :ci_project_monthly_usages, :shared_runners_duration, :integer, default: 0, null: false + end +end diff --git a/db/migrate/20211012091822_add_text_limit_to_bulk_imports_source_version.rb b/db/migrate/20211012091822_add_text_limit_to_bulk_imports_source_version.rb new file mode 100644 index 00000000000..9b4fca9a98c --- /dev/null +++ b/db/migrate/20211012091822_add_text_limit_to_bulk_imports_source_version.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToBulkImportsSourceVersion < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :bulk_imports, :source_version, 63 + end + + def down + remove_text_limit :bulk_imports, :source_version + 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/post_migrate/20210906130643_drop_temporary_columns_and_triggers_for_taggings.rb b/db/post_migrate/20210906130643_drop_temporary_columns_and_triggers_for_taggings.rb new file mode 100644 index 00000000000..cb5714055bb --- /dev/null +++ b/db/post_migrate/20210906130643_drop_temporary_columns_and_triggers_for_taggings.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class DropTemporaryColumnsAndTriggersForTaggings < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + TABLE = 'taggings' + COLUMNS = %w(id taggable_id) + + # rubocop:disable Migration/WithLockRetriesDisallowedMethod + def up + cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS) + end + # rubocop:enable Migration/WithLockRetriesDisallowedMethod + + def down + restore_conversion_of_integer_to_bigint(TABLE, COLUMNS) + end +end diff --git a/db/post_migrate/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata.rb b/db/post_migrate/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata.rb new file mode 100644 index 00000000000..54dce0a7da8 --- /dev/null +++ b/db/post_migrate/20210907013944_cleanup_bigint_conversion_for_ci_builds_metadata.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForCiBuildsMetadata < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + TABLE = :ci_builds_metadata + + def up + cleanup_conversion_of_integer_to_bigint(TABLE, :id) + cleanup_conversion_of_integer_to_bigint(TABLE, :build_id) + end + + def down + restore_conversion_of_integer_to_bigint(TABLE, :build_id) + restore_conversion_of_integer_to_bigint(TABLE, :id) + end +end diff --git a/db/post_migrate/20210910194952_update_report_type_for_existing_approval_project_rules.rb b/db/post_migrate/20210910194952_update_report_type_for_existing_approval_project_rules.rb new file mode 100644 index 00000000000..537c235edab --- /dev/null +++ b/db/post_migrate/20210910194952_update_report_type_for_existing_approval_project_rules.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +class UpdateReportTypeForExistingApprovalProjectRules < Gitlab::Database::Migration[1.0] + def up + # 1. We only want to consider when rule_type is set to :report_approver (i.e., 2): + # enum rule_type: { + # regular: 0, + # code_owner: 1, # currently unused + # report_approver: 2, + # any_approver: 3 + # } + # 2. Also we want to change only the folowing names and respective values: + # DEFAULT_NAME_FOR_LICENSE_REPORT = 'License-Check' + # DEFAULT_NAME_FOR_VULNERABILITY_REPORT = 'Vulnerability-Check' + # DEFAULT_NAME_FOR_COVERAGE = 'Coverage-Check' + # enum report_type: { + # vulnerability: 1, + # license_scanning: 2, + # code_coverage: 3 + # } + + execute <<~SQL + UPDATE approval_project_rules + SET report_type = converted_values.report_type + FROM + ( values + (1, 'Vulnerability-Check'), + (2, 'License-Check'), + (3, 'Coverage-Check') + ) AS converted_values(report_type, name) + WHERE approval_project_rules.name = converted_values.name + AND approval_project_rules.rule_type = 2; + SQL + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20210915022415_cleanup_bigint_conversion_for_ci_builds.rb b/db/post_migrate/20210915022415_cleanup_bigint_conversion_for_ci_builds.rb new file mode 100644 index 00000000000..d72866691ff --- /dev/null +++ b/db/post_migrate/20210915022415_cleanup_bigint_conversion_for_ci_builds.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForCiBuilds < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + TABLE = :ci_builds + COLUMNS = [:id, :stage_id] + + def up + cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS) + end + + def down + restore_conversion_of_integer_to_bigint(TABLE, COLUMNS) + end +end diff --git a/db/post_migrate/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb b/db/post_migrate/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb new file mode 100644 index 00000000000..224d97243c5 --- /dev/null +++ b/db/post_migrate/20210918201050_remove_old_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class RemoveOldPendingJobsForRecalculateVulnerabilitiesOccurrencesUuid < Gitlab::Database::Migration[1.0] + MIGRATION_NAME = 'RecalculateVulnerabilitiesOccurrencesUuid' + NEW_MIGRATION_START_DATE = DateTime.new(2021, 8, 18, 0, 0, 0) + + def up + Gitlab::Database::BackgroundMigrationJob + .for_migration_class(MIGRATION_NAME) + .where('created_at < ?', NEW_MIGRATION_START_DATE) + .where(status: :pending) + .delete_all + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb b/db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb new file mode 100644 index 00000000000..88351b3007a --- /dev/null +++ b/db/post_migrate/20210918202855_reschedule_pending_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class ReschedulePendingJobsForRecalculateVulnerabilitiesOccurrencesUuid < Gitlab::Database::Migration[1.0] + MIGRATION = "RecalculateVulnerabilitiesOccurrencesUuid" + DELAY_INTERVAL = 2.minutes + + disable_ddl_transaction! + + def up + delete_queued_jobs(MIGRATION) + + requeue_background_migration_jobs_by_range_at_intervals(MIGRATION, DELAY_INTERVAL) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20210920232025_remove_ci_builds_foreign_key_from_terraform_state_versions.rb b/db/post_migrate/20210920232025_remove_ci_builds_foreign_key_from_terraform_state_versions.rb new file mode 100644 index 00000000000..7435a2c889b --- /dev/null +++ b/db/post_migrate/20210920232025_remove_ci_builds_foreign_key_from_terraform_state_versions.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveCiBuildsForeignKeyFromTerraformStateVersions < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:terraform_state_versions, :ci_builds) + end + end + + def down + add_concurrent_foreign_key(:terraform_state_versions, :ci_builds, column: :ci_build_id, on_delete: :nullify) + end +end diff --git a/db/post_migrate/20210921062820_add_image_location_index_to_vulnerability_occurrences.rb b/db/post_migrate/20210921062820_add_image_location_index_to_vulnerability_occurrences.rb new file mode 100644 index 00000000000..7a6543395ff --- /dev/null +++ b/db/post_migrate/20210921062820_add_image_location_index_to_vulnerability_occurrences.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddImageLocationIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_vulnerability_occurrences_on_location_image' + + def up + add_concurrent_index :vulnerability_occurrences, "(location -> 'image')", + using: 'GIN', + where: 'report_type IN (2, 7)', + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME + end +end diff --git a/db/post_migrate/20210922021816_drop_int4_columns_for_ci_job_artifacts.rb b/db/post_migrate/20210922021816_drop_int4_columns_for_ci_job_artifacts.rb new file mode 100644 index 00000000000..e45d6ed34aa --- /dev/null +++ b/db/post_migrate/20210922021816_drop_int4_columns_for_ci_job_artifacts.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class DropInt4ColumnsForCiJobArtifacts < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + remove_column :ci_job_artifacts, :id_convert_to_bigint, :integer, null: false, default: 0 + remove_column :ci_job_artifacts, :job_id_convert_to_bigint, :integer, null: false, default: 0 + end +end diff --git a/db/post_migrate/20210922025631_drop_int4_column_for_ci_sources_pipelines.rb b/db/post_migrate/20210922025631_drop_int4_column_for_ci_sources_pipelines.rb new file mode 100644 index 00000000000..b25f1d88736 --- /dev/null +++ b/db/post_migrate/20210922025631_drop_int4_column_for_ci_sources_pipelines.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class DropInt4ColumnForCiSourcesPipelines < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + remove_column :ci_sources_pipelines, :source_job_id_convert_to_bigint, :integer + end +end diff --git a/db/post_migrate/20210922082019_drop_int4_column_for_events.rb b/db/post_migrate/20210922082019_drop_int4_column_for_events.rb new file mode 100644 index 00000000000..a34d54e11e3 --- /dev/null +++ b/db/post_migrate/20210922082019_drop_int4_column_for_events.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class DropInt4ColumnForEvents < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + remove_column :events, :id_convert_to_bigint, :integer, null: false, default: 0 + end +end diff --git a/db/post_migrate/20210922084115_concurrent_index_resource_group_status_commit_id_for_ci_builds.rb b/db/post_migrate/20210922084115_concurrent_index_resource_group_status_commit_id_for_ci_builds.rb new file mode 100644 index 00000000000..922a9b64b55 --- /dev/null +++ b/db/post_migrate/20210922084115_concurrent_index_resource_group_status_commit_id_for_ci_builds.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class ConcurrentIndexResourceGroupStatusCommitIdForCiBuilds < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_ci_builds_on_resource_group_and_status_and_commit_id' + + disable_ddl_transaction! + + # Indexes were pre-created on gitlab.com to avoid slowing down deployments + # See: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/70279 + + # rubocop: disable Migration/PreventIndexCreation + def up + add_concurrent_index :ci_builds, [:resource_group_id, :status, :commit_id], + where: 'resource_group_id IS NOT NULL', + name: INDEX_NAME + end + # rubocop: enable Migration/PreventIndexCreation + + def down + remove_concurrent_index_by_name :ci_builds, INDEX_NAME + end +end diff --git a/db/post_migrate/20210922091402_drop_int4_column_for_push_event_payloads.rb b/db/post_migrate/20210922091402_drop_int4_column_for_push_event_payloads.rb new file mode 100644 index 00000000000..5e30ddacc98 --- /dev/null +++ b/db/post_migrate/20210922091402_drop_int4_column_for_push_event_payloads.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class DropInt4ColumnForPushEventPayloads < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + remove_column :push_event_payloads, :event_id_convert_to_bigint, :integer, null: false, default: 0 + end +end diff --git a/db/post_migrate/20210923133143_remove_redundant_taggings_index.rb b/db/post_migrate/20210923133143_remove_redundant_taggings_index.rb new file mode 100644 index 00000000000..a33885cc87b --- /dev/null +++ b/db/post_migrate/20210923133143_remove_redundant_taggings_index.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveRedundantTaggingsIndex < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = :index_taggings_on_taggable_id_and_taggable_type + + def up + remove_concurrent_index_by_name :taggings, INDEX_NAME + end + + def down + add_concurrent_index :taggings, [:taggable_id, :taggable_type], name: INDEX_NAME + end +end diff --git a/db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb b/db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb new file mode 100644 index 00000000000..531410a91d9 --- /dev/null +++ b/db/post_migrate/20210923135909_remove_delayed_project_removal_from_namespaces.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveDelayedProjectRemovalFromNamespaces < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_column :namespaces, :delayed_project_removal + end + end + + def down + with_lock_retries do + add_column :namespaces, :delayed_project_removal, :boolean, default: false, null: false, if_not_exists: true # rubocop:disable Migration/AddColumnsToWideTables + end + + add_concurrent_index :namespaces, :id, name: 'tmp_idx_on_namespaces_delayed_project_removal', where: 'delayed_project_removal = TRUE' + end +end diff --git a/db/post_migrate/20210927153807_update_issues_relative_position_indexes.rb b/db/post_migrate/20210927153807_update_issues_relative_position_indexes.rb new file mode 100644 index 00000000000..c7b0c7c6d14 --- /dev/null +++ b/db/post_migrate/20210927153807_update_issues_relative_position_indexes.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class UpdateIssuesRelativePositionIndexes < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + RELATIVE_POSITION_INDEX_NAME = 'idx_issues_on_project_id_and_rel_asc_and_id' + RELATIVE_POSITION_STATE_INDEX_NAME = 'idx_issues_on_project_id_and_rel_position_and_state_id_and_id' + + NEW_RELATIVE_POSITION_STATE_INDEX_NAME = 'idx_issues_on_project_id_and_rel_position_and_id_and_state_id' + + def up + add_concurrent_index :issues, [:project_id, :relative_position, :id, :state_id], name: NEW_RELATIVE_POSITION_STATE_INDEX_NAME + + remove_concurrent_index_by_name :issues, RELATIVE_POSITION_INDEX_NAME + remove_concurrent_index_by_name :issues, RELATIVE_POSITION_STATE_INDEX_NAME + end + + def down + add_concurrent_index :issues, [:project_id, :relative_position, :state_id, :id], order: { id: :desc }, name: RELATIVE_POSITION_STATE_INDEX_NAME + add_concurrent_index :issues, [:project_id, :relative_position, :id], name: RELATIVE_POSITION_INDEX_NAME + + remove_concurrent_index_by_name :issues, NEW_RELATIVE_POSITION_STATE_INDEX_NAME + end +end diff --git a/db/post_migrate/20211004110500_add_temporary_index_to_issue_metrics.rb b/db/post_migrate/20211004110500_add_temporary_index_to_issue_metrics.rb new file mode 100644 index 00000000000..cfc37c55121 --- /dev/null +++ b/db/post_migrate/20211004110500_add_temporary_index_to_issue_metrics.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddTemporaryIndexToIssueMetrics < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_issue_metrics_first_mentioned_in_commit' + + def up + add_concurrent_index :issue_metrics, :issue_id, where: 'EXTRACT(YEAR FROM first_mentioned_in_commit_at) > 2019', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :issue_metrics, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20211004110927_schedule_fix_first_mentioned_in_commit_at_job.rb b/db/post_migrate/20211004110927_schedule_fix_first_mentioned_in_commit_at_job.rb new file mode 100644 index 00000000000..c7612db3aaf --- /dev/null +++ b/db/post_migrate/20211004110927_schedule_fix_first_mentioned_in_commit_at_job.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class ScheduleFixFirstMentionedInCommitAtJob < Gitlab::Database::Migration[1.0] + MIGRATION = 'FixFirstMentionedInCommitAt' + BATCH_SIZE = 10_000 + INTERVAL = 2.minutes.to_i + + disable_ddl_transaction! + + def up + scope = define_batchable_model('issue_metrics') + .where('EXTRACT(YEAR FROM first_mentioned_in_commit_at) > 2019') + + queue_background_migration_jobs_by_range_at_intervals( + scope, + MIGRATION, + INTERVAL, + batch_size: BATCH_SIZE, + track_jobs: true, + primary_column_name: :issue_id + ) + end + + def down + # noop + end +end diff --git a/db/post_migrate/20211004151202_remove_bio_html_from_user_details.rb b/db/post_migrate/20211004151202_remove_bio_html_from_user_details.rb new file mode 100644 index 00000000000..d82589efc90 --- /dev/null +++ b/db/post_migrate/20211004151202_remove_bio_html_from_user_details.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class RemoveBioHtmlFromUserDetails < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + remove_column :user_details, :bio_html, :text, null: true + remove_column :user_details, :cached_markdown_version, :integer, null: true + end +end diff --git a/db/post_migrate/20211005010101_rereschedule_delete_orphaned_deployments.rb b/db/post_migrate/20211005010101_rereschedule_delete_orphaned_deployments.rb new file mode 100644 index 00000000000..f49a0fe2f56 --- /dev/null +++ b/db/post_migrate/20211005010101_rereschedule_delete_orphaned_deployments.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class RerescheduleDeleteOrphanedDeployments < Gitlab::Database::Migration[1.0] + MIGRATION = 'DeleteOrphanedDeployments' + DELAY_INTERVAL = 2.minutes + + disable_ddl_transaction! + + # This is the third time to schedule `DeleteOrphanedDeployments` migration. + # The first time failed by an inappropriate batch size and the second time failed by a retry bug. + # Since there is no issue in this migration itself, we can simply requeue the + # migration jobs **without** no-op-ing the previous migration. + # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69051#note_669230405 for more information. + def up + delete_queued_jobs(MIGRATION) + + requeue_background_migration_jobs_by_range_at_intervals(MIGRATION, DELAY_INTERVAL) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20211005083015_recreate_index_security_ci_builds_on_name_and_id_parser_features.rb b/db/post_migrate/20211005083015_recreate_index_security_ci_builds_on_name_and_id_parser_features.rb new file mode 100644 index 00000000000..9887752618d --- /dev/null +++ b/db/post_migrate/20211005083015_recreate_index_security_ci_builds_on_name_and_id_parser_features.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class RecreateIndexSecurityCiBuildsOnNameAndIdParserFeatures < Gitlab::Database::Migration[1.0] + TABLE = "ci_builds" + OLD_INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features" + NEW_INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features_broken" + COLUMNS = %i[name id] + CONSTRAINTS = "(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, + 'secret_detection'::character varying::text, + 'coverage_fuzzing'::character varying::text, + 'license_scanning'::character varying::text]) + ) AND type::text = 'Ci::Build'::text" + + enable_lock_retries! + + def up + rename_index(TABLE, OLD_INDEX_NAME, NEW_INDEX_NAME) + prepare_async_index TABLE, COLUMNS, name: OLD_INDEX_NAME, where: CONSTRAINTS + end + + def down + unprepare_async_index TABLE, COLUMNS, name: OLD_INDEX_NAME + rename_index(TABLE, NEW_INDEX_NAME, OLD_INDEX_NAME) + end +end diff --git a/db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb b/db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb new file mode 100644 index 00000000000..b14a9ab88b9 --- /dev/null +++ b/db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class SchedulePopulateTopicsTotalProjectsCountCache < Gitlab::Database::Migration[1.0] + MIGRATION = 'PopulateTopicsTotalProjectsCountCache' + BATCH_SIZE = 10_000 + DELAY_INTERVAL = 2.minutes + + disable_ddl_transaction! + + def up + queue_background_migration_jobs_by_range_at_intervals( + define_batchable_model('topics'), + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE, + track_jobs: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20211006145004_finalize_indexes_for_ci_job_artifacts_expire_at_unlocked.rb b/db/post_migrate/20211006145004_finalize_indexes_for_ci_job_artifacts_expire_at_unlocked.rb new file mode 100644 index 00000000000..b046ab6ab03 --- /dev/null +++ b/db/post_migrate/20211006145004_finalize_indexes_for_ci_job_artifacts_expire_at_unlocked.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class FinalizeIndexesForCiJobArtifactsExpireAtUnlocked < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + TABLE_NAME = 'ci_job_artifacts' + INDEX_NAME = 'ci_job_artifacts_expire_at_unlocked_idx' + + def up + add_concurrent_index TABLE_NAME, [:expire_at], where: 'locked = 0', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end +end diff --git a/db/post_migrate/20211006174114_add_namespace_index_on_type_sync.rb b/db/post_migrate/20211006174114_add_namespace_index_on_type_sync.rb new file mode 100644 index 00000000000..0185e4cbc5e --- /dev/null +++ b/db/post_migrate/20211006174114_add_namespace_index_on_type_sync.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class AddNamespaceIndexOnTypeSync < Gitlab::Database::Migration[1.0] + FULL_INDEX_NAME = 'index_namespaces_on_type_and_id' + PARTIAL_INDEX_NAME = 'index_namespaces_on_type_and_id_partial' + + disable_ddl_transaction! + + def up + add_concurrent_index :namespaces, [:type, :id], name: FULL_INDEX_NAME + + remove_concurrent_index_by_name :namespaces, name: PARTIAL_INDEX_NAME + end + + def down + add_concurrent_index(:namespaces, [:type, :id], where: 'type IS NOT NULL', name: PARTIAL_INDEX_NAME) + + remove_concurrent_index_by_name :namespaces, name: FULL_INDEX_NAME + end +end diff --git a/db/post_migrate/20211007093340_remove_analytics_snapshots_segment_id_column.rb b/db/post_migrate/20211007093340_remove_analytics_snapshots_segment_id_column.rb new file mode 100644 index 00000000000..df0b8ef2a94 --- /dev/null +++ b/db/post_migrate/20211007093340_remove_analytics_snapshots_segment_id_column.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveAnalyticsSnapshotsSegmentIdColumn < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + remove_column :analytics_devops_adoption_snapshots, :segment_id + end + + def down + add_column :analytics_devops_adoption_snapshots, :segment_id, :bigint, after: :id + add_concurrent_foreign_key :analytics_devops_adoption_snapshots, :analytics_devops_adoption_segments, + column: :segment_id, name: 'fk_rails_25da9a92c0', on_delete: :cascade + add_concurrent_index :analytics_devops_adoption_snapshots, [:segment_id, :end_time], name: :index_on_snapshots_segment_id_end_time + add_concurrent_index :analytics_devops_adoption_snapshots, [:segment_id, :recorded_at], name: :index_on_snapshots_segment_id_recorded_at + end +end diff --git a/db/post_migrate/20211007155221_schedule_populate_status_column_of_security_scans.rb b/db/post_migrate/20211007155221_schedule_populate_status_column_of_security_scans.rb new file mode 100644 index 00000000000..03032dfbb0a --- /dev/null +++ b/db/post_migrate/20211007155221_schedule_populate_status_column_of_security_scans.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class SchedulePopulateStatusColumnOfSecurityScans < Gitlab::Database::Migration[1.0] + MIGRATION = 'PopulateStatusColumnOfSecurityScans' + BATCH_SIZE = 10_000 + DELAY_INTERVAL = 2.minutes + + disable_ddl_transaction! + + def up + return unless Gitlab.ee? + + queue_background_migration_jobs_by_range_at_intervals( + define_batchable_model('security_scans'), + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20211011152701_cleanup_delete_orphaned_deployments_background_migration.rb b/db/post_migrate/20211011152701_cleanup_delete_orphaned_deployments_background_migration.rb new file mode 100644 index 00000000000..82a0b1ac9c8 --- /dev/null +++ b/db/post_migrate/20211011152701_cleanup_delete_orphaned_deployments_background_migration.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CleanupDeleteOrphanedDeploymentsBackgroundMigration < Gitlab::Database::Migration[1.0] + MIGRATION = 'DeleteOrphanedDeployments' + + disable_ddl_transaction! + + def up + finalize_background_migration(MIGRATION) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20211012155931_remove_schedule_and_status_from_pending_alert_escalations.rb b/db/post_migrate/20211012155931_remove_schedule_and_status_from_pending_alert_escalations.rb new file mode 100644 index 00000000000..e895ab6b9a0 --- /dev/null +++ b/db/post_migrate/20211012155931_remove_schedule_and_status_from_pending_alert_escalations.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class RemoveScheduleAndStatusFromPendingAlertEscalations < Gitlab::Database::Migration[1.0] + include Gitlab::Database::PartitioningMigrationHelpers + + disable_ddl_transaction! + + ESCALATIONS_TABLE = :incident_management_pending_alert_escalations + SCHEDULES_TABLE = :incident_management_oncall_schedules + INDEX_NAME = 'index_incident_management_pending_alert_escalations_on_schedule' + CONSTRAINT_NAME = 'fk_rails_fcbfd9338b' + + def up + with_lock_retries do + remove_column ESCALATIONS_TABLE, :schedule_id + remove_column ESCALATIONS_TABLE, :status + end + end + + def down + with_lock_retries do + add_column ESCALATIONS_TABLE, :schedule_id, :bigint unless column_exists?(ESCALATIONS_TABLE, :schedule_id) + add_column ESCALATIONS_TABLE, :status, :smallint unless column_exists?(ESCALATIONS_TABLE, :status) + end + + add_concurrent_partitioned_index ESCALATIONS_TABLE, :schedule_id, name: INDEX_NAME + add_concurrent_partitioned_foreign_key ESCALATIONS_TABLE, SCHEDULES_TABLE, column: :schedule_id, name: CONSTRAINT_NAME + 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/db/schema_migrations/20210819185500 b/db/schema_migrations/20210819185500 new file mode 100644 index 00000000000..1f92c1d81a9 --- /dev/null +++ b/db/schema_migrations/20210819185500 @@ -0,0 +1 @@ +eab87cb4abfad7542fcff7c25d984e4a7588c824a13b379cb16c87d0c077cfbb
\ No newline at end of file diff --git a/db/schema_migrations/20210906130643 b/db/schema_migrations/20210906130643 new file mode 100644 index 00000000000..150e594026d --- /dev/null +++ b/db/schema_migrations/20210906130643 @@ -0,0 +1 @@ +c707c0879e439de95f24f8fe2084388276a46c5e0ee30e4134a43e22ca19b4ec
\ No newline at end of file diff --git a/db/schema_migrations/20210907013944 b/db/schema_migrations/20210907013944 new file mode 100644 index 00000000000..97cf6ef7b2f --- /dev/null +++ b/db/schema_migrations/20210907013944 @@ -0,0 +1 @@ +1a449d347248cacae48d10340c5682abe6de57d2991712f4e0a39c921892e0c5
\ No newline at end of file diff --git a/db/schema_migrations/20210908195506 b/db/schema_migrations/20210908195506 new file mode 100644 index 00000000000..8680c7639d0 --- /dev/null +++ b/db/schema_migrations/20210908195506 @@ -0,0 +1 @@ +1ad794ac96f6297203046562c2ec422fbb4d1818a65266bb92179096040f7d82
\ No newline at end of file diff --git a/db/schema_migrations/20210910014741 b/db/schema_migrations/20210910014741 new file mode 100644 index 00000000000..b0f32fcabf3 --- /dev/null +++ b/db/schema_migrations/20210910014741 @@ -0,0 +1 @@ +e6342d440d398980470f4dd018c5df56d0b5d4df11caa7ba5dd2e92578dbf678
\ No newline at end of file diff --git a/db/schema_migrations/20210910015047 b/db/schema_migrations/20210910015047 new file mode 100644 index 00000000000..3f76060a9bb --- /dev/null +++ b/db/schema_migrations/20210910015047 @@ -0,0 +1 @@ +d0b2ee97781a5d3c671b855fb6be844431a73584be47ba35d83c7e8cfec69bcb
\ No newline at end of file diff --git a/db/schema_migrations/20210910192921 b/db/schema_migrations/20210910192921 new file mode 100644 index 00000000000..d593bca14ac --- /dev/null +++ b/db/schema_migrations/20210910192921 @@ -0,0 +1 @@ +48b5f8e614117ac5f1e7af4ab85a8835c3b3b34103154565dd7ef6f541dd3c37
\ No newline at end of file diff --git a/db/schema_migrations/20210910194952 b/db/schema_migrations/20210910194952 new file mode 100644 index 00000000000..2af73174c34 --- /dev/null +++ b/db/schema_migrations/20210910194952 @@ -0,0 +1 @@ +b805a0d3143f968343694ec864b38ba4991931131e8a5082dcd719420328a3ef
\ No newline at end of file diff --git a/db/schema_migrations/20210912034903 b/db/schema_migrations/20210912034903 new file mode 100644 index 00000000000..8003a5b110c --- /dev/null +++ b/db/schema_migrations/20210912034903 @@ -0,0 +1 @@ +76bfbf3f12fed895c3cfb891080b5a452d1204c83ce96736048f857b33458ad1
\ No newline at end of file diff --git a/db/schema_migrations/20210913224558 b/db/schema_migrations/20210913224558 new file mode 100644 index 00000000000..f2fb4eaeb71 --- /dev/null +++ b/db/schema_migrations/20210913224558 @@ -0,0 +1 @@ +377af41414793d7e52ffbb1fd60f2f19c58cd63bb0e85192983b5bfe98515ae8
\ No newline at end of file diff --git a/db/schema_migrations/20210914145810 b/db/schema_migrations/20210914145810 new file mode 100644 index 00000000000..1c2cdc8cbf2 --- /dev/null +++ b/db/schema_migrations/20210914145810 @@ -0,0 +1 @@ +a30acb6d2a3772be29dfefc7d8cda2f2df94002556fa5de85483b7fca245be86
\ No newline at end of file diff --git a/db/schema_migrations/20210914172202 b/db/schema_migrations/20210914172202 new file mode 100644 index 00000000000..2f7531b98aa --- /dev/null +++ b/db/schema_migrations/20210914172202 @@ -0,0 +1 @@ +2ab67d4cc17d0fdf01b5861a46d6ec51d1e76e7e88209b0964a884edd22cc63d
\ No newline at end of file diff --git a/db/schema_migrations/20210915000453 b/db/schema_migrations/20210915000453 new file mode 100644 index 00000000000..611af2b1310 --- /dev/null +++ b/db/schema_migrations/20210915000453 @@ -0,0 +1 @@ +ffb4e066420e1492550255e5866df6dc9f83d3d6cec9033284c4c3194d53b827
\ No newline at end of file diff --git a/db/schema_migrations/20210915001242 b/db/schema_migrations/20210915001242 new file mode 100644 index 00000000000..7aa9b5c5787 --- /dev/null +++ b/db/schema_migrations/20210915001242 @@ -0,0 +1 @@ +fc8f86f794d77902fd86acaec6046b65821ff685f841d28158dc05fb55773c16
\ No newline at end of file diff --git a/db/schema_migrations/20210915022415 b/db/schema_migrations/20210915022415 new file mode 100644 index 00000000000..ab3ca284269 --- /dev/null +++ b/db/schema_migrations/20210915022415 @@ -0,0 +1 @@ +ecb73d9a0be0cf04a8b405f1225d1a5de2fcdbb4c277fd5549f72a7a21596cdc
\ No newline at end of file diff --git a/db/schema_migrations/20210915070423 b/db/schema_migrations/20210915070423 new file mode 100644 index 00000000000..772226db1dd --- /dev/null +++ b/db/schema_migrations/20210915070423 @@ -0,0 +1 @@ +f11b237fab6b4133c73f1d6105d85c8db1548b6d0753b2fd96f613c90a4fa3c1
\ No newline at end of file diff --git a/db/schema_migrations/20210916132547 b/db/schema_migrations/20210916132547 new file mode 100644 index 00000000000..69932a531d9 --- /dev/null +++ b/db/schema_migrations/20210916132547 @@ -0,0 +1 @@ +d0953fdbaa6cf656e298ea482b3e3f931254276cb2285cffafba3d94b0626d3f
\ No newline at end of file diff --git a/db/schema_migrations/20210917134321 b/db/schema_migrations/20210917134321 new file mode 100644 index 00000000000..3c5c397ecbf --- /dev/null +++ b/db/schema_migrations/20210917134321 @@ -0,0 +1 @@ +a0ba9fb9e2f7f738926a2273f9ff644c43acb999f4d27adf192e5006582a2a0e
\ No newline at end of file diff --git a/db/schema_migrations/20210917153645 b/db/schema_migrations/20210917153645 new file mode 100644 index 00000000000..483c6153a24 --- /dev/null +++ b/db/schema_migrations/20210917153645 @@ -0,0 +1 @@ +fb4c7ce2ed33b3843fbaaf34ea6dbb6db52776039db62b0ab0bb880744f615d1
\ No newline at end of file diff --git a/db/schema_migrations/20210917153905 b/db/schema_migrations/20210917153905 new file mode 100644 index 00000000000..a4e424dfad3 --- /dev/null +++ b/db/schema_migrations/20210917153905 @@ -0,0 +1 @@ +3f0ac2bbfdfe6a2c05043e02ec383bdc7787f86741d6b2df7da2cc6a7aef9ce3
\ No newline at end of file diff --git a/db/schema_migrations/20210917224419 b/db/schema_migrations/20210917224419 new file mode 100644 index 00000000000..a8b059e7b8d --- /dev/null +++ b/db/schema_migrations/20210917224419 @@ -0,0 +1 @@ +9204c844b22ad0d3a938ed908377c8baacdda038725a5cf105e4b11841c1ae21
\ No newline at end of file diff --git a/db/schema_migrations/20210918201050 b/db/schema_migrations/20210918201050 new file mode 100644 index 00000000000..9c8f28bd813 --- /dev/null +++ b/db/schema_migrations/20210918201050 @@ -0,0 +1 @@ +596fd274ca1d0b2ce8698e048fea6080c9b777c48febb35a4917a6027826908e
\ No newline at end of file diff --git a/db/schema_migrations/20210918202855 b/db/schema_migrations/20210918202855 new file mode 100644 index 00000000000..f9d48eb269f --- /dev/null +++ b/db/schema_migrations/20210918202855 @@ -0,0 +1 @@ +a735ae13c13f5492a5c16d3e60884b60c44d1d57f6aaacaea13f3b1bf00a8d78
\ No newline at end of file diff --git a/db/schema_migrations/20210920104446 b/db/schema_migrations/20210920104446 new file mode 100644 index 00000000000..4687dca7d3c --- /dev/null +++ b/db/schema_migrations/20210920104446 @@ -0,0 +1 @@ +e7e9b13874081a7df42d07ccc9a54fb81973210d1c175cd995300f6339d57495
\ No newline at end of file diff --git a/db/schema_migrations/20210920232025 b/db/schema_migrations/20210920232025 new file mode 100644 index 00000000000..1c5b248981f --- /dev/null +++ b/db/schema_migrations/20210920232025 @@ -0,0 +1 @@ +12dfb473067fc836cd435474405c3ca978d159a13e975f7663fe22c078731fd1
\ No newline at end of file diff --git a/db/schema_migrations/20210921032008 b/db/schema_migrations/20210921032008 new file mode 100644 index 00000000000..058a4366e4a --- /dev/null +++ b/db/schema_migrations/20210921032008 @@ -0,0 +1 @@ +262127539fc16715a56e2cf7426f0f8d24922e26847a01a0a15552d71cd148f8
\ No newline at end of file diff --git a/db/schema_migrations/20210921062820 b/db/schema_migrations/20210921062820 new file mode 100644 index 00000000000..0f83c4cb322 --- /dev/null +++ b/db/schema_migrations/20210921062820 @@ -0,0 +1 @@ +ae98a673b649faf8644990de328470579e121544d4fc417562cc64a7687550ca
\ No newline at end of file diff --git a/db/schema_migrations/20210921063924 b/db/schema_migrations/20210921063924 new file mode 100644 index 00000000000..ed849aa174c --- /dev/null +++ b/db/schema_migrations/20210921063924 @@ -0,0 +1 @@ +4430d4e0d688c85768201ab09056d60151fdc949b4b5f4ebc5397a99b9ec5f83
\ No newline at end of file diff --git a/db/schema_migrations/20210921191010 b/db/schema_migrations/20210921191010 new file mode 100644 index 00000000000..c01a8f41437 --- /dev/null +++ b/db/schema_migrations/20210921191010 @@ -0,0 +1 @@ +8fa4dbfc075036ca379f153e97b7afd2b7600d129f7fb5294dcf4574be9dd7d1
\ No newline at end of file diff --git a/db/schema_migrations/20210922021816 b/db/schema_migrations/20210922021816 new file mode 100644 index 00000000000..8286647353d --- /dev/null +++ b/db/schema_migrations/20210922021816 @@ -0,0 +1 @@ +1d18e061cb5bcdaa7d3fcea93e58d65a6f2c8b557fe53ba461b6cfa570f565be
\ No newline at end of file diff --git a/db/schema_migrations/20210922025631 b/db/schema_migrations/20210922025631 new file mode 100644 index 00000000000..217c1d9da25 --- /dev/null +++ b/db/schema_migrations/20210922025631 @@ -0,0 +1 @@ +43b02083323765888f019386138e8fbaa3182d74bd5e8790d6fae6ea6f0a2104
\ No newline at end of file diff --git a/db/schema_migrations/20210922082019 b/db/schema_migrations/20210922082019 new file mode 100644 index 00000000000..c987f19e595 --- /dev/null +++ b/db/schema_migrations/20210922082019 @@ -0,0 +1 @@ +011b714ee5d4389a5a172ae687eea3a814915fb39a5e5eae38b6ee423a903eaf
\ No newline at end of file diff --git a/db/schema_migrations/20210922084115 b/db/schema_migrations/20210922084115 new file mode 100644 index 00000000000..7870576c40e --- /dev/null +++ b/db/schema_migrations/20210922084115 @@ -0,0 +1 @@ +6401de932d87b684c8a00254231312f8633c66a8ea96670b2761442c771d3d7f
\ No newline at end of file diff --git a/db/schema_migrations/20210922091402 b/db/schema_migrations/20210922091402 new file mode 100644 index 00000000000..cb8e307e928 --- /dev/null +++ b/db/schema_migrations/20210922091402 @@ -0,0 +1 @@ +4f3a1dbf39f1955122f94616952bfe04836c43e97268035b2daec3bc16e55e66
\ No newline at end of file diff --git a/db/schema_migrations/20210922172056 b/db/schema_migrations/20210922172056 new file mode 100644 index 00000000000..834280df2a8 --- /dev/null +++ b/db/schema_migrations/20210922172056 @@ -0,0 +1 @@ +c50ccd9986188356776c2d19c5544a6da6e31b5bb1b16ed259455604cb6fd862
\ No newline at end of file diff --git a/db/schema_migrations/20210922172156 b/db/schema_migrations/20210922172156 new file mode 100644 index 00000000000..06852710217 --- /dev/null +++ b/db/schema_migrations/20210922172156 @@ -0,0 +1 @@ +083b18b8e687ae8ff9d93ee77c6d4fc2916a2f1b77acf44132f216236b0ff06c
\ No newline at end of file diff --git a/db/schema_migrations/20210922215740 b/db/schema_migrations/20210922215740 new file mode 100644 index 00000000000..b7fdf9b4dfe --- /dev/null +++ b/db/schema_migrations/20210922215740 @@ -0,0 +1 @@ +7b343a5e1fd2600585d8fe4ef7585f91fb4c72da329b6f9474384f7217381d12
\ No newline at end of file diff --git a/db/schema_migrations/20210922220104 b/db/schema_migrations/20210922220104 new file mode 100644 index 00000000000..0cacca67f8f --- /dev/null +++ b/db/schema_migrations/20210922220104 @@ -0,0 +1 @@ +ced8a8373bdbf07b2be23701f243f3a9f338776eeaec0a6c4e5cc0e68572a16e
\ No newline at end of file diff --git a/db/schema_migrations/20210923042323 b/db/schema_migrations/20210923042323 new file mode 100644 index 00000000000..944cb833939 --- /dev/null +++ b/db/schema_migrations/20210923042323 @@ -0,0 +1 @@ +7b08303dae62fe9b9b5081221a6aa4bd6b687e0206e78e4b8a6f5964bc42b344
\ No newline at end of file diff --git a/db/schema_migrations/20210923042324 b/db/schema_migrations/20210923042324 new file mode 100644 index 00000000000..445a6db0351 --- /dev/null +++ b/db/schema_migrations/20210923042324 @@ -0,0 +1 @@ +52785c2791be5c17517335496e7cabd99fba1a82e82d8c783703bd68f8b40163
\ No newline at end of file diff --git a/db/schema_migrations/20210923042325 b/db/schema_migrations/20210923042325 new file mode 100644 index 00000000000..a89582ef187 --- /dev/null +++ b/db/schema_migrations/20210923042325 @@ -0,0 +1 @@ +f253f2bd5643f8cf72f020e5ba5237506833dee84aa98828166d8ad1570f925f
\ No newline at end of file diff --git a/db/schema_migrations/20210923133143 b/db/schema_migrations/20210923133143 new file mode 100644 index 00000000000..c0e7bb485fb --- /dev/null +++ b/db/schema_migrations/20210923133143 @@ -0,0 +1 @@ +d2736a06009d6232d832a03d6842a81b1de2ce79b901331a0e09ac40fc51a463
\ No newline at end of file diff --git a/db/schema_migrations/20210923135909 b/db/schema_migrations/20210923135909 new file mode 100644 index 00000000000..b7b1ecc6bf2 --- /dev/null +++ b/db/schema_migrations/20210923135909 @@ -0,0 +1 @@ +2afb8292fcdf9a56c11d9404275ffecfde4b2a474e733e3e19f4db62c628aa6c
\ No newline at end of file diff --git a/db/schema_migrations/20210923151641 b/db/schema_migrations/20210923151641 new file mode 100644 index 00000000000..bd38d8c6a28 --- /dev/null +++ b/db/schema_migrations/20210923151641 @@ -0,0 +1 @@ +30c135ab62a57208160dd0949d6615f42af39117e25769d70a9658de5417b7e4
\ No newline at end of file diff --git a/db/schema_migrations/20210927153807 b/db/schema_migrations/20210927153807 new file mode 100644 index 00000000000..c6a675e380b --- /dev/null +++ b/db/schema_migrations/20210927153807 @@ -0,0 +1 @@ +8e54f43a955023e422bf40476f468fbdf04f06e806b08fddf35208c65607fec3
\ No newline at end of file diff --git a/db/schema_migrations/20210928155022 b/db/schema_migrations/20210928155022 new file mode 100644 index 00000000000..d953746413a --- /dev/null +++ b/db/schema_migrations/20210928155022 @@ -0,0 +1 @@ +41ea0971cd62ba43bf98c1901169e7bb8fcebe68025d947f26b0ccf6806c976e
\ No newline at end of file diff --git a/db/schema_migrations/20210928171122 b/db/schema_migrations/20210928171122 new file mode 100644 index 00000000000..ccddd09345b --- /dev/null +++ b/db/schema_migrations/20210928171122 @@ -0,0 +1 @@ +f257ff9896e2d90ced39c2c010df1d4b74badae046651a190585c9c47342d119
\ No newline at end of file diff --git a/db/schema_migrations/20210929025600 b/db/schema_migrations/20210929025600 new file mode 100644 index 00000000000..fb00216afac --- /dev/null +++ b/db/schema_migrations/20210929025600 @@ -0,0 +1 @@ +c757a7e17433b8ddf15ae6304286fe3da69f820966455e7fbed7282286f5eb67
\ No newline at end of file diff --git a/db/schema_migrations/20210929030834 b/db/schema_migrations/20210929030834 new file mode 100644 index 00000000000..a3dc19d0440 --- /dev/null +++ b/db/schema_migrations/20210929030834 @@ -0,0 +1 @@ +b5302b3a2384bd7d0e639f00941efb490c3121a9332f1e73be620ab0f6f3e771
\ No newline at end of file diff --git a/db/schema_migrations/20210929031049 b/db/schema_migrations/20210929031049 new file mode 100644 index 00000000000..19ba54b465a --- /dev/null +++ b/db/schema_migrations/20210929031049 @@ -0,0 +1 @@ +d3f588e4edded61f36acbf25fba39be17a2ac16f37e9114f2c5c257c47dc1308
\ No newline at end of file diff --git a/db/schema_migrations/20210929032555 b/db/schema_migrations/20210929032555 new file mode 100644 index 00000000000..779e6a63fe2 --- /dev/null +++ b/db/schema_migrations/20210929032555 @@ -0,0 +1 @@ +08593002910759482c58f9b31f251d589ab32b540d9614a2c677df11d32f7f26
\ No newline at end of file diff --git a/db/schema_migrations/20210929115340 b/db/schema_migrations/20210929115340 new file mode 100644 index 00000000000..2f6bf226e09 --- /dev/null +++ b/db/schema_migrations/20210929115340 @@ -0,0 +1 @@ +0de2844fdec43eca860648bdb1a5b184bcc0f79b51086b16d8ef398f32cfd5de
\ No newline at end of file diff --git a/db/schema_migrations/20210929121516 b/db/schema_migrations/20210929121516 new file mode 100644 index 00000000000..c42d39c9c34 --- /dev/null +++ b/db/schema_migrations/20210929121516 @@ -0,0 +1 @@ +432dc1f1e0280a79e4a6af56c2f2cb40c99edbc09e254b82b7f48c7c9217372b
\ No newline at end of file diff --git a/db/schema_migrations/20210930081208 b/db/schema_migrations/20210930081208 new file mode 100644 index 00000000000..a0c1d701717 --- /dev/null +++ b/db/schema_migrations/20210930081208 @@ -0,0 +1 @@ +4b2c1b8e80f481d2dbbcfcb61c0a3d3081cbe4081fdd710040a028d72bd5d0e4
\ No newline at end of file diff --git a/db/schema_migrations/20211001001222 b/db/schema_migrations/20211001001222 new file mode 100644 index 00000000000..2b0ebb346a9 --- /dev/null +++ b/db/schema_migrations/20211001001222 @@ -0,0 +1 @@ +23be5444bb11f731e98edc9b6aad814d02fd0f3f6be9abdea9060898cc2b95f1
\ No newline at end of file diff --git a/db/schema_migrations/20211004062942 b/db/schema_migrations/20211004062942 new file mode 100644 index 00000000000..6ad1af289f7 --- /dev/null +++ b/db/schema_migrations/20211004062942 @@ -0,0 +1 @@ +95dcfdc6c03705b0db5e96d669051edf335b5d6501243f70588f9b73478116a6
\ No newline at end of file diff --git a/db/schema_migrations/20211004075629 b/db/schema_migrations/20211004075629 new file mode 100644 index 00000000000..d55f7370798 --- /dev/null +++ b/db/schema_migrations/20211004075629 @@ -0,0 +1 @@ +e035616201329b7610e8c3a647bc01c52ce722790ea7bb88d4a38bc0feb4737e
\ No newline at end of file diff --git a/db/schema_migrations/20211004081911 b/db/schema_migrations/20211004081911 new file mode 100644 index 00000000000..c849cb776d8 --- /dev/null +++ b/db/schema_migrations/20211004081911 @@ -0,0 +1 @@ +cc53e8c85fdb00c0772987516e0c23f5349cc6dc1e21b4124eb50efdaa6a4fcd
\ No newline at end of file diff --git a/db/schema_migrations/20211004110500 b/db/schema_migrations/20211004110500 new file mode 100644 index 00000000000..e22ed05de83 --- /dev/null +++ b/db/schema_migrations/20211004110500 @@ -0,0 +1 @@ +1b0b562aefb724afe24b8640a22013cea6fddd0e594d6723f6819f69804ba9f7
\ No newline at end of file diff --git a/db/schema_migrations/20211004110927 b/db/schema_migrations/20211004110927 new file mode 100644 index 00000000000..aa70a4aa0d8 --- /dev/null +++ b/db/schema_migrations/20211004110927 @@ -0,0 +1 @@ +50c937f979c83f6937364d92bf65ed42ef963f2d241eadcee6355c1b256c3ec9
\ No newline at end of file diff --git a/db/schema_migrations/20211004151202 b/db/schema_migrations/20211004151202 new file mode 100644 index 00000000000..f21ef531938 --- /dev/null +++ b/db/schema_migrations/20211004151202 @@ -0,0 +1 @@ +88f8e8391a480450a3d76d98f089e1e2287048007d0ecdcbd0799c9cc021481f
\ No newline at end of file diff --git a/db/schema_migrations/20211005010101 b/db/schema_migrations/20211005010101 new file mode 100644 index 00000000000..9789f36adea --- /dev/null +++ b/db/schema_migrations/20211005010101 @@ -0,0 +1 @@ +40e15593d9ee0fb5a59d1576c6da5a1eece265730f7ae15c5c81c2c5343b362c
\ No newline at end of file diff --git a/db/schema_migrations/20211005063519 b/db/schema_migrations/20211005063519 new file mode 100644 index 00000000000..d3450d4282a --- /dev/null +++ b/db/schema_migrations/20211005063519 @@ -0,0 +1 @@ +e45163c2d0d691fb5deab86d024c4edb8e3cd350271418e1ff132c31e2ca90a3
\ No newline at end of file diff --git a/db/schema_migrations/20211005063616 b/db/schema_migrations/20211005063616 new file mode 100644 index 00000000000..030dfc12a68 --- /dev/null +++ b/db/schema_migrations/20211005063616 @@ -0,0 +1 @@ +20d35e9baae343bccbb67a25eacd7fdb4b32fd4cedd95e6f8f7a2933470350fb
\ No newline at end of file diff --git a/db/schema_migrations/20211005063723 b/db/schema_migrations/20211005063723 new file mode 100644 index 00000000000..b4d8c7a3f6e --- /dev/null +++ b/db/schema_migrations/20211005063723 @@ -0,0 +1 @@ +4659ab6d971b03d9b44dda72fe1b571c5050fd6892cb4f16f2ca1ced0905c1ce
\ No newline at end of file diff --git a/db/schema_migrations/20211005083015 b/db/schema_migrations/20211005083015 new file mode 100644 index 00000000000..0e5a20b824f --- /dev/null +++ b/db/schema_migrations/20211005083015 @@ -0,0 +1 @@ +37016ec5e5ab1bd8d2bd8020f98277b3ad9f450b833ce3ebde70aebce5130a26
\ No newline at end of file diff --git a/db/schema_migrations/20211005092428 b/db/schema_migrations/20211005092428 new file mode 100644 index 00000000000..0ac1a5f6ee6 --- /dev/null +++ b/db/schema_migrations/20211005092428 @@ -0,0 +1 @@ +43abb71ecc1f1b4e699af1258934884a06e4e4eb1445ec3cc7a2c6668f42f14a
\ No newline at end of file diff --git a/db/schema_migrations/20211005093558 b/db/schema_migrations/20211005093558 new file mode 100644 index 00000000000..943f905b497 --- /dev/null +++ b/db/schema_migrations/20211005093558 @@ -0,0 +1 @@ +16638e14f1920b2e615dcb14965b7ef2a16ead099e7f8b1cdad6dd75d6d45107
\ No newline at end of file diff --git a/db/schema_migrations/20211005100112 b/db/schema_migrations/20211005100112 new file mode 100644 index 00000000000..1f7a92ca316 --- /dev/null +++ b/db/schema_migrations/20211005100112 @@ -0,0 +1 @@ +196cd1cf84babb12e92830bf2b7a0315499fdb976f825d4913a506e744b4fd53
\ No newline at end of file diff --git a/db/schema_migrations/20211006060254 b/db/schema_migrations/20211006060254 new file mode 100644 index 00000000000..2891170a092 --- /dev/null +++ b/db/schema_migrations/20211006060254 @@ -0,0 +1 @@ +0d6ec7c1d96f32c645ddc051d8e3b3bd0ad759c52c8938888287b1c6b57d27a3
\ No newline at end of file diff --git a/db/schema_migrations/20211006060436 b/db/schema_migrations/20211006060436 new file mode 100644 index 00000000000..e2374c092c7 --- /dev/null +++ b/db/schema_migrations/20211006060436 @@ -0,0 +1 @@ +918852db691546e4e93a933789968115ac98b5757d480ed1e09118508e6024d5
\ No newline at end of file diff --git a/db/schema_migrations/20211006103122 b/db/schema_migrations/20211006103122 new file mode 100644 index 00000000000..4d2347702de --- /dev/null +++ b/db/schema_migrations/20211006103122 @@ -0,0 +1 @@ +1e29e4712d81aacf1178996c2dd9e82593be5a2311273800d91640d8eccd38ed
\ No newline at end of file diff --git a/db/schema_migrations/20211006122010 b/db/schema_migrations/20211006122010 new file mode 100644 index 00000000000..6758ab4978a --- /dev/null +++ b/db/schema_migrations/20211006122010 @@ -0,0 +1 @@ +19efbbf7aab5837e33ff72d87e101a76da7eeb1d60c05ffc0ceddad1d0cbc69c
\ No newline at end of file diff --git a/db/schema_migrations/20211006145004 b/db/schema_migrations/20211006145004 new file mode 100644 index 00000000000..6a99396d34a --- /dev/null +++ b/db/schema_migrations/20211006145004 @@ -0,0 +1 @@ +9fca672eaa0b82a37c211de35a4961b81fb163d290004907be7bf641327c65b1
\ No newline at end of file diff --git a/db/schema_migrations/20211006174114 b/db/schema_migrations/20211006174114 new file mode 100644 index 00000000000..1d015b78676 --- /dev/null +++ b/db/schema_migrations/20211006174114 @@ -0,0 +1 @@ +15d1bc08a87241b4217278ce8214f41d1d3c0cc4c26a3e659f395a602d139758
\ No newline at end of file diff --git a/db/schema_migrations/20211007093340 b/db/schema_migrations/20211007093340 new file mode 100644 index 00000000000..9b11d742548 --- /dev/null +++ b/db/schema_migrations/20211007093340 @@ -0,0 +1 @@ +fbb3092caba901ddd5a740bb67a91d1c8a4c458651afaf02704399844acbd2b8
\ No newline at end of file diff --git a/db/schema_migrations/20211007113136 b/db/schema_migrations/20211007113136 new file mode 100644 index 00000000000..dc245a3723b --- /dev/null +++ b/db/schema_migrations/20211007113136 @@ -0,0 +1 @@ +7abcc243cd02a4eba77ea39cbb1b1f2de74d85e55055def9ae02c4fdeaba3d9a
\ No newline at end of file diff --git a/db/schema_migrations/20211007155221 b/db/schema_migrations/20211007155221 new file mode 100644 index 00000000000..662668fe983 --- /dev/null +++ b/db/schema_migrations/20211007155221 @@ -0,0 +1 @@ +115427979cd7ecfc14bf4f663a9afd5abc6d481d08fafc13ca7e6a8cac9ba20c
\ No newline at end of file diff --git a/db/schema_migrations/20211008181451 b/db/schema_migrations/20211008181451 new file mode 100644 index 00000000000..1687056609f --- /dev/null +++ b/db/schema_migrations/20211008181451 @@ -0,0 +1 @@ +b4104ebb3d99100ed5b6831174af563ea7cda46428007e30219198b910313b05
\ No newline at end of file diff --git a/db/schema_migrations/20211008182954 b/db/schema_migrations/20211008182954 new file mode 100644 index 00000000000..e530f090840 --- /dev/null +++ b/db/schema_migrations/20211008182954 @@ -0,0 +1 @@ +d16b96a960e03e50135802885f5b8c44168d2413f3db1f53ac15389a33dddc61
\ No newline at end of file diff --git a/db/schema_migrations/20211011152701 b/db/schema_migrations/20211011152701 new file mode 100644 index 00000000000..fcd6f8ad953 --- /dev/null +++ b/db/schema_migrations/20211011152701 @@ -0,0 +1 @@ +5701681a1006584149c88da520f780b186ca32ba1facb8b952252c6d426b6c0d
\ No newline at end of file diff --git a/db/schema_migrations/20211012091822 b/db/schema_migrations/20211012091822 new file mode 100644 index 00000000000..09c198571af --- /dev/null +++ b/db/schema_migrations/20211012091822 @@ -0,0 +1 @@ +3482e5c12f1603cb67d24aee14f003345ef2a5c350c7dccafdea6554db04c4cc
\ No newline at end of file diff --git a/db/schema_migrations/20211012155931 b/db/schema_migrations/20211012155931 new file mode 100644 index 00000000000..1974e553fb7 --- /dev/null +++ b/db/schema_migrations/20211012155931 @@ -0,0 +1 @@ +0a9317419b856ba2abf3cad07c43ccfc79abfcd5efd02c464ee76f4debe362c8
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index d7e00112d73..d3882446f57 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -27,8 +27,8 @@ CREATE FUNCTION insert_into_loose_foreign_keys_deleted_records() RETURNS trigger AS $$ BEGIN INSERT INTO loose_foreign_keys_deleted_records - (deleted_table_name, deleted_table_primary_key_value) - SELECT TG_TABLE_NAME, old_table.id FROM old_table + (partition, fully_qualified_table_name, primary_key_value) + SELECT 1, TG_TABLE_SCHEMA || '.' || TG_TABLE_NAME, old_table.id FROM old_table ON CONFLICT DO NOTHING; RETURN NULL; @@ -77,34 +77,6 @@ RETURN NULL; END $$; -CREATE FUNCTION trigger_3f6129be01d2() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."id_convert_to_bigint" := NEW."id"; - NEW."stage_id_convert_to_bigint" := NEW."stage_id"; - RETURN NEW; -END; -$$; - -CREATE FUNCTION trigger_542d6c2ad72e() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."id_convert_to_bigint" := NEW."id"; - RETURN NEW; -END; -$$; - -CREATE FUNCTION trigger_8487d4de3e7b() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."build_id_convert_to_bigint" := NEW."build_id"; - RETURN NEW; -END; -$$; - CREATE FUNCTION trigger_91dc388a5fe6() RETURNS trigger LANGUAGE plpgsql AS $$ @@ -114,16 +86,6 @@ BEGIN END; $$; -CREATE FUNCTION trigger_aebe8b822ad3() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."id_convert_to_bigint" := NEW."id"; - NEW."taggable_id_convert_to_bigint" := NEW."taggable_id"; - RETURN NEW; -END; -$$; - CREATE TABLE audit_events ( id bigint NOT NULL, author_id integer NOT NULL, @@ -148,11 +110,9 @@ CREATE TABLE incident_management_pending_alert_escalations ( id bigint NOT NULL, rule_id bigint NOT NULL, alert_id bigint NOT NULL, - schedule_id bigint, process_at timestamp with time zone NOT NULL, created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - status smallint + updated_at timestamp with time zone NOT NULL ) PARTITION BY RANGE (process_at); @@ -166,14 +126,6 @@ CREATE TABLE incident_management_pending_issue_escalations ( ) PARTITION BY RANGE (process_at); -CREATE TABLE loose_foreign_keys_deleted_records ( - created_at timestamp with time zone DEFAULT now() NOT NULL, - deleted_table_name text NOT NULL, - deleted_table_primary_key_value bigint NOT NULL, - CONSTRAINT check_7229f9527e CHECK ((char_length(deleted_table_name) <= 63)) -) -PARTITION BY RANGE (created_at); - CREATE TABLE web_hook_logs ( id bigint NOT NULL, web_hook_id integer NOT NULL, @@ -983,6 +935,37 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st ); ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 FOR VALUES WITH (modulus 32, remainder 31); +CREATE TABLE loose_foreign_keys_deleted_records ( + id bigint NOT NULL, + partition bigint NOT NULL, + primary_key_value bigint NOT NULL, + status smallint DEFAULT 1 NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + fully_qualified_table_name text NOT NULL, + CONSTRAINT check_1a541f3235 CHECK ((char_length(fully_qualified_table_name) <= 150)) +) +PARTITION BY LIST (partition); + +CREATE SEQUENCE loose_foreign_keys_deleted_records_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE loose_foreign_keys_deleted_records_id_seq OWNED BY loose_foreign_keys_deleted_records.id; + +CREATE TABLE gitlab_partitions_static.loose_foreign_keys_deleted_records_1 ( + id bigint DEFAULT nextval('loose_foreign_keys_deleted_records_id_seq'::regclass) NOT NULL, + partition bigint NOT NULL, + primary_key_value bigint NOT NULL, + status smallint DEFAULT 1 NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + fully_qualified_table_name text NOT NULL, + CONSTRAINT check_1a541f3235 CHECK ((char_length(fully_qualified_table_name) <= 150)) +); +ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_static.loose_foreign_keys_deleted_records_1 FOR VALUES IN ('1'); + CREATE TABLE product_analytics_events_experimental ( id bigint NOT NULL, project_id integer NOT NULL, @@ -9927,7 +9910,6 @@ ALTER SEQUENCE analytics_devops_adoption_segments_id_seq OWNED BY analytics_devo CREATE TABLE analytics_devops_adoption_snapshots ( id bigint NOT NULL, - segment_id bigint, recorded_at timestamp with time zone NOT NULL, issue_opened boolean NOT NULL, merge_request_opened boolean NOT NULL, @@ -10375,7 +10357,16 @@ CREATE TABLE application_settings ( sidekiq_job_limiter_mode smallint DEFAULT 1 NOT NULL, sidekiq_job_limiter_compression_threshold_bytes integer DEFAULT 100000 NOT NULL, sidekiq_job_limiter_limit_bytes integer DEFAULT 0 NOT NULL, + suggest_pipeline_enabled boolean DEFAULT true NOT NULL, + throttle_unauthenticated_deprecated_api_requests_per_period integer DEFAULT 1800 NOT NULL, + throttle_unauthenticated_deprecated_api_period_in_seconds integer DEFAULT 3600 NOT NULL, + throttle_unauthenticated_deprecated_api_enabled boolean DEFAULT false NOT NULL, + throttle_authenticated_deprecated_api_requests_per_period integer DEFAULT 3600 NOT NULL, + throttle_authenticated_deprecated_api_period_in_seconds integer DEFAULT 3600 NOT NULL, + throttle_authenticated_deprecated_api_enabled boolean DEFAULT false NOT NULL, + dependency_proxy_ttl_group_policy_worker_capacity smallint DEFAULT 2 NOT NULL, CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)), + CONSTRAINT app_settings_dep_proxy_ttl_policies_worker_capacity_positive CHECK ((dependency_proxy_ttl_group_policy_worker_capacity >= 0)), CONSTRAINT app_settings_ext_pipeline_validation_service_url_text_limit CHECK ((char_length(external_pipeline_validation_service_url) <= 255)), CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)), CONSTRAINT app_settings_yaml_max_depth_positive CHECK ((max_yaml_depth > 0)), @@ -10499,7 +10490,8 @@ CREATE TABLE approval_project_rules ( rule_type smallint DEFAULT 0 NOT NULL, scanners text[], vulnerabilities_allowed smallint DEFAULT 0 NOT NULL, - severity_levels text[] DEFAULT '{}'::text[] NOT NULL + severity_levels text[] DEFAULT '{}'::text[] NOT NULL, + report_type smallint ); CREATE TABLE approval_project_rules_groups ( @@ -10632,6 +10624,24 @@ CREATE SEQUENCE atlassian_identities_user_id_seq ALTER SEQUENCE atlassian_identities_user_id_seq OWNED BY atlassian_identities.user_id; +CREATE TABLE audit_events_external_audit_event_destinations ( + id bigint NOT NULL, + namespace_id bigint NOT NULL, + destination_url text NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + CONSTRAINT check_2feafb9daf CHECK ((char_length(destination_url) <= 255)) +); + +CREATE SEQUENCE audit_events_external_audit_event_destinations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE audit_events_external_audit_event_destinations_id_seq OWNED BY audit_events_external_audit_event_destinations.id; + CREATE SEQUENCE audit_events_id_seq START WITH 1 INCREMENT BY 1 @@ -11203,7 +11213,9 @@ CREATE TABLE bulk_imports ( source_type smallint NOT NULL, status smallint NOT NULL, created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL + updated_at timestamp with time zone NOT NULL, + source_version text, + CONSTRAINT check_ea4e58775a CHECK ((char_length(source_version) <= 63)) ); CREATE SEQUENCE bulk_imports_id_seq @@ -11337,7 +11349,6 @@ CREATE TABLE ci_build_trace_metadata ( ); CREATE TABLE ci_builds ( - id_convert_to_bigint integer DEFAULT 0 NOT NULL, status character varying, finished_at timestamp without time zone, trace text, @@ -11372,7 +11383,6 @@ CREATE TABLE ci_builds ( coverage_regex character varying, auto_canceled_by_id integer, retried boolean, - stage_id_convert_to_bigint integer, protected boolean, failure_reason integer, scheduled_at timestamp with time zone, @@ -11397,8 +11407,6 @@ CREATE SEQUENCE ci_builds_id_seq ALTER SEQUENCE ci_builds_id_seq OWNED BY ci_builds.id; CREATE TABLE ci_builds_metadata ( - id_convert_to_bigint integer DEFAULT 0 NOT NULL, - build_id_convert_to_bigint integer DEFAULT 0 NOT NULL, project_id integer NOT NULL, timeout integer, timeout_source integer DEFAULT 1 NOT NULL, @@ -11410,7 +11418,8 @@ CREATE TABLE ci_builds_metadata ( expanded_environment_name character varying(255), secrets jsonb DEFAULT '{}'::jsonb NOT NULL, build_id bigint NOT NULL, - id bigint NOT NULL + id bigint NOT NULL, + runner_features jsonb DEFAULT '{}'::jsonb NOT NULL ); CREATE SEQUENCE ci_builds_metadata_id_seq @@ -11546,9 +11555,7 @@ CREATE SEQUENCE ci_instance_variables_id_seq ALTER SEQUENCE ci_instance_variables_id_seq OWNED BY ci_instance_variables.id; CREATE TABLE ci_job_artifacts ( - id_convert_to_bigint integer DEFAULT 0 NOT NULL, project_id integer NOT NULL, - job_id_convert_to_bigint integer DEFAULT 0 NOT NULL, file_type integer NOT NULL, size bigint, created_at timestamp with time zone NOT NULL, @@ -11637,6 +11644,7 @@ CREATE TABLE ci_namespace_monthly_usages ( additional_amount_available integer DEFAULT 0 NOT NULL, amount_used numeric(18,2) DEFAULT 0.0 NOT NULL, notification_level smallint DEFAULT 100 NOT NULL, + shared_runners_duration integer DEFAULT 0 NOT NULL, CONSTRAINT ci_namespace_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone))) ); @@ -11881,6 +11889,7 @@ CREATE TABLE ci_project_monthly_usages ( project_id bigint NOT NULL, date date NOT NULL, amount_used numeric(18,2) DEFAULT 0.0 NOT NULL, + shared_runners_duration integer DEFAULT 0 NOT NULL, CONSTRAINT ci_project_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone))) ); @@ -11915,7 +11924,8 @@ CREATE TABLE ci_resource_groups ( 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 + key character varying(255) NOT NULL, + process_mode smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_resource_groups_id_seq @@ -12033,7 +12043,6 @@ CREATE TABLE ci_sources_pipelines ( project_id integer, pipeline_id integer, source_project_id integer, - source_job_id_convert_to_bigint integer, source_pipeline_id integer, source_job_id bigint ); @@ -12757,6 +12766,25 @@ CREATE SEQUENCE conversational_development_index_metrics_id_seq ALTER SEQUENCE conversational_development_index_metrics_id_seq OWNED BY conversational_development_index_metrics.id; +CREATE TABLE coverage_fuzzing_corpuses ( + id bigint NOT NULL, + project_id bigint NOT NULL, + user_id bigint, + package_id bigint NOT NULL, + file_updated_at timestamp with time zone DEFAULT now() NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE coverage_fuzzing_corpuses_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE coverage_fuzzing_corpuses_id_seq OWNED BY coverage_fuzzing_corpuses.id; + CREATE TABLE csv_issue_imports ( id bigint NOT NULL, project_id bigint NOT NULL, @@ -13744,7 +13772,6 @@ CREATE SEQUENCE error_tracking_errors_id_seq ALTER SEQUENCE error_tracking_errors_id_seq OWNED BY error_tracking_errors.id; CREATE TABLE events ( - id_convert_to_bigint integer DEFAULT 0 NOT NULL, project_id integer, author_id integer NOT NULL, target_id integer, @@ -15111,6 +15138,23 @@ CREATE TABLE issue_assignees ( issue_id integer NOT NULL ); +CREATE TABLE issue_customer_relations_contacts ( + id bigint NOT NULL, + issue_id bigint NOT NULL, + contact_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE issue_customer_relations_contacts_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE issue_customer_relations_contacts_id_seq OWNED BY issue_customer_relations_contacts.id; + CREATE TABLE issue_email_participants ( id bigint NOT NULL, issue_id bigint NOT NULL, @@ -16214,8 +16258,7 @@ CREATE TABLE namespaces ( push_rule_id bigint, shared_runners_enabled boolean DEFAULT true NOT NULL, allow_descendants_override_disabled_shared_runners boolean DEFAULT false NOT NULL, - traversal_ids integer[] DEFAULT '{}'::integer[] NOT NULL, - delayed_project_removal boolean DEFAULT false NOT NULL + traversal_ids integer[] DEFAULT '{}'::integer[] NOT NULL ); CREATE SEQUENCE namespaces_id_seq @@ -17018,7 +17061,7 @@ CREATE TABLE packages_helm_file_metadata ( package_file_id bigint NOT NULL, channel text NOT NULL, metadata jsonb, - CONSTRAINT check_c34067922d CHECK ((char_length(channel) <= 63)) + CONSTRAINT check_06e8d100af CHECK ((char_length(channel) <= 255)) ); CREATE TABLE packages_maven_metadata ( @@ -17407,7 +17450,8 @@ CREATE TABLE plan_limits ( ci_max_artifact_size_cluster_image_scanning integer DEFAULT 0 NOT NULL, ci_jobs_trace_size_limit integer DEFAULT 100 NOT NULL, pages_file_entries integer DEFAULT 200000 NOT NULL, - dast_profile_schedules integer DEFAULT 1 NOT NULL + dast_profile_schedules integer DEFAULT 1 NOT NULL, + external_audit_event_destinations integer DEFAULT 5 NOT NULL ); CREATE SEQUENCE plan_limits_id_seq @@ -17863,7 +17907,7 @@ CREATE TABLE project_error_tracking_settings ( encrypted_token_iv character varying, project_name character varying, organization_name character varying, - integrated boolean DEFAULT false NOT NULL + integrated boolean DEFAULT true NOT NULL ); CREATE TABLE project_export_jobs ( @@ -18489,7 +18533,6 @@ ALTER SEQUENCE protected_tags_id_seq OWNED BY protected_tags.id; CREATE TABLE push_event_payloads ( commit_count bigint NOT NULL, - event_id_convert_to_bigint integer DEFAULT 0 NOT NULL, action smallint NOT NULL, ref_type smallint NOT NULL, commit_from bytea, @@ -19008,7 +19051,8 @@ CREATE TABLE security_scans ( info jsonb DEFAULT '{}'::jsonb NOT NULL, project_id bigint, pipeline_id bigint, - latest boolean DEFAULT true NOT NULL + latest boolean DEFAULT true NOT NULL, + status smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE security_scans_id_seq @@ -19444,9 +19488,7 @@ CREATE SEQUENCE system_note_metadata_id_seq ALTER SEQUENCE system_note_metadata_id_seq OWNED BY system_note_metadata.id; CREATE TABLE taggings ( - id_convert_to_bigint integer DEFAULT 0 NOT NULL, tag_id integer, - taggable_id_convert_to_bigint integer, taggable_type character varying, tagger_id integer, tagger_type character varying, @@ -19623,6 +19665,11 @@ CREATE TABLE topics ( name text NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, + avatar text, + description text, + total_projects_count bigint DEFAULT 0 NOT NULL, + CONSTRAINT check_26753fb43a CHECK ((char_length(avatar) <= 255)), + CONSTRAINT check_5d1a07c8c8 CHECK ((char_length(description) <= 1024)), CONSTRAINT check_7a90d4c757 CHECK ((char_length(name) <= 255)) ); @@ -19767,7 +19814,12 @@ ALTER SEQUENCE user_canonical_emails_id_seq OWNED BY user_canonical_emails.id; CREATE TABLE user_credit_card_validations ( user_id bigint NOT NULL, - credit_card_validated_at timestamp with time zone NOT NULL + credit_card_validated_at timestamp with time zone NOT NULL, + expiration_date date, + last_digits smallint, + holder_name text, + CONSTRAINT check_3eea080c91 CHECK (((last_digits >= 0) AND (last_digits <= 9999))), + CONSTRAINT check_eafe45d88b CHECK ((char_length(holder_name) <= 26)) ); CREATE TABLE user_custom_attributes ( @@ -19792,19 +19844,22 @@ CREATE TABLE user_details ( user_id bigint NOT NULL, job_title character varying(200) DEFAULT ''::character varying NOT NULL, bio character varying(255) DEFAULT ''::character varying NOT NULL, - bio_html text, - cached_markdown_version integer, webauthn_xid text, other_role text, provisioned_by_group_id bigint, pronouns text, pronunciation text, + registration_objective smallint, + phone text, CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)), + CONSTRAINT check_a73b398c60 CHECK ((char_length(phone) <= 32)), CONSTRAINT check_b132136b01 CHECK ((char_length(other_role) <= 100)), CONSTRAINT check_eeeaf8d4f0 CHECK ((char_length(pronouns) <= 50)), CONSTRAINT check_f932ed37db CHECK ((char_length(pronunciation) <= 255)) ); +COMMENT ON COLUMN user_details.phone IS 'JiHu-specific column'; + CREATE SEQUENCE user_details_user_id_seq START WITH 1 INCREMENT BY 1 @@ -20098,6 +20153,19 @@ CREATE SEQUENCE users_statistics_id_seq ALTER SEQUENCE users_statistics_id_seq OWNED BY users_statistics.id; +CREATE TABLE verification_codes ( + created_at timestamp with time zone DEFAULT now() NOT NULL, + visitor_id_code text NOT NULL, + code text NOT NULL, + phone text NOT NULL, + CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), + CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) +) +PARTITION BY RANGE (created_at); + +COMMENT ON TABLE verification_codes IS 'JiHu-specific table'; + CREATE TABLE vulnerabilities ( id bigint NOT NULL, milestone_id bigint, @@ -20351,6 +20419,7 @@ CREATE TABLE vulnerability_finding_evidences ( updated_at timestamp with time zone NOT NULL, vulnerability_occurrence_id bigint NOT NULL, summary text, + data jsonb DEFAULT '{}'::jsonb NOT NULL, CONSTRAINT check_5773b236fb CHECK ((char_length(summary) <= 8000000)) ); @@ -20962,6 +21031,8 @@ ALTER TABLE ONLY atlassian_identities ALTER COLUMN user_id SET DEFAULT nextval(' ALTER TABLE ONLY audit_events ALTER COLUMN id SET DEFAULT nextval('audit_events_id_seq'::regclass); +ALTER TABLE ONLY audit_events_external_audit_event_destinations ALTER COLUMN id SET DEFAULT nextval('audit_events_external_audit_event_destinations_id_seq'::regclass); + ALTER TABLE ONLY authentication_events ALTER COLUMN id SET DEFAULT nextval('authentication_events_id_seq'::regclass); ALTER TABLE ONLY award_emoji ALTER COLUMN id SET DEFAULT nextval('award_emoji_id_seq'::regclass); @@ -21154,6 +21225,8 @@ ALTER TABLE ONLY container_repositories ALTER COLUMN id SET DEFAULT nextval('con ALTER TABLE ONLY conversational_development_index_metrics ALTER COLUMN id SET DEFAULT nextval('conversational_development_index_metrics_id_seq'::regclass); +ALTER TABLE ONLY coverage_fuzzing_corpuses ALTER COLUMN id SET DEFAULT nextval('coverage_fuzzing_corpuses_id_seq'::regclass); + ALTER TABLE ONLY csv_issue_imports ALTER COLUMN id SET DEFAULT nextval('csv_issue_imports_id_seq'::regclass); ALTER TABLE ONLY custom_emoji ALTER COLUMN id SET DEFAULT nextval('custom_emoji_id_seq'::regclass); @@ -21370,6 +21443,8 @@ ALTER TABLE ONLY issuable_severities ALTER COLUMN id SET DEFAULT nextval('issuab ALTER TABLE ONLY issuable_slas ALTER COLUMN id SET DEFAULT nextval('issuable_slas_id_seq'::regclass); +ALTER TABLE ONLY issue_customer_relations_contacts ALTER COLUMN id SET DEFAULT nextval('issue_customer_relations_contacts_id_seq'::regclass); + ALTER TABLE ONLY issue_email_participants ALTER COLUMN id SET DEFAULT nextval('issue_email_participants_id_seq'::regclass); ALTER TABLE ONLY issue_links ALTER COLUMN id SET DEFAULT nextval('issue_links_id_seq'::regclass); @@ -21414,6 +21489,8 @@ ALTER TABLE ONLY list_user_preferences ALTER COLUMN id SET DEFAULT nextval('list ALTER TABLE ONLY lists ALTER COLUMN id SET DEFAULT nextval('lists_id_seq'::regclass); +ALTER TABLE ONLY loose_foreign_keys_deleted_records ALTER COLUMN id SET DEFAULT nextval('loose_foreign_keys_deleted_records_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); @@ -22036,6 +22113,12 @@ ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_reques ALTER TABLE ONLY gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 ADD CONSTRAINT analytics_cycle_analytics_merge_request_stage_events_31_pkey PRIMARY KEY (stage_event_hash_id, merge_request_id); +ALTER TABLE ONLY loose_foreign_keys_deleted_records + ADD CONSTRAINT loose_foreign_keys_deleted_records_pkey PRIMARY KEY (partition, id); + +ALTER TABLE ONLY gitlab_partitions_static.loose_foreign_keys_deleted_records_1 + ADD CONSTRAINT loose_foreign_keys_deleted_records_1_pkey PRIMARY KEY (partition, id); + ALTER TABLE ONLY product_analytics_events_experimental ADD CONSTRAINT product_analytics_events_experimental_pkey PRIMARY KEY (id, project_id); @@ -22333,6 +22416,9 @@ ALTER TABLE ONLY ar_internal_metadata ALTER TABLE ONLY atlassian_identities ADD CONSTRAINT atlassian_identities_pkey PRIMARY KEY (user_id); +ALTER TABLE ONLY audit_events_external_audit_event_destinations + ADD CONSTRAINT audit_events_external_audit_event_destinations_pkey PRIMARY KEY (id); + ALTER TABLE ONLY audit_events ADD CONSTRAINT audit_events_pkey PRIMARY KEY (id, created_at); @@ -22657,6 +22743,9 @@ ALTER TABLE ONLY container_repositories ALTER TABLE ONLY conversational_development_index_metrics ADD CONSTRAINT conversational_development_index_metrics_pkey PRIMARY KEY (id); +ALTER TABLE ONLY coverage_fuzzing_corpuses + ADD CONSTRAINT coverage_fuzzing_corpuses_pkey PRIMARY KEY (id); + ALTER TABLE ONLY csv_issue_imports ADD CONSTRAINT csv_issue_imports_pkey PRIMARY KEY (id); @@ -23023,6 +23112,9 @@ ALTER TABLE ONLY issuable_slas ALTER TABLE ONLY issue_assignees ADD CONSTRAINT issue_assignees_pkey PRIMARY KEY (issue_id, user_id); +ALTER TABLE ONLY issue_customer_relations_contacts + ADD CONSTRAINT issue_customer_relations_contacts_pkey PRIMARY KEY (id); + ALTER TABLE ONLY issue_email_participants ADD CONSTRAINT issue_email_participants_pkey PRIMARY KEY (id); @@ -23101,9 +23193,6 @@ ALTER TABLE ONLY list_user_preferences ALTER TABLE ONLY lists ADD CONSTRAINT lists_pkey PRIMARY KEY (id); -ALTER TABLE ONLY loose_foreign_keys_deleted_records - ADD CONSTRAINT loose_foreign_keys_deleted_records_pkey PRIMARY KEY (created_at, deleted_table_name, deleted_table_primary_key_value); - ALTER TABLE ONLY members ADD CONSTRAINT members_pkey PRIMARY KEY (id); @@ -23737,6 +23826,9 @@ ALTER TABLE ONLY users_star_projects ALTER TABLE ONLY users_statistics ADD CONSTRAINT users_statistics_pkey PRIMARY KEY (id); +ALTER TABLE ONLY verification_codes + ADD CONSTRAINT verification_codes_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); + ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT vulnerabilities_pkey PRIMARY KEY (id); @@ -23995,6 +24087,8 @@ CREATE INDEX cadence_create_iterations_automation ON iterations_cadences USING b 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 ci_job_artifacts_expire_at_unlocked_idx ON ci_job_artifacts USING btree (expire_at) WHERE (locked = 0); + CREATE INDEX code_owner_approval_required ON protected_branches USING btree (project_id, code_owner_approval_required) WHERE (code_owner_approval_required = true); CREATE UNIQUE INDEX commit_user_mentions_on_commit_id_and_note_id_unique_index ON commit_user_mentions USING btree (commit_id, note_id); @@ -24079,9 +24173,7 @@ CREATE INDEX idx_issues_on_project_id_and_created_at_and_id_and_state_id ON issu CREATE INDEX idx_issues_on_project_id_and_due_date_and_id_and_state_id ON issues USING btree (project_id, due_date, id, state_id) WHERE (due_date IS NOT NULL); -CREATE INDEX idx_issues_on_project_id_and_rel_asc_and_id ON issues USING btree (project_id, relative_position, id); - -CREATE INDEX idx_issues_on_project_id_and_rel_position_and_state_id_and_id ON issues USING btree (project_id, relative_position, state_id, id DESC); +CREATE INDEX idx_issues_on_project_id_and_rel_position_and_id_and_state_id ON issues USING btree (project_id, relative_position, id, state_id); 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); @@ -24285,6 +24377,8 @@ CREATE INDEX index_approval_project_rules_on_rule_type ON approval_project_rules CREATE INDEX index_approval_project_rules_protected_branches_pb_id ON approval_project_rules_protected_branches USING btree (protected_branch_id); +CREATE INDEX index_approval_project_rules_report_type ON approval_project_rules USING btree (report_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); @@ -24479,6 +24573,8 @@ CREATE INDEX index_ci_builds_on_project_id_for_successfull_pages_deploy ON ci_bu CREATE INDEX index_ci_builds_on_queued_at ON ci_builds USING btree (queued_at); +CREATE INDEX index_ci_builds_on_resource_group_and_status_and_commit_id ON ci_builds USING btree (resource_group_id, status, commit_id) WHERE (resource_group_id IS NOT NULL); + CREATE INDEX index_ci_builds_on_runner_id_and_id_desc ON ci_builds USING btree (runner_id, id DESC); CREATE INDEX index_ci_builds_on_stage_id ON ci_builds USING btree (stage_id); @@ -24771,6 +24867,10 @@ CREATE UNIQUE INDEX index_clusters_applications_runners_on_cluster_id ON cluster CREATE INDEX index_clusters_applications_runners_on_runner_id ON clusters_applications_runners USING btree (runner_id); +CREATE INDEX index_clusters_integration_elasticstack_enabled ON clusters_integration_elasticstack USING btree (enabled, created_at, cluster_id); + +CREATE INDEX index_clusters_integration_prometheus_enabled ON clusters_integration_prometheus USING btree (enabled, created_at, cluster_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); @@ -24803,6 +24903,12 @@ CREATE UNIQUE INDEX index_container_repositories_on_project_id_and_name ON conta CREATE INDEX index_container_repository_on_name_trigram ON container_repositories USING gin (name gin_trgm_ops); +CREATE INDEX index_coverage_fuzzing_corpuses_on_package_id ON coverage_fuzzing_corpuses USING btree (package_id); + +CREATE INDEX index_coverage_fuzzing_corpuses_on_project_id ON coverage_fuzzing_corpuses USING btree (project_id); + +CREATE INDEX index_coverage_fuzzing_corpuses_on_user_id ON coverage_fuzzing_corpuses USING btree (user_id); + CREATE INDEX index_created_at_on_codeowner_approval_merge_request_rules ON approval_merge_request_rules USING btree (created_at) WHERE ((rule_type = 2) AND (section <> 'codeowners'::text)); CREATE INDEX index_csv_issue_imports_on_project_id ON csv_issue_imports USING btree (project_id); @@ -24867,11 +24973,19 @@ CREATE INDEX index_dep_ci_build_trace_sections_on_project_id ON dep_ci_build_tra CREATE INDEX index_dep_ci_build_trace_sections_on_section_name_id ON dep_ci_build_trace_sections USING btree (section_name_id); +CREATE UNIQUE INDEX index_dep_prox_manifests_on_group_id_file_name_and_status ON dependency_proxy_manifests USING btree (group_id, file_name, status); + 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_blobs_on_group_id_status_and_id ON dependency_proxy_blobs USING btree (group_id, status, id); + +CREATE INDEX index_dependency_proxy_blobs_on_status ON dependency_proxy_blobs USING btree (status); + CREATE INDEX index_dependency_proxy_group_settings_on_group_id ON dependency_proxy_group_settings USING btree (group_id); -CREATE UNIQUE INDEX index_dependency_proxy_manifests_on_group_id_and_file_name ON dependency_proxy_manifests USING btree (group_id, file_name); +CREATE INDEX index_dependency_proxy_manifests_on_group_id_status_and_id ON dependency_proxy_manifests USING btree (group_id, status, id); + +CREATE INDEX index_dependency_proxy_manifests_on_status ON dependency_proxy_manifests USING btree (status); CREATE INDEX index_deploy_key_id_on_protected_branch_push_access_levels ON protected_branch_push_access_levels USING btree (deploy_key_id); @@ -25061,13 +25175,13 @@ CREATE UNIQUE INDEX index_escalation_rules_on_all_attributes ON incident_managem CREATE INDEX index_escalation_rules_on_user ON incident_management_escalation_rules USING btree (user_id); -CREATE INDEX index_et_errors_on_project_id_and_status_and_events_count ON error_tracking_errors USING btree (project_id, status, events_count); +CREATE INDEX index_et_errors_on_project_id_and_status_and_id ON error_tracking_errors USING btree (project_id, status, id); -CREATE INDEX index_et_errors_on_project_id_and_status_and_first_seen_at ON error_tracking_errors USING btree (project_id, status, first_seen_at); +CREATE INDEX index_et_errors_on_project_id_and_status_events_count_id_desc ON error_tracking_errors USING btree (project_id, status, events_count DESC, id DESC); -CREATE INDEX index_et_errors_on_project_id_and_status_and_id ON error_tracking_errors USING btree (project_id, status, id); +CREATE INDEX index_et_errors_on_project_id_and_status_first_seen_at_id_desc ON error_tracking_errors USING btree (project_id, status, first_seen_at DESC, id DESC); -CREATE INDEX index_et_errors_on_project_id_and_status_and_last_seen_at ON error_tracking_errors USING btree (project_id, status, last_seen_at); +CREATE INDEX index_et_errors_on_project_id_and_status_last_seen_at_id_desc ON error_tracking_errors USING btree (project_id, status, last_seen_at DESC, id DESC); CREATE INDEX index_events_on_action ON events USING btree (action); @@ -25107,6 +25221,8 @@ CREATE UNIQUE INDEX index_experiments_on_name ON experiments USING btree (name); CREATE INDEX index_expired_and_not_notified_personal_access_tokens ON personal_access_tokens USING btree (id, expires_at) WHERE ((impersonation = false) AND (revoked = false) AND (expire_notification_delivered = false)); +CREATE UNIQUE INDEX index_external_audit_event_destinations_on_namespace_id ON audit_events_external_audit_event_destinations USING btree (namespace_id, destination_url); + 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); @@ -25323,8 +25439,6 @@ CREATE INDEX index_incident_management_pending_alert_escalations_on_alert_id ON CREATE INDEX index_incident_management_pending_alert_escalations_on_rule_id ON ONLY incident_management_pending_alert_escalations USING btree (rule_id); -CREATE INDEX index_incident_management_pending_alert_escalations_on_schedule ON ONLY incident_management_pending_alert_escalations USING btree (schedule_id); - CREATE INDEX index_incident_management_pending_issue_escalations_on_issue_id ON ONLY incident_management_pending_issue_escalations USING btree (issue_id); CREATE INDEX index_incident_management_pending_issue_escalations_on_rule_id ON ONLY incident_management_pending_issue_escalations USING btree (rule_id); @@ -25373,6 +25487,10 @@ CREATE UNIQUE INDEX index_issuable_slas_on_issue_id ON issuable_slas USING btree CREATE INDEX index_issue_assignees_on_user_id ON issue_assignees USING btree (user_id); +CREATE UNIQUE INDEX index_issue_crm_contacts_on_issue_id_and_contact_id ON issue_customer_relations_contacts USING btree (issue_id, contact_id); + +CREATE INDEX index_issue_customer_relations_contacts_on_contact_id ON issue_customer_relations_contacts USING btree (contact_id); + CREATE UNIQUE INDEX index_issue_email_participants_on_issue_id_and_lower_email ON issue_email_participants USING btree (issue_id, lower(email)); CREATE INDEX index_issue_links_on_source_id ON issue_links USING btree (source_id); @@ -25381,6 +25499,8 @@ CREATE UNIQUE INDEX index_issue_links_on_source_id_and_target_id ON issue_links CREATE INDEX index_issue_links_on_target_id ON issue_links USING btree (target_id); +CREATE INDEX index_issue_metrics_first_mentioned_in_commit ON issue_metrics USING btree (issue_id) WHERE (date_part('year'::text, first_mentioned_in_commit_at) > (2019)::double precision); + 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 INDEX index_issue_on_project_id_state_id_and_blocking_issues_count ON issues USING btree (project_id, state_id, blocking_issues_count); @@ -25473,17 +25593,17 @@ CREATE INDEX index_label_priorities_on_priority ON label_priorities USING btree 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 ON labels USING btree (group_id); -CREATE UNIQUE INDEX index_labels_on_group_id_and_title_unique ON labels USING btree (group_id, title) WHERE (project_id IS NULL); +CREATE UNIQUE INDEX index_labels_on_group_id_and_title_varchar_unique ON labels USING btree (group_id, title varchar_pattern_ops) WHERE (project_id IS NULL); CREATE INDEX index_labels_on_project_id ON labels USING btree (project_id); -CREATE UNIQUE INDEX index_labels_on_project_id_and_title_unique ON labels USING btree (project_id, title) WHERE (group_id IS NULL); +CREATE UNIQUE INDEX index_labels_on_project_id_and_title_varchar_unique ON labels USING btree (project_id, title varchar_pattern_ops) WHERE (group_id IS NULL); 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_title_varchar ON labels USING btree (title varchar_pattern_ops); CREATE INDEX index_labels_on_type_and_project_id ON labels USING btree (type, project_id); @@ -25701,6 +25821,8 @@ CREATE INDEX index_namespaces_id_parent_id_is_not_null ON namespaces USING btree CREATE INDEX index_namespaces_id_parent_id_is_null ON namespaces USING btree (id) WHERE (parent_id IS NULL); +CREATE UNIQUE INDEX index_namespaces_name_parent_id_type ON namespaces USING btree (name, parent_id, type); + 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); @@ -25711,8 +25833,6 @@ CREATE INDEX index_namespaces_on_ldap_sync_last_successful_update_at ON namespac 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); @@ -25735,7 +25855,7 @@ CREATE INDEX index_namespaces_on_shared_and_extra_runners_minutes_limit ON names CREATE INDEX index_namespaces_on_traversal_ids ON namespaces USING gin (traversal_ids); -CREATE INDEX index_namespaces_on_type_and_id_partial ON namespaces USING btree (type, id) WHERE (type IS NOT NULL); +CREATE INDEX index_namespaces_on_type_and_id ON namespaces USING btree (type, id); CREATE INDEX index_namespaces_public_groups_name_id ON namespaces USING btree (name, id) WHERE (((type)::text = 'Group'::text) AND (visibility_level = 20)); @@ -25813,10 +25933,6 @@ CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path): CREATE INDEX index_on_routes_lower_path ON routes USING btree (lower((path)::text)); -CREATE INDEX index_on_snapshots_segment_id_end_time ON analytics_devops_adoption_snapshots USING btree (segment_id, end_time); - -CREATE INDEX index_on_snapshots_segment_id_recorded_at ON analytics_devops_adoption_snapshots USING btree (segment_id, recorded_at); - CREATE INDEX index_on_users_lower_email ON users USING btree (lower((email)::text)); CREATE INDEX index_on_users_lower_username ON users USING btree (lower((username)::text)); @@ -26281,6 +26397,8 @@ CREATE UNIQUE INDEX index_release_links_on_release_id_and_url ON release_links U CREATE INDEX index_releases_on_author_id ON releases USING btree (author_id); +CREATE INDEX index_releases_on_author_id_id_created_at ON releases USING btree (author_id, id, created_at); + CREATE INDEX index_releases_on_project_id_and_tag ON releases USING btree (project_id, tag); CREATE INDEX index_releases_on_released_at ON releases USING btree (released_at); @@ -26393,7 +26511,7 @@ CREATE UNIQUE INDEX index_scim_oauth_access_tokens_on_group_id_and_token_encrypt CREATE INDEX index_secure_ci_builds_on_user_id_name_created_at ON ci_builds USING btree (user_id, name, created_at) WHERE (((type)::text = 'Ci::Build'::text) AND ((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('license_scanning'::character varying)::text, ('sast'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('apifuzzer_fuzz'::character varying)::text, ('apifuzzer_fuzz_dnd'::character varying)::text, ('secret_detection'::character varying)::text]))); -CREATE INDEX index_security_ci_builds_on_name_and_id_parser_features ON ci_builds USING btree (name, id) 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, ('secret_detection'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('license_scanning'::character varying)::text])) AND ((type)::text = 'Ci::Build'::text)); +CREATE INDEX index_security_ci_builds_on_name_and_id_parser_features_broken ON ci_builds USING btree (name, id) 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, ('secret_detection'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('license_scanning'::character varying)::text])) AND ((type)::text = 'Ci::Build'::text)); CREATE INDEX index_security_findings_on_confidence ON security_findings USING btree (confidence); @@ -26547,8 +26665,6 @@ CREATE UNIQUE INDEX index_system_note_metadata_on_note_id ON system_note_metadat 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); @@ -26619,6 +26735,10 @@ CREATE UNIQUE INDEX index_token_with_ivs_on_hashed_token ON token_with_ivs USING CREATE UNIQUE INDEX index_topics_on_name ON topics USING btree (name); +CREATE INDEX index_topics_on_name_trigram ON topics USING gin (name gin_trgm_ops); + +CREATE INDEX index_topics_total_projects_count ON topics USING btree (total_projects_count DESC, id); + 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); @@ -26655,10 +26775,16 @@ CREATE UNIQUE INDEX index_user_canonical_emails_on_user_id ON user_canonical_ema CREATE UNIQUE INDEX index_user_canonical_emails_on_user_id_and_canonical_email ON user_canonical_emails USING btree (user_id, canonical_email); +CREATE INDEX index_user_credit_card_validations_meta_data_full_match ON user_credit_card_validations USING btree (holder_name, expiration_date, last_digits, credit_card_validated_at); + 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_details_on_phone ON user_details USING btree (phone) WHERE (phone IS NOT NULL); + +COMMENT ON INDEX index_user_details_on_phone IS 'JiHu-specific index'; + CREATE INDEX index_user_details_on_provisioned_by_group_id ON user_details USING btree (provisioned_by_group_id); CREATE UNIQUE INDEX index_user_details_on_user_id ON user_details USING btree (user_id); @@ -26741,6 +26867,10 @@ CREATE INDEX index_users_star_projects_on_project_id ON users_star_projects USIN CREATE UNIQUE INDEX index_users_star_projects_on_user_id_and_project_id ON users_star_projects USING btree (user_id, project_id); +CREATE UNIQUE INDEX index_verification_codes_on_phone_and_visitor_id_code ON ONLY verification_codes USING btree (visitor_id_code, phone, created_at); + +COMMENT ON INDEX index_verification_codes_on_phone_and_visitor_id_code IS 'JiHu-specific index'; + CREATE UNIQUE INDEX index_vuln_historical_statistics_on_project_id_and_date ON vulnerability_historical_statistics USING btree (project_id, date); CREATE INDEX index_vulnerabilities_on_author_id ON vulnerabilities USING btree (author_id); @@ -26819,6 +26949,8 @@ CREATE INDEX index_vulnerability_occurrences_deduplication ON vulnerability_occu CREATE INDEX index_vulnerability_occurrences_for_issue_links_migration ON vulnerability_occurrences USING btree (project_id, report_type, encode(project_fingerprint, 'hex'::text)); +CREATE INDEX index_vulnerability_occurrences_on_location_image ON vulnerability_occurrences USING gin (((location -> 'image'::text))) WHERE (report_type = ANY (ARRAY[2, 7])); + CREATE INDEX index_vulnerability_occurrences_on_primary_identifier_id ON vulnerability_occurrences USING btree (primary_identifier_id); CREATE INDEX index_vulnerability_occurrences_on_project_fingerprint ON vulnerability_occurrences USING btree (project_fingerprint); @@ -26945,16 +27077,12 @@ CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree CREATE INDEX tmp_idx_deduplicate_vulnerability_occurrences ON vulnerability_occurrences USING btree (project_id, report_type, location_fingerprint, primary_identifier_id, id); -CREATE INDEX tmp_idx_on_namespaces_delayed_project_removal ON namespaces USING btree (id) WHERE (delayed_project_removal = true); - CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_child_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NOT NULL) AND (traversal_ids = '{}'::integer[])); CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_root_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NULL) AND (traversal_ids = '{}'::integer[])); CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2); -CREATE INDEX tmp_index_taggings_on_id_where_taggable_type_project ON taggings USING btree (id) WHERE ((taggable_type)::text = 'Project'::text); - CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name); CREATE UNIQUE INDEX uniq_pkgs_deb_grp_components_on_distribution_id_and_name ON packages_debian_group_components USING btree (distribution_id, name); @@ -27109,6 +27237,8 @@ ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PAR ALTER INDEX analytics_cycle_analytics_merge_request_stage_events_pkey ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31_pkey; +ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_static.loose_foreign_keys_deleted_records_1_pkey; + ALTER INDEX index_product_analytics_events_experimental_project_and_time ATTACH PARTITION gitlab_partitions_static.product_analytics_events_expe_project_id_collector_tstamp_idx10; ALTER INDEX index_product_analytics_events_experimental_project_and_time ATTACH PARTITION gitlab_partitions_static.product_analytics_events_expe_project_id_collector_tstamp_idx11; @@ -27365,16 +27495,8 @@ ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_p ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_63_pkey; -CREATE TRIGGER trigger_3f6129be01d2 BEFORE INSERT OR UPDATE ON ci_builds FOR EACH ROW EXECUTE FUNCTION trigger_3f6129be01d2(); - -CREATE TRIGGER trigger_542d6c2ad72e BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_542d6c2ad72e(); - -CREATE TRIGGER trigger_8487d4de3e7b BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_8487d4de3e7b(); - CREATE TRIGGER trigger_91dc388a5fe6 BEFORE INSERT OR UPDATE ON dep_ci_build_trace_sections FOR EACH ROW EXECUTE FUNCTION trigger_91dc388a5fe6(); -CREATE TRIGGER trigger_aebe8b822ad3 BEFORE INSERT OR UPDATE ON taggings FOR EACH ROW EXECUTE FUNCTION trigger_aebe8b822ad3(); - CREATE TRIGGER trigger_delete_project_namespace_on_project_delete AFTER DELETE ON projects FOR EACH ROW WHEN ((old.project_namespace_id IS NOT NULL)) EXECUTE FUNCTION delete_associated_project_namespace(); CREATE TRIGGER trigger_has_external_issue_tracker_on_delete AFTER DELETE ON integrations FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker(); @@ -27414,9 +27536,6 @@ ALTER TABLE ONLY service_desk_settings 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 terraform_state_versions - ADD CONSTRAINT fk_04b91e4a9f FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE SET NULL; - ALTER TABLE ONLY issues ADD CONSTRAINT fk_05f1e72feb FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -27429,6 +27548,9 @@ ALTER TABLE ONLY user_interacted_projects ALTER TABLE ONLY dast_sites ADD CONSTRAINT fk_0a57f2271b FOREIGN KEY (dast_site_validation_id) REFERENCES dast_site_validations(id) ON DELETE SET NULL; +ALTER TABLE ONLY issue_customer_relations_contacts + ADD CONSTRAINT fk_0c0037f723 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; + ALTER TABLE ONLY web_hooks ADD CONSTRAINT fk_0c8ca6d9d1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -27492,6 +27614,9 @@ ALTER TABLE ONLY boards ALTER TABLE ONLY epics ADD CONSTRAINT fk_1fbed67632 FOREIGN KEY (start_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; +ALTER TABLE ONLY coverage_fuzzing_corpuses + ADD CONSTRAINT fk_204d40056a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_container_repository_updated_events ADD CONSTRAINT fk_212c89c706 FOREIGN KEY (container_repository_id) REFERENCES container_repositories(id) ON DELETE CASCADE; @@ -27531,6 +27656,9 @@ ALTER TABLE ONLY geo_event_log ALTER TABLE ONLY deployments ADD CONSTRAINT fk_289bba3222 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE SET NULL; +ALTER TABLE ONLY coverage_fuzzing_corpuses + ADD CONSTRAINT fk_29f6f15f82 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY agent_group_authorizations ADD CONSTRAINT fk_2c9f941965 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -27741,6 +27869,9 @@ ALTER TABLE ONLY protected_branches ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_7ac31eacb9 FOREIGN KEY (updated_by_id) REFERENCES users(id) ON DELETE SET NULL; +ALTER TABLE ONLY issue_customer_relations_contacts + ADD CONSTRAINT fk_7b92f835bb FOREIGN KEY (contact_id) REFERENCES customer_relations_contacts(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_7c5bb22a22 FOREIGN KEY (due_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; @@ -28170,6 +28301,9 @@ ALTER TABLE ONLY application_settings ALTER TABLE ONLY events ADD CONSTRAINT fk_edfd187b6f FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY coverage_fuzzing_corpuses + ADD CONSTRAINT fk_ef5ebf339f FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_efb96ab1e2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -28314,6 +28448,9 @@ ALTER TABLE ONLY packages_conan_file_metadata ALTER TABLE ONLY ci_build_pending_states ADD CONSTRAINT fk_rails_0bbbfeaf9d FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; +ALTER TABLE ONLY audit_events_external_audit_event_destinations + ADD CONSTRAINT fk_rails_0bc80a4edc FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY operations_user_lists ADD CONSTRAINT fk_rails_0c716e079b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -28386,9 +28523,6 @@ ALTER TABLE ONLY project_deploy_tokens 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 security_orchestration_policy_rule_schedules ADD CONSTRAINT fk_rails_17ade83f17 FOREIGN KEY (security_orchestration_policy_configuration_id) REFERENCES security_orchestration_policy_configurations(id) ON DELETE CASCADE; @@ -28497,9 +28631,6 @@ ALTER TABLE ONLY incident_management_oncall_rotations ALTER TABLE ONLY ci_unit_test_failures ADD CONSTRAINT fk_rails_259da3e79c FOREIGN KEY (unit_test_id) REFERENCES ci_unit_tests(id) ON DELETE CASCADE; -ALTER TABLE ONLY analytics_devops_adoption_snapshots - ADD CONSTRAINT fk_rails_25da9a92c0 FOREIGN KEY (segment_id) REFERENCES analytics_devops_adoption_segments(id) ON DELETE CASCADE; - ALTER TABLE ONLY cluster_agents ADD CONSTRAINT fk_rails_25e9fc2d5d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -28653,9 +28784,6 @@ ALTER TABLE ONLY snippet_user_mentions ALTER TABLE ONLY clusters_applications_helm ADD CONSTRAINT fk_rails_3e2b1c06bc FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; -ALTER TABLE ONLY packages_package_file_build_infos - ADD CONSTRAINT fk_rails_3e3f630188 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; - ALTER TABLE ONLY epic_user_mentions ADD CONSTRAINT fk_rails_3eaf4d88cc FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; @@ -28680,9 +28808,6 @@ ALTER TABLE ONLY epic_issues ALTER TABLE ONLY ci_refs ADD CONSTRAINT fk_rails_4249db8cc3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY security_orchestration_policy_configurations - ADD CONSTRAINT fk_rails_42ed6c25ec FOREIGN KEY (security_policy_management_project_id) REFERENCES projects(id) ON DELETE RESTRICT; - ALTER TABLE ONLY ci_resources ADD CONSTRAINT fk_rails_430336af2d FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE CASCADE; @@ -29838,9 +29963,6 @@ ALTER TABLE ONLY ci_job_variables ALTER TABLE ONLY packages_nuget_metadata ADD CONSTRAINT fk_rails_fc0c19f5b4 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; -ALTER TABLE incident_management_pending_alert_escalations - ADD CONSTRAINT fk_rails_fcbfd9338b FOREIGN KEY (schedule_id) REFERENCES incident_management_oncall_schedules(id) ON DELETE CASCADE; - ALTER TABLE ONLY customer_relations_contacts ADD CONSTRAINT fk_rails_fd3f2e7572 FOREIGN KEY (organization_id) REFERENCES customer_relations_organizations(id) ON DELETE CASCADE; @@ -29862,6 +29984,9 @@ ALTER TABLE ONLY resource_label_events ALTER TABLE ONLY ci_builds_metadata ADD CONSTRAINT fk_rails_ffcf702a02 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY security_orchestration_policy_configurations + ADD CONSTRAINT fk_security_policy_configurations_management_project_id FOREIGN KEY (security_policy_management_project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY integrations ADD CONSTRAINT fk_services_inherit_from_id FOREIGN KEY (inherit_from_id) REFERENCES integrations(id) ON DELETE CASCADE; |