Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-16 03:11:15 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-16 03:11:15 +0300
commitd089b5729e472d68256aa39fade51e7ed99f042b (patch)
treed668fe62261e53daa2b2c1a4b4b9019eaadecf06 /db
parentc568cb4dbc0421212a28f3cd5b77223aad8888ba (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20211021140426_remove_geo_upload_deprecated_fields.rb27
-rw-r--r--db/post_migrate/20211021141930_drop_geo_upload_deleted_events_table.rb17
-rw-r--r--db/post_migrate/20211022160154_remove_outdated_fields_from_geo_node_status.rb12
-rw-r--r--db/schema_migrations/202110211404261
-rw-r--r--db/schema_migrations/202110211419301
-rw-r--r--db/schema_migrations/202110221601541
-rw-r--r--db/structure.sql35
7 files changed, 59 insertions, 35 deletions
diff --git a/db/post_migrate/20211021140426_remove_geo_upload_deprecated_fields.rb b/db/post_migrate/20211021140426_remove_geo_upload_deprecated_fields.rb
new file mode 100644
index 00000000000..7d0033c0ab9
--- /dev/null
+++ b/db/post_migrate/20211021140426_remove_geo_upload_deprecated_fields.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+class RemoveGeoUploadDeprecatedFields < Gitlab::Database::Migration[1.0]
+ disable_ddl_transaction!
+
+ def up
+ with_lock_retries do
+ remove_column :geo_event_log, :upload_deleted_event_id, :bigint
+ end
+ end
+
+ def down
+ with_lock_retries do
+ add_column(:geo_event_log, :upload_deleted_event_id, :bigint) unless column_exists?(:geo_event_log, :upload_deleted_event_id)
+ end
+
+ add_concurrent_foreign_key :geo_event_log, :geo_upload_deleted_events,
+ column: :upload_deleted_event_id,
+ name: 'fk_c1f241c70d',
+ on_delete: :cascade
+
+ add_concurrent_index :geo_event_log,
+ :upload_deleted_event_id,
+ name: 'index_geo_event_log_on_upload_deleted_event_id',
+ where: "(upload_deleted_event_id IS NOT NULL)"
+ end
+end
diff --git a/db/post_migrate/20211021141930_drop_geo_upload_deleted_events_table.rb b/db/post_migrate/20211021141930_drop_geo_upload_deleted_events_table.rb
new file mode 100644
index 00000000000..b6987e68fb1
--- /dev/null
+++ b/db/post_migrate/20211021141930_drop_geo_upload_deleted_events_table.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+class DropGeoUploadDeletedEventsTable < Gitlab::Database::Migration[1.0]
+ def up
+ drop_table :geo_upload_deleted_events
+ end
+
+ def down
+ create_table :geo_upload_deleted_events, id: :bigserial do |t|
+ t.integer :upload_id, null: false, index: true
+ t.string :file_path, null: false
+ t.integer :model_id, null: false
+ t.string :model_type, null: false
+ t.string :uploader, null: false
+ end
+ end
+end
diff --git a/db/post_migrate/20211022160154_remove_outdated_fields_from_geo_node_status.rb b/db/post_migrate/20211022160154_remove_outdated_fields_from_geo_node_status.rb
new file mode 100644
index 00000000000..5b117f9e4b8
--- /dev/null
+++ b/db/post_migrate/20211022160154_remove_outdated_fields_from_geo_node_status.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class RemoveOutdatedFieldsFromGeoNodeStatus < Gitlab::Database::Migration[1.0]
+ enable_lock_retries!
+
+ def change
+ remove_column :geo_node_statuses, :attachments_count, :integer
+ remove_column :geo_node_statuses, :attachments_synced_count, :integer
+ remove_column :geo_node_statuses, :attachments_failed_count, :integer
+ remove_column :geo_node_statuses, :attachments_synced_missing_on_primary_count, :integer
+ end
+end
diff --git a/db/schema_migrations/20211021140426 b/db/schema_migrations/20211021140426
new file mode 100644
index 00000000000..c32db84a138
--- /dev/null
+++ b/db/schema_migrations/20211021140426
@@ -0,0 +1 @@
+bc7974917509bfbda47375299009295bc5a55970b92443dd5d7134075b161279 \ No newline at end of file
diff --git a/db/schema_migrations/20211021141930 b/db/schema_migrations/20211021141930
new file mode 100644
index 00000000000..294e1c80aea
--- /dev/null
+++ b/db/schema_migrations/20211021141930
@@ -0,0 +1 @@
+483e4cbe2a0be2afbda511f2298e3715abaca29afafeeae26449fc862f49a08f \ No newline at end of file
diff --git a/db/schema_migrations/20211022160154 b/db/schema_migrations/20211022160154
new file mode 100644
index 00000000000..2a76379bc66
--- /dev/null
+++ b/db/schema_migrations/20211022160154
@@ -0,0 +1 @@
+c474870a626c909da772a1c9f459f369d50658ce8f585a35e7cc3c7ef64af657 \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 026ebadec26..7e366cd67d3 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -14170,7 +14170,6 @@ CREATE TABLE geo_event_log (
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,
@@ -14300,9 +14299,6 @@ CREATE TABLE geo_node_statuses (
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,
@@ -14327,7 +14323,6 @@ CREATE TABLE geo_node_statuses (
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,
@@ -14496,24 +14491,6 @@ CREATE SEQUENCE geo_reset_checksum_events_id_seq
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,
@@ -21510,8 +21487,6 @@ ALTER TABLE ONLY geo_repository_updated_events ALTER COLUMN id SET DEFAULT nextv
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);
@@ -23129,9 +23104,6 @@ ALTER TABLE ONLY geo_repository_updated_events
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);
@@ -25950,8 +25922,6 @@ CREATE INDEX index_geo_event_log_on_repository_updated_event_id ON geo_event_log
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);
@@ -25988,8 +25958,6 @@ CREATE INDEX index_geo_repository_updated_events_on_source ON geo_repository_upd
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_gin_ci_pending_builds_on_namespace_traversal_ids ON ci_pending_builds USING gin (namespace_traversal_ids);
CREATE INDEX index_gitlab_subscription_histories_on_gitlab_subscription_id ON gitlab_subscription_histories USING btree (gitlab_subscription_id);
@@ -29352,9 +29320,6 @@ ALTER TABLE ONLY design_management_versions
ALTER TABLE ONLY packages_packages
ADD CONSTRAINT fk_c188f0dba4 FOREIGN KEY (creator_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 analytics_cycle_analytics_project_stages
ADD CONSTRAINT fk_c3339bdfc9 FOREIGN KEY (stage_event_hash_id) REFERENCES analytics_cycle_analytics_stage_event_hashes(id) ON DELETE CASCADE;