add: repository webhooks

This commit is contained in:
2021-07-26 17:25:06 +08:00
parent 8905f60265
commit ebc4305ca8
9 changed files with 263 additions and 1 deletions

View File

@@ -4,6 +4,6 @@ class Gitea::PublicKey < Gitea::Base
self.table_name = "public_key"
belongs_to :user, class_name: '::User', foreign_key: :gitea_uid, primary_key: :owner_id, optional: true
belongs_to :user, class_name: '::User', primary_key: :gitea_uid, foreign_key: :owner_id, optional: true
end

View File

@@ -0,0 +1,10 @@
class Gitea::Webhook < Gitea::Base
self.inheritance_column = nil
self.table_name = 'webhook'
belongs_to :project, class_name: "::Project", primary_key: :gpid, foreign_key: :repo_id, optional: true
enum hook_task_type: {gogs: 1, slack: 2, gitea: 3, discord: 4, dingtalk: 5, telegram: 6, msteams: 7, feishu: 8, matrix: 9}
enum last_status: {waiting: 0, succeed: 1, fail: 2}
end