tanacchi / line_akinator

LINE Bot でアキネーターを実装してみた.
https://tanakinator.herokuapp.com/
MIT License
4 stars 1 forks source link

データベース設計草案 #3

Closed tanacchi closed 4 years ago

tanacchi commented 4 years ago

SQLAlchemy でカラムを追加したりするのが面倒だった(ような気がするの)ので
予めしっかり目に設計を考えておく.

image

PlantUML Web Server

表の形式は以下の通り

column_name | type | example
--- | --- | ---
 |  |  
tanacchi commented 4 years ago

UserStatus

column_name type example
id Integer, primary_key 1
user_id String(80) aHIyBichUNi
status String(80) "playing"
progress Integer, primary_key, allow_null -

"pending" は「該当する user_id が存在しない」場合とする

Progress

column_name type example
id Integer, primary_key 1
answers relationship to many Answers -
latest_question Integer, primary_key, allow_null -
candidates relationship to many Solutions -
tanacchi commented 4 years ago

Question

column_name type example
id Integer, primary_key 2
message String(200) プロ研のメンバーですか?
features relationship to many Features -
tanacchi commented 4 years ago

Solution

column_name type example
id Integer, primary_key 3
name String(80) tanacchi
features relationship to many Features -
tanacchi commented 4 years ago

Feature

column_name type example
id Integer, primary_key 5
question relationship to one Question -
solution relationship to one Solution -
value Float 1.0
tanacchi commented 4 years ago

Answer

column_name type example
question relationship to one Question -
value Float 1.0
tanacchi commented 4 years ago

確定したので閉じます