使用イメージGIF:
https://gyazo.com/01b0e38aa4b6793fa3dd61b947af47b1
Column |
Type |
Options |
name |
string |
null: false, index: true |
email |
string |
null: false, unique: true |
- has_many :groups, through: group_users
- has_many :group_users
- has_many :messages
Column |
Type |
Options |
name |
string |
null: false, unique: true |
- has_many :users, through: group_users
- has_many :group_users
- has_many :messages
Column |
Type |
Options |
user_id |
references |
null: false, index: true, foreign_key: true |
group_id |
references |
null: false, index: true, foreign_key: true |
- belongs_to :user
- belongs_to :group
Column |
Type |
Options |
content |
text |
null: false |
image |
string |
|
user_id |
integer |
null: false, index: true, foreign_key: true |
group_id |
integer |
null: false, index: true, foreign_key: true |
- belongs_to :user
- belongs_to :group