Skip to content

ID from external service has been used for database #307

Description

@hexium310

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
    }
Loading

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions