diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-02 18:11:07 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-02 18:11:07 +0300 |
commit | e36443c1d657343410d3de25d52ae0fe9ee67d8d (patch) | |
tree | 3a18c9c8efbd20c3799046a2ea77fcbb3bba163f /db | |
parent | ed509186782d16d2bbcb34ac73303e8cb3a9d5a2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20221018124029_add_consume_after_to_ghost_user_migrations.rb | 7 | ||||
-rw-r--r-- | db/migrate/20221018124035_add_consume_after_index_to_ghost_user_migrations.rb | 15 | ||||
-rw-r--r-- | db/schema_migrations/20221018124029 | 1 | ||||
-rw-r--r-- | db/schema_migrations/20221018124035 | 1 | ||||
-rw-r--r-- | db/structure.sql | 5 |
5 files changed, 28 insertions, 1 deletions
diff --git a/db/migrate/20221018124029_add_consume_after_to_ghost_user_migrations.rb b/db/migrate/20221018124029_add_consume_after_to_ghost_user_migrations.rb new file mode 100644 index 00000000000..148c6516dc9 --- /dev/null +++ b/db/migrate/20221018124029_add_consume_after_to_ghost_user_migrations.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddConsumeAfterToGhostUserMigrations < Gitlab::Database::Migration[2.0] + def change + add_column :ghost_user_migrations, :consume_after, :datetime_with_timezone, null: false, default: -> { 'NOW()' } + end +end diff --git a/db/migrate/20221018124035_add_consume_after_index_to_ghost_user_migrations.rb b/db/migrate/20221018124035_add_consume_after_index_to_ghost_user_migrations.rb new file mode 100644 index 00000000000..543d91b3f33 --- /dev/null +++ b/db/migrate/20221018124035_add_consume_after_index_to_ghost_user_migrations.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddConsumeAfterIndexToGhostUserMigrations < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_ghost_user_migrations_on_consume_after_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :ghost_user_migrations, [:consume_after, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ghost_user_migrations, INDEX_NAME + end +end diff --git a/db/schema_migrations/20221018124029 b/db/schema_migrations/20221018124029 new file mode 100644 index 00000000000..6c050ebf248 --- /dev/null +++ b/db/schema_migrations/20221018124029 @@ -0,0 +1 @@ +c3a38f280c8835e77953b69ba41ef5d58b76fd5f2f39e758a523c493306b0ab2
\ No newline at end of file diff --git a/db/schema_migrations/20221018124035 b/db/schema_migrations/20221018124035 new file mode 100644 index 00000000000..1d0721c4bfb --- /dev/null +++ b/db/schema_migrations/20221018124035 @@ -0,0 +1 @@ +77aca033a7c58af4e981136b96629acf5b82a42701072928532681dd91b05280
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index cef651cff2d..45ad50dc5fe 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -15859,7 +15859,8 @@ CREATE TABLE ghost_user_migrations ( initiator_user_id bigint, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - hard_delete boolean DEFAULT false NOT NULL + hard_delete boolean DEFAULT false NOT NULL, + consume_after timestamp with time zone DEFAULT now() NOT NULL ); CREATE SEQUENCE ghost_user_migrations_id_seq @@ -29059,6 +29060,8 @@ 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_ghost_user_migrations_on_consume_after_id ON ghost_user_migrations USING btree (consume_after, id); + CREATE UNIQUE INDEX index_ghost_user_migrations_on_user_id ON ghost_user_migrations USING btree (user_id); CREATE INDEX index_gin_ci_namespace_mirrors_on_traversal_ids ON ci_namespace_mirrors USING gin (traversal_ids); |