[RUBY] Zero database design until Secretsantas is created

Database design Note: --For many-to-many, foreign keys in the intermediate table --For many-to-one, foreign key (foreign key for those with more)

users table

Column Type Options
nickname string null: false,unique: true
first_name string null: false
last_name string null: false
first_name_kana string null: false
last_name_kana string null: false
birthday date null: false
image text null: false
email string null: false,default: "", unique: true
password string null: false,default: ""

Association

address table

Column Type Options
zipcode integer null: false
prefecture_code integer null: false
city string null: false
district string null: false
building string
room date
user references foreign_key: true

Association

posts table

Column Type Options
description text null: false
image text null: false

Association

categories table

Column Type Options
name text null: false

Association

groups table

Column Type Options
name string null: false
budget integer null: false
exchange_date date null: false

Association

messages table

Column Type Options
content text null: false
image text null: false|
user references foreign_key: true
group references foreign_key: true

Association

<! ------------->

posts_categories table

Column Type Options
post references foreign_key: true
category references foreign_key: true

Association

groups_users table

Column Type Options
group references foreign_key: true
user references foreign_key: true

Association

posts_users table

Column Type Options
user references foreign_key: true
category references foreign_key: true

Association

Recommended Posts

Zero database design until Secretsantas is created
Until Secretsantas is created ③ post function (CRUD)
Until Secretsantas is made ② Top page