SQL

CREATE TABLE `drafts`  (
  `id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
  `matchday_id` integer NOT NULL,
  `status` text DEFAULT 'pending' NOT NULL,
  `current_round` integer DEFAULT 1 NOT NULL,
  `opened_at` text,
  `closed_at` text,
  FOREIGN KEY (`matchday_id`) REFERENCES `matchdays`(`id`) ON UPDATE no action ON DELETE no action
)

+ Add column

Columns

Column Data type Allow null Primary key Actions
id INTEGER Rename | Drop
matchday_id INTEGER Rename | Drop
status TEXT Rename | Drop
current_round INTEGER Rename | Drop
opened_at TEXT Rename | Drop
closed_at TEXT Rename | Drop

Foreign Keys

Column Destination
matchday_id matchdays.id

+ Add index

Indexes

Name Columns Unique SQL Drop?
drafts_matchday_id_unique matchday_id SQL
CREATE UNIQUE INDEX `drafts_matchday_id_unique`
ON `drafts` (`matchday_id`)
Drop