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