Chatwoot/app/models/team_member.rb
Sojan Jose 74fdfffe08
fix: Notification page breakages (#5236)
- Remove the cascading foreign key indexes
- Add migration to clean up existing objects

fixes: #4285
2022-08-10 13:46:46 +02:00

21 lines
605 B
Ruby

# == Schema Information
#
# Table name: team_members
#
# id :bigint not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# team_id :bigint not null
# user_id :bigint not null
#
# Indexes
#
# index_team_members_on_team_id (team_id)
# index_team_members_on_team_id_and_user_id (team_id,user_id) UNIQUE
# index_team_members_on_user_id (user_id)
#
class TeamMember < ApplicationRecord
belongs_to :user
belongs_to :team
validates :user_id, uniqueness: { scope: :team_id }
end