summaryrefslogtreecommitdiff
path: root/app/models/hooks
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 18:18:33 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-16 18:18:33 +0000
commitf64a639bcfa1fc2bc89ca7db268f594306edfd7c (patch)
treea2c3c2ebcc3b45e596949db485d6ed18ffaacfa1 /app/models/hooks
parentbfbc3e0d6583ea1a91f627528bedc3d65ba4b10f (diff)
downloadgitlab-ce-7f049e661d257321a8fa9ac9d5f98ed7494ef266.tar.gz
Add latest changes from gitlab-org/gitlab@13-10-stable-eev13.10.0-rc40
Diffstat (limited to 'app/models/hooks')
-rw-r--r--app/models/hooks/web_hook_log.rb2
-rw-r--r--app/models/hooks/web_hook_log_partitioned.rb17
2 files changed, 19 insertions, 0 deletions
diff --git a/app/models/hooks/web_hook_log.rb b/app/models/hooks/web_hook_log.rb
index 03f1797f4f4..e2230a2d644 100644
--- a/app/models/hooks/web_hook_log.rb
+++ b/app/models/hooks/web_hook_log.rb
@@ -6,6 +6,8 @@ class WebHookLog < ApplicationRecord
include DeleteWithLimit
include CreatedAtFilterable
+ self.primary_key = :id
+
belongs_to :web_hook
serialize :request_headers, Hash # rubocop:disable Cop/ActiveRecordSerialize
diff --git a/app/models/hooks/web_hook_log_partitioned.rb b/app/models/hooks/web_hook_log_partitioned.rb
new file mode 100644
index 00000000000..b4b150afb6a
--- /dev/null
+++ b/app/models/hooks/web_hook_log_partitioned.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+# This model is not yet intended to be used.
+# It is in a transitioning phase while we are partitioning
+# the web_hook_logs table on the database-side.
+# Please refer to https://gitlab.com/groups/gitlab-org/-/epics/5558
+# for details.
+# rubocop:disable Gitlab/NamespacedClass: This is a temporary class with no relevant namespace
+# WebHook, WebHookLog and all hooks are defined outside of a namespace
+class WebHookLogPartitioned < ApplicationRecord
+ include PartitionedTable
+
+ self.table_name = 'web_hook_logs_part_0c5294f417'
+ self.primary_key = :id
+
+ partitioned_by :created_at, strategy: :monthly
+end