Column | Type | Options |
---|---|---|
name | string | null: false |
string | null: false, unique: true | |
password | string | null: false |
- has_many :messages
- has_many :members
- has_many :groups, through: :members
Column | Type | Options |
---|---|---|
name | string | null: false |
master_user_id | integer | null: false, foreign_key: true |
- has_many :users
- has_many :members
- has_many :users, through: :members
userとgroupの中間テーブル
Column | Type | Options |
---|---|---|
user_id | integer | null: false, foreign_key: true |
group_id | integer | null: false, foreign_key: true |
- belongs_to :user
- belongs_to :group
Column | Type | Options |
---|---|---|
timestamps | datetime | null: false |
body | string | |
image | string | |
user_id | integer | null: false, foreign_key: true |
group_id | integer | null: false, foreign_key: true |
- belongs_to :user
- belongs_to :group