mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
新增:绑定仓库和webhook触发地址
This commit is contained in:
22
app/models/sync_repositories/gitee.rb
Normal file
22
app/models/sync_repositories/gitee.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: sync_repositories
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# project_id :integer
|
||||
# type :string(255)
|
||||
# repo_name :string(255)
|
||||
# external_repo_address :string(255)
|
||||
# sync_granularity :integer
|
||||
# sync_direction :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_sync_repositories_on_project_id (project_id)
|
||||
#
|
||||
|
||||
class SyncRepositories::Gitee < SyncRepository
|
||||
|
||||
end
|
||||
21
app/models/sync_repositories/github.rb
Normal file
21
app/models/sync_repositories/github.rb
Normal file
@@ -0,0 +1,21 @@
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: sync_repositories
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# project_id :integer
|
||||
# type :string(255)
|
||||
# repo_name :string(255)
|
||||
# external_repo_address :string(255)
|
||||
# sync_granularity :integer
|
||||
# sync_direction :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_sync_repositories_on_project_id (project_id)
|
||||
#
|
||||
|
||||
class SyncRepositories::Github < SyncRepository
|
||||
end
|
||||
25
app/models/sync_repository.rb
Normal file
25
app/models/sync_repository.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: sync_repositories
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# project_id :integer
|
||||
# type :string(255)
|
||||
# repo_name :string(255)
|
||||
# external_repo_address :string(255)
|
||||
# sync_granularity :integer
|
||||
# sync_direction :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_sync_repositories_on_project_id (project_id)
|
||||
#
|
||||
|
||||
class SyncRepository < ApplicationRecord
|
||||
|
||||
belongs_to :project
|
||||
|
||||
validates :repo_name, uniqueness: { message: "已存在" }
|
||||
end
|
||||
23
app/models/sync_repository_branch.rb
Normal file
23
app/models/sync_repository_branch.rb
Normal file
@@ -0,0 +1,23 @@
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: sync_repository_branches
|
||||
#
|
||||
# id :integer not null, primary key
|
||||
# sync_repository_id :integer
|
||||
# gitlink_branch_name :string(255)
|
||||
# external_branch_name :string(255)
|
||||
# sync_time :datetime
|
||||
# sync_status :integer default("0")
|
||||
# reposync_branch_id :integer
|
||||
# created_at :datetime not null
|
||||
# updated_at :datetime not null
|
||||
#
|
||||
# Indexes
|
||||
#
|
||||
# index_sync_repository_branches_on_sync_repository_id (sync_repository_id)
|
||||
#
|
||||
|
||||
class SyncRepositoryBranch < ApplicationRecord
|
||||
|
||||
belongs_to :sync_repository
|
||||
end
|
||||
Reference in New Issue
Block a user