SQL
CREATE TABLE `draft_bids` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`draft_id` integer NOT NULL,
`round` integer DEFAULT 1 NOT NULL,
`manager_id` integer NOT NULL,
`player_id` integer NOT NULL,
`amount` real NOT NULL,
`status` text DEFAULT 'sealed' NOT NULL,
`created_at` text DEFAULT (datetime('now')),
FOREIGN KEY (`draft_id`) REFERENCES `drafts`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`manager_id`) REFERENCES `managers`(`id`) ON UPDATE no action ON DELETE no action,
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON UPDATE no action ON DELETE no action
)
+ Add column
Columns
Foreign Keys
| Column |
Destination |
player_id |
players.id |
manager_id |
managers.id |
draft_id |
drafts.id |
+ Add index
Indexes
| Name |
Columns |
Unique |
SQL |
Drop? |
| idx_bid_draft_round |
|
|
SQL
CREATE INDEX `idx_bid_draft_round`
ON `draft_bids` (`draft_id`,`round`)
|
Drop
|