SQL

CREATE TABLE "nomination"  (
  "message_id" text primary key,
  "game_category_id" text not null references "game" ("category_id") on delete cascade,
  "channel_id" text not null,
  "nominee_id" text not null,
  "nominator_id" text not null,
  "day" integer not null,
  "time_of_nomination" text not null,
  "voting_window" real not null,
  "majority" integer not null,
  constraint "fk_nomination_nominee" foreign key ("nominee_id", "game_category_id") references "player" ("id", "game_category_id") on delete cascade,
  constraint "fk_nomination_nominator" foreign key ("nominator_id", "game_category_id") references "player" ("id", "game_category_id") on delete cascade
)

+ Add column

Columns

Column Data type Allow null Primary key Actions
message_id TEXT Rename | Drop
game_category_id TEXT Rename | Drop
channel_id TEXT Rename | Drop
nominee_id TEXT Rename | Drop
nominator_id TEXT Rename | Drop
day INTEGER Rename | Drop
time_of_nomination TEXT Rename | Drop
voting_window REAL Rename | Drop
majority INTEGER Rename | Drop

Foreign Keys

Column Destination
nominator_id player.id
game_category_id player.game_category_id
nominee_id player.id
game_category_id player.game_category_id
game_category_id game.category_id

+ Add index

Indexes

Name Columns Unique SQL Drop?
sqlite_autoindex_nomination_1 message_id SQL
-- no sql found --
Drop