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/ci/job_annotation.rb')
-rw-r--r--app/models/ci/job_annotation.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/app/models/ci/job_annotation.rb b/app/models/ci/job_annotation.rb
new file mode 100644
index 00000000000..a8bef02cc42
--- /dev/null
+++ b/app/models/ci/job_annotation.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+module Ci
+ class JobAnnotation < Ci::ApplicationRecord
+ include Ci::Partitionable
+
+ self.table_name = :p_ci_job_annotations
+ self.primary_key = :id
+
+ belongs_to :job, class_name: 'Ci::Build', inverse_of: :job_annotations
+
+ partitionable scope: :job, partitioned: true
+
+ validates :data, json_schema: { filename: 'ci_job_annotation_data' }
+ validates :name, presence: true,
+ length: { maximum: 255 },
+ uniqueness: { scope: [:job_id, :partition_id] }
+ end
+end