[ADD]organization add num_teams

This commit is contained in:
2021-02-02 14:21:02 +08:00
parent 1e70764d63
commit ddaca5bafc
6 changed files with 82 additions and 70 deletions

View File

@@ -14,6 +14,7 @@
# updated_at :datetime not null
# num_projects :integer default("0")
# num_users :integer default("0")
# num_teams :integer default("0")
#
# Indexes
#
@@ -25,6 +26,7 @@ class OrganizationExtension < ApplicationRecord
belongs_to :organization
has_many :organization_users, foreign_key: :organization_id, primary_key: :organization_id
has_many :projects, foreign_key: :user_id, primary_key: :organization_id
has_many :teams, foreign_key: :organization_id, primary_key: :organization_id
enum visibility: {common: 0, limited: 1, privacy: 2}