erDiagram
castles ||--|{ restaurants : ""
"users(余裕があれば)" ||--o{ "fell_castles(余裕があれば)" : ""
"fell_castles(余裕があれば)" ||--|| castles : ""
castles }|--|| castle_distances : ""
"users(余裕があれば)"{
bigint id PK
varchar name
barchar password
}
"fell_castles(余裕があれば)"{
bigint id PK
bigint user_id FK
bigint castle_id FK
timestamp created_at
}
castles {
bigint id PK
varchar name
varchar prefecture "都道府県"
float lat "緯度(北緯)"
float lng "経度(東経)"
varchar holiday "定休日"
varchar admission_time "入場可能時間"
bigint admission_fee "入場料"
varchar stamp "スタンプ設置場所"
}
restaurants {
bigint id PK
bigint castle_id FK
varchar name
varchar time "営業時間"
varchar holiday "定休日"
varchar genre "ジャンル"
varchar url
}
castle_distances {
bigint id PK
bigint castle_id1 FK
bigint castle_id2 FK
double direct_distance "直線距離"
double way_distance "道のりの距離"
datetime time "GoogleMap APIから取得したもの"
}