新增:绑定仓库和webhook触发地址

This commit is contained in:
2024-04-16 17:15:22 +08:00
parent 04e70b3b34
commit e358e3b6f6
11 changed files with 268 additions and 1 deletions

View 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

View 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

View 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

View 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