[ADD]组织模块相关代码

This commit is contained in:
2021-01-11 17:44:11 +08:00
parent 178991b245
commit 2434ca9681
36 changed files with 655 additions and 1 deletions

View File

@@ -0,0 +1,11 @@
class CreateOrganizationUsers < ActiveRecord::Migration[5.2]
def change
create_table :organization_users do |t|
t.references :user
t.references :organization
t.boolean :is_creator, comment: "是否为创建者", default: false
t.timestamps
end
end
end

View File

@@ -0,0 +1,15 @@
class CreateOrganizationExtensions < ActiveRecord::Migration[5.2]
def change
create_table :organization_extensions do |t|
t.references :organization
t.string :description, comment: "组织描述"
t.string :website, comment: "组织官方网站"
t.string :location, comment: "组织地区"
t.boolean :repo_admin_change_team_access, comment: "项目管理员是否可以添加或移除团队的访问权限", default: false
t.integer :visibility, comment: "组织可见性", default: 0
t.integer :max_repo_creation, comment: "组织最大仓库数", default: -1
t.timestamps
end
end
end

View File

@@ -0,0 +1,17 @@
class CreateTeams < ActiveRecord::Migration[5.2]
def change
create_table :teams do |t|
t.references :organization
t.string :name, comment: "团队名称"
t.string :description, comment: "团队描述"
t.integer :authorize, comment: "团队权限", default: 0
t.integer :num_projects, comment: "团队项目数量", default: 0
t.integer :num_users, comment: "团队成员数量", default: 0
t.boolean :includes_all_project, comment: "团队是否拥有所有项目", default: false
t.boolean :can_create_org_project, comment: "团队是否能创建项目", default: false
t.integer :gtid, comment: "团队在gitea里的id"
t.timestamps
end
end
end

View File

@@ -0,0 +1,11 @@
class CreateTeamProjects < ActiveRecord::Migration[5.2]
def change
create_table :team_projects do |t|
t.references :organization
t.references :project
t.references :team
t.timestamps
end
end
end

View File

@@ -0,0 +1,10 @@
class CreateTeamUsers < ActiveRecord::Migration[5.2]
def change
create_table :team_users do |t|
t.references :organization
t.references :team
t.references :user
t.timestamps
end
end
end

View File

@@ -0,0 +1,11 @@
class CreateTeamUnits < ActiveRecord::Migration[5.2]
def change
create_table :team_units do |t|
t.references :organization
t.references :team
t.integer :unit_type, comment: "访问单元类型"
t.timestamps
end
end
end