Commit 71942643 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'ag-remove-replciation-migrations' into 'master'

Geo: Drop tables related to vulnerability export replication

See merge request gitlab-org/gitlab!38299
parents 78a8c6e8 d56fe3f0
---
title: 'Geo: Drop tables related to vulnerability export replication'
merge_request: 38299
author:
type: removed
...@@ -33,6 +33,8 @@ class CreateVulnerabilitiesExportVerificationStatus < ActiveRecord::Migration[6. ...@@ -33,6 +33,8 @@ class CreateVulnerabilitiesExportVerificationStatus < ActiveRecord::Migration[6.
end end
def down def down
return unless table_exists?(:vulnerability_export_verification_status)
with_lock_retries do with_lock_retries do
drop_table :vulnerability_export_verification_status drop_table :vulnerability_export_verification_status
end end
......
# frozen_string_literal: true
class RemoveTableVulnerabilityExportVerificationStatus < ActiveRecord::Migration[6.0]
DOWNTIME = false
def up
return unless table_exists?(:vulnerability_export_verification_status)
drop_table :vulnerability_export_verification_status
end
def down
# no-op because `vulnerability_export_verification_status` table should not
# be created, see https://gitlab.com/gitlab-org/gitlab/-/issues/232977
end
end
bd1c0fd04b1a77492a125417a530ea0482c66330da3d2563c963c097e63b6b39
\ No newline at end of file
...@@ -16174,25 +16174,6 @@ CREATE SEQUENCE public.vulnerabilities_id_seq ...@@ -16174,25 +16174,6 @@ CREATE SEQUENCE public.vulnerabilities_id_seq
ALTER SEQUENCE public.vulnerabilities_id_seq OWNED BY public.vulnerabilities.id; ALTER SEQUENCE public.vulnerabilities_id_seq OWNED BY public.vulnerabilities.id;
CREATE TABLE public.vulnerability_export_verification_status (
vulnerability_export_id bigint NOT NULL,
verification_retry_at timestamp with time zone,
verified_at timestamp with time zone,
verification_retry_count smallint,
verification_checksum bytea,
verification_failure text,
CONSTRAINT check_48fdf48546 CHECK ((char_length(verification_failure) <= 255))
);
CREATE SEQUENCE public.vulnerability_export_verification_s_vulnerability_export_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE public.vulnerability_export_verification_s_vulnerability_export_id_seq OWNED BY public.vulnerability_export_verification_status.vulnerability_export_id;
CREATE TABLE public.vulnerability_exports ( CREATE TABLE public.vulnerability_exports (
id bigint NOT NULL, id bigint NOT NULL,
created_at timestamp with time zone NOT NULL, created_at timestamp with time zone NOT NULL,
...@@ -17262,8 +17243,6 @@ ALTER TABLE ONLY public.users_statistics ALTER COLUMN id SET DEFAULT nextval('pu ...@@ -17262,8 +17243,6 @@ ALTER TABLE ONLY public.users_statistics ALTER COLUMN id SET DEFAULT nextval('pu
ALTER TABLE ONLY public.vulnerabilities ALTER COLUMN id SET DEFAULT nextval('public.vulnerabilities_id_seq'::regclass); ALTER TABLE ONLY public.vulnerabilities ALTER COLUMN id SET DEFAULT nextval('public.vulnerabilities_id_seq'::regclass);
ALTER TABLE ONLY public.vulnerability_export_verification_status ALTER COLUMN vulnerability_export_id SET DEFAULT nextval('public.vulnerability_export_verification_s_vulnerability_export_id_seq'::regclass);
ALTER TABLE ONLY public.vulnerability_exports ALTER COLUMN id SET DEFAULT nextval('public.vulnerability_exports_id_seq'::regclass); ALTER TABLE ONLY public.vulnerability_exports ALTER COLUMN id SET DEFAULT nextval('public.vulnerability_exports_id_seq'::regclass);
ALTER TABLE ONLY public.vulnerability_feedback ALTER COLUMN id SET DEFAULT nextval('public.vulnerability_feedback_id_seq'::regclass); ALTER TABLE ONLY public.vulnerability_feedback ALTER COLUMN id SET DEFAULT nextval('public.vulnerability_feedback_id_seq'::regclass);
...@@ -18549,9 +18528,6 @@ ALTER TABLE ONLY public.users_statistics ...@@ -18549,9 +18528,6 @@ ALTER TABLE ONLY public.users_statistics
ALTER TABLE ONLY public.vulnerabilities ALTER TABLE ONLY public.vulnerabilities
ADD CONSTRAINT vulnerabilities_pkey PRIMARY KEY (id); ADD CONSTRAINT vulnerabilities_pkey PRIMARY KEY (id);
ALTER TABLE ONLY public.vulnerability_export_verification_status
ADD CONSTRAINT vulnerability_export_verification_status_pkey PRIMARY KEY (vulnerability_export_id);
ALTER TABLE ONLY public.vulnerability_exports ALTER TABLE ONLY public.vulnerability_exports
ADD CONSTRAINT vulnerability_exports_pkey PRIMARY KEY (id); ADD CONSTRAINT vulnerability_exports_pkey PRIMARY KEY (id);
...@@ -20804,8 +20780,6 @@ CREATE INDEX index_vulnerabilities_on_start_date_sourcing_milestone_id ON public ...@@ -20804,8 +20780,6 @@ CREATE INDEX index_vulnerabilities_on_start_date_sourcing_milestone_id ON public
CREATE INDEX index_vulnerabilities_on_updated_by_id ON public.vulnerabilities USING btree (updated_by_id); CREATE INDEX index_vulnerabilities_on_updated_by_id ON public.vulnerabilities USING btree (updated_by_id);
CREATE INDEX index_vulnerability_export_verification_status_on_export_id ON public.vulnerability_export_verification_status USING btree (vulnerability_export_id);
CREATE INDEX index_vulnerability_exports_on_author_id ON public.vulnerability_exports USING btree (author_id); CREATE INDEX index_vulnerability_exports_on_author_id ON public.vulnerability_exports USING btree (author_id);
CREATE INDEX index_vulnerability_exports_on_file_store ON public.vulnerability_exports USING btree (file_store); CREATE INDEX index_vulnerability_exports_on_file_store ON public.vulnerability_exports USING btree (file_store);
...@@ -20956,10 +20930,6 @@ CREATE UNIQUE INDEX unique_merge_request_metrics_by_merge_request_id ON public.m ...@@ -20956,10 +20930,6 @@ CREATE UNIQUE INDEX unique_merge_request_metrics_by_merge_request_id ON public.m
CREATE UNIQUE INDEX users_security_dashboard_projects_unique_index ON public.users_security_dashboard_projects USING btree (project_id, user_id); CREATE UNIQUE INDEX users_security_dashboard_projects_unique_index ON public.users_security_dashboard_projects USING btree (project_id, user_id);
CREATE INDEX vulnerability_exports_verification_checksum_partial ON public.vulnerability_export_verification_status USING btree (verification_checksum) WHERE (verification_checksum IS NOT NULL);
CREATE INDEX vulnerability_exports_verification_failure_partial ON public.vulnerability_export_verification_status USING btree (verification_failure) WHERE (verification_failure IS NOT NULL);
CREATE UNIQUE INDEX vulnerability_feedback_unique_idx ON public.vulnerability_feedback USING btree (project_id, category, feedback_type, project_fingerprint); CREATE UNIQUE INDEX vulnerability_feedback_unique_idx ON public.vulnerability_feedback USING btree (project_id, category, feedback_type, project_fingerprint);
CREATE UNIQUE INDEX vulnerability_occurrence_pipelines_on_unique_keys ON public.vulnerability_occurrence_pipelines USING btree (occurrence_id, pipeline_id); CREATE UNIQUE INDEX vulnerability_occurrence_pipelines_on_unique_keys ON public.vulnerability_occurrence_pipelines USING btree (occurrence_id, pipeline_id);
...@@ -21840,9 +21810,6 @@ ALTER TABLE ONLY public.approval_merge_request_rules ...@@ -21840,9 +21810,6 @@ ALTER TABLE ONLY public.approval_merge_request_rules
ALTER TABLE ONLY public.namespace_statistics ALTER TABLE ONLY public.namespace_statistics
ADD CONSTRAINT fk_rails_0062050394 FOREIGN KEY (namespace_id) REFERENCES public.namespaces(id) ON DELETE CASCADE; ADD CONSTRAINT fk_rails_0062050394 FOREIGN KEY (namespace_id) REFERENCES public.namespaces(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.vulnerability_export_verification_status
ADD CONSTRAINT fk_rails_00a22ee64f FOREIGN KEY (vulnerability_export_id) REFERENCES public.vulnerability_exports(id) ON DELETE CASCADE;
ALTER TABLE ONLY public.clusters_applications_elastic_stacks ALTER TABLE ONLY public.clusters_applications_elastic_stacks
ADD CONSTRAINT fk_rails_026f219f46 FOREIGN KEY (cluster_id) REFERENCES public.clusters(id) ON DELETE CASCADE; ADD CONSTRAINT fk_rails_026f219f46 FOREIGN KEY (cluster_id) REFERENCES public.clusters(id) ON DELETE CASCADE;
......
...@@ -28,6 +28,8 @@ class CreateVulnerabilityExportRegistry < ActiveRecord::Migration[6.0] ...@@ -28,6 +28,8 @@ class CreateVulnerabilityExportRegistry < ActiveRecord::Migration[6.0]
end end
def down def down
return unless table_exists?(:vulnerability_export_registry)
drop_table :vulnerability_export_registry drop_table :vulnerability_export_registry
end end
end end
# frozen_string_literal: true
class RemoveTableVulnerabilityExportRegistry < ActiveRecord::Migration[6.0]
DOWNTIME = false
def up
return unless table_exists?(:vulnerability_export_registry)
drop_table :vulnerability_export_registry
end
def down
# no-op because `vulnerability_export_verification_status` table should not
# be created, see https://gitlab.com/gitlab-org/gitlab/-/issues/232977
end
end
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_07_10_194046) do ActiveRecord::Schema.define(version: 2020_07_30_133800) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -180,18 +180,4 @@ ActiveRecord::Schema.define(version: 2020_07_10_194046) do ...@@ -180,18 +180,4 @@ ActiveRecord::Schema.define(version: 2020_07_10_194046) do
t.index ["state"], name: "index_terraform_state_registry_on_state" t.index ["state"], name: "index_terraform_state_registry_on_state"
t.index ["terraform_state_id"], name: "index_terraform_state_registry_on_terraform_state_id" t.index ["terraform_state_id"], name: "index_terraform_state_registry_on_terraform_state_id"
end end
create_table "vulnerability_export_registry", force: :cascade do |t|
t.datetime_with_timezone "retry_at"
t.datetime_with_timezone "last_synced_at"
t.datetime_with_timezone "created_at", null: false
t.bigint "vulnerability_export_id", null: false
t.integer "state", limit: 2, default: 0, null: false
t.integer "retry_count", limit: 2, default: 0
t.text "last_sync_failure"
t.index ["retry_at"], name: "index_vulnerability_export_registry_on_retry_at"
t.index ["state"], name: "index_vulnerability_export_registry_on_state"
t.index ["vulnerability_export_id"], name: "index_vulnerability_export_registry_on_vulnerability_export_id", unique: true
end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment