SQL

CREATE TABLE "voter"  (
  "player_id" text not null,
  "game_category_id" text not null,
  "nomination_message_id" text not null references "nomination" ("message_id") on delete cascade,
  "vote_type" text not null,
  constraint "voter_primary_key" primary key ("player_id", "game_category_id", "nomination_message_id"),
  constraint "fk_voter_player" foreign key ("player_id", "game_category_id") references "player" ("id", "game_category_id") on delete cascade
)

+ Add column

Columns

Column Data type Allow null Primary key Actions
player_id TEXT Rename | Drop
game_category_id TEXT Rename | Drop
nomination_message_id TEXT Rename | Drop
vote_type TEXT Rename | Drop

Foreign Keys

Column Destination
player_id player.id
game_category_id player.game_category_id
nomination_message_id nomination.message_id

+ Add index

Indexes

Name Columns Unique SQL Drop?
sqlite_autoindex_voter_1
  • player_id
  • game_category_id
  • nomination_message_id
SQL
-- no sql found --
Drop