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:
Diffstat (limited to 'app/models/audit_event.rb')
-rw-r--r--app/models/audit_event.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/audit_event.rb b/app/models/audit_event.rb
index a4d991b040c..d1c0bb11dc8 100644
--- a/app/models/audit_event.rb
+++ b/app/models/audit_event.rb
@@ -4,6 +4,7 @@ class AuditEvent < ApplicationRecord
include CreatedAtFilterable
include BulkInsertSafe
include EachBatch
+ include PartitionedTable
PARALLEL_PERSISTENCE_COLUMNS = [
:author_name,
@@ -15,6 +16,8 @@ class AuditEvent < ApplicationRecord
self.primary_key = :id
+ partitioned_by :created_at, strategy: :monthly
+
serialize :details, Hash # rubocop:disable Cop/ActiveRecordSerialize
belongs_to :user, foreign_key: :author_id