Open hyunolike opened 1 month ago
h2 준비 완료
erDiagram
Survey {
int survey_id PK
string name
string description
}
Question {
int question_id PK
int survey_id FK
string name
string description
string input_type
boolean is_required
}
Option {
int option_id PK
int question_id FK
string value
}
Response {
int response_id PK
int survey_id FK
date response_date
}
ResponseDetail {
int response_detail_id PK
int response_id FK
int question_id FK
string value
}
Survey ||--o{ Question: "has"
Question ||--o{ Option: "has"
Survey ||--o{ Response: "has"
Response ||--o{ ResponseDetail: "has"
Question ||--o{ ResponseDetail: "applies to"
erDiagram
FORMS ||--o{ QUESTIONS : contains
FORMS {
int id PK
varchar(255) title
text description
datetime created_at
datetime updated_at
boolean is_active
}
QUESTIONS ||--o{ RESPONSES : has
QUESTIONS {
int id PK
int form_id FK
int question_type_id FK
varchar(255) question_text
int order
boolean is_required
text additional_config
}
QUESTION_TYPES ||--o{ QUESTIONS : defines
QUESTION_TYPES {
int id PK
varchar(50) type_name
text config_schema
}
RESPONSES {
int id PK
int question_id FK
int submission_id FK
text response_data
}
SUBMISSIONS ||--o{ RESPONSES : contains
SUBMISSIONS {
int id PK
int form_id FK
datetime submitted_at
varchar(255) respondent_info
}
QUESTION_OPTIONS }o--|| QUESTIONS : has
QUESTION_OPTIONS {
int id PK
int question_id FK
varchar(255) option_text
int order
}
요구사항에 맞춰 ERD 작성