Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Latest commit

 

History

History
53 lines (37 loc) · 1.27 KB

README.md

File metadata and controls

53 lines (37 loc) · 1.27 KB

README

テーブル設計

users テーブル

Column Type Options
name string null: false
email string null: false
encrypted_password string null: false

Association

  • has_many :room_users
  • has_many :rooms, through: :room_users
  • has_many :messages

rooms テーブル

Column Type Options
name string null: false

Association

  • has_many :room_users
  • has_many :users, through: :room_users
  • has_many :messages

room_users テーブル

Column Type Options
user references null: false, foreign_key: true
room references null: false, foreign_key: true

Association

  • belongs_to :user
  • belongs_to :room

messages テーブル

Column Type Options
content string
user references null: false, foreign_key: true
room references null: false, foreign_key: true

Association

  • belongs_to :user
  • belongs_to :room