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
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-10-19 15:57:54 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-10-19 15:57:54 +0300
commit419c53ec62de6e97a517abd5fdd4cbde3a942a34 (patch)
tree1f43a548b46bca8a5fb8fe0c31cef1883d49c5b6 /db/migrate/20230915103259_create_ci_finished_build_ch_sync_events.rb
parent1da20d9135b3ad9e75e65b028bffc921aaf8deb7 (diff)
Add latest changes from gitlab-org/gitlab@16-5-stable-eev16.5.0-rc42
Diffstat (limited to 'db/migrate/20230915103259_create_ci_finished_build_ch_sync_events.rb')
-rw-r--r--db/migrate/20230915103259_create_ci_finished_build_ch_sync_events.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/db/migrate/20230915103259_create_ci_finished_build_ch_sync_events.rb b/db/migrate/20230915103259_create_ci_finished_build_ch_sync_events.rb
new file mode 100644
index 00000000000..718fd49f5c0
--- /dev/null
+++ b/db/migrate/20230915103259_create_ci_finished_build_ch_sync_events.rb
@@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+class CreateCiFinishedBuildChSyncEvents < Gitlab::Database::Migration[2.1]
+ def change
+ options = {
+ primary_key: [:build_id, :partition],
+ options: 'PARTITION BY LIST (partition)'
+ }
+
+ create_table(:p_ci_finished_build_ch_sync_events, **options) do |t|
+ # Do not bother with foreign key as it provides not benefit and has a performance cost. These get cleaned up over
+ # time anyway.
+ t.bigint :build_id, null: false
+ t.bigint :partition, null: false, default: 1
+ # rubocop: disable Migration/Datetime
+ # The source for this field does not have a timezone
+ t.datetime :build_finished_at, null: false
+ # rubocop: enable Migration/Datetime
+ t.boolean :processed, null: false, default: false
+
+ t.index '(build_id % 100), build_id',
+ where: 'processed = FALSE',
+ name: 'index_ci_finished_build_ch_sync_events_for_partitioned_query'
+ end
+ end
+end