# Проєктування бази даних
## BE модель
@startuml
entity Account <>
entity Account.username <>
entity Account.password <>
entity Survey <>
entity Survey.name <>
entity Survey.duration <>
entity Survey.isPaused <>
entity Survey.isNamed <>
entity Question <>
entity Question.text <>
entity Responce <>
entity Responce.value <>
entity Link <>
entity Link.usageLimit
entity Link.responceLimit
entity Link.uses
entity Link.responces
entity Link.path
Account.username --* Account
Account.password --* Account
Survey.name --* Survey
Survey.duration --* Survey
Survey.isPaused --* Survey
Survey.isNamed --* Survey
Link.usageLimit -u-* Link
Link.responceLimit -u-* Link
Link.uses --* Link
Link.responces --* Link
Link.path -u-* Link
Responce.value -u-* Responce
Question.text -u-* Question
Account "1,1" -- "0,*" Survey
Survey "1,1" -- "0,*" Question
Question "1,1" -r- "0,*" Responce
Account "0,1" -r- "0,*" Responce
Link "0,*" -- "1,1" Survey
@enduml
## ER-модель
@startuml
entity Account <> {
id:INT
username:CHAR(64)
password:CHAR(256)
}
entity Responce <> {
id:INT
value:CHAR(16384)
}
entity Question <> {
id:INT
text:CHAR(256)
}
entity Survey <> {
id:INT
name:CHAR(256)
duration:CHAR(256)
isPaused:BOOLEAN
isNamed:BOOLEAN
}
entity Link <> {
id:INT
uses:INT
responces:INT
usageLimit:INT
responceLimit:INT
path:CHAR(32)
}
Responce "0,*" --> "1,1" Question
Question "0,*" --> "1,1" Survey
Survey "0,*" --> "1,1" Account
Link "0,*" --> "1,1" Survey
Responce "0,*" --> "0,1" Account
@enduml