Skip to content

Commit ced09a2

Browse files
committed
activerecords for team and team_user
1 parent 88f0d73 commit ced09a2

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

app/models/team.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class Team < ApplicationRecord
2+
# == Schema Information
3+
#
4+
# Table name: teams
5+
#
6+
# id :bigint(8) not null, primary key
7+
# name :string not null
8+
#
9+
# Indexes
10+
#
11+
# teams_name_idx (name) UNIQUE
12+
#
13+
end

app/models/team_user.rb

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# == Schema Information
2+
#
3+
# Table name: team_user
4+
#
5+
# team_id :bigint(8) not null, primary key
6+
# user_id :bigint(8) not null, primary key
7+
#
8+
# Indexes
9+
#
10+
# team_id_user_id_unique (team_id,user_id) UNIQUE
11+
#
12+
# Foreign Keys
13+
#
14+
# team_id_fkey (team_id => teams.id)
15+
# user_id_fkey (user_id => users.id)
16+
#
17+
class UserToken < ApplicationRecord
18+
belongs_to :team
19+
belongs_to :user
20+
end

0 commit comments

Comments
 (0)