You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For now, the users and speakers table uses external service IDs for its primary key. Furthermore, it can insert records that users.spreaker_id specifies an id that doesn't exist in speakers.
erDiagram
users }o--|| speakers : ""
users {
bigint id "user id from Discord"
int speaker_id "speakers.id"
}
speakers {
int id PK "speaker style id from VOICEVOX"
float4 speed
}
Loading
This doesn't look good, so change the structure as below:
Use table own ID for primary key
Set foreign key to users.speaker_id
erDiagram
users }|--|| speakers : ""
users {
uuid id PK
bigint discord_id "user id from Discord"
uuid speaker_id FK "speakers.id"
}
speakers {
uuid id PK
int voicevox_style_id "speaker style id from VOICEVOX"
float4 speed
}
For now, the users and speakers table uses external service IDs for its primary key. Furthermore, it can insert records that users.spreaker_id specifies an id that doesn't exist in speakers.
erDiagram users }o--|| speakers : "" users { bigint id "user id from Discord" int speaker_id "speakers.id" } speakers { int id PK "speaker style id from VOICEVOX" float4 speed }This doesn't look good, so change the structure as below:
erDiagram users }|--|| speakers : "" users { uuid id PK bigint discord_id "user id from Discord" uuid speaker_id FK "speakers.id" } speakers { uuid id PK int voicevox_style_id "speaker style id from VOICEVOX" float4 speed }