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:
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20230602063059_remove_broadcast_messages_namespace_id_column.rb19
-rw-r--r--db/schema_migrations/202306020630591
-rw-r--r--db/structure.sql5
3 files changed, 21 insertions, 4 deletions
diff --git a/db/post_migrate/20230602063059_remove_broadcast_messages_namespace_id_column.rb b/db/post_migrate/20230602063059_remove_broadcast_messages_namespace_id_column.rb
new file mode 100644
index 00000000000..ad7e23b7cb1
--- /dev/null
+++ b/db/post_migrate/20230602063059_remove_broadcast_messages_namespace_id_column.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class RemoveBroadcastMessagesNamespaceIdColumn < Gitlab::Database::Migration[2.1]
+ disable_ddl_transaction!
+
+ INDEX_NAME = 'index_broadcast_messages_on_namespace_id'
+
+ def up
+ remove_column :broadcast_messages, :namespace_id
+ end
+
+ def down
+ # rubocop:disable Migration/SchemaAdditionMethodsNoPost
+ add_column :broadcast_messages, :namespace_id, :bigint unless column_exists?(:broadcast_messages, :namespace_id)
+ # rubocop:enable Migration/SchemaAdditionMethodsNoPost
+
+ add_concurrent_index :broadcast_messages, :namespace_id, name: INDEX_NAME
+ end
+end
diff --git a/db/schema_migrations/20230602063059 b/db/schema_migrations/20230602063059
new file mode 100644
index 00000000000..53ae46fb8f5
--- /dev/null
+++ b/db/schema_migrations/20230602063059
@@ -0,0 +1 @@
+915530f0de68a448bb9c88572896dc0979a38b5624dc5006811a4c635e35c71e \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index 7f46cc56198..9856a06a66f 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -12761,8 +12761,7 @@ CREATE TABLE broadcast_messages (
broadcast_type smallint DEFAULT 1 NOT NULL,
dismissable boolean,
target_access_levels integer[] DEFAULT '{}'::integer[] NOT NULL,
- theme smallint DEFAULT 0 NOT NULL,
- namespace_id bigint
+ theme smallint DEFAULT 0 NOT NULL
);
CREATE SEQUENCE broadcast_messages_id_seq
@@ -29976,8 +29975,6 @@ CREATE INDEX index_boards_on_project_id ON boards USING btree (project_id);
CREATE INDEX index_broadcast_message_on_ends_at_and_broadcast_type_and_id ON broadcast_messages USING btree (ends_at, broadcast_type, id);
-CREATE INDEX index_broadcast_messages_on_namespace_id ON broadcast_messages USING btree (namespace_id);
-
CREATE INDEX index_btree_namespaces_traversal_ids ON namespaces USING btree (traversal_ids);
CREATE INDEX index_bulk_import_batch_trackers_on_tracker_id ON bulk_import_batch_trackers USING btree (tracker_id);