14 lines
485 B
SQL
14 lines
485 B
SQL
CREATE TABLE `rabbit_events` (
|
|
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
|
|
`rabbit_id` integer NOT NULL,
|
|
`type` text NOT NULL,
|
|
`event_date` text NOT NULL,
|
|
`title` text NOT NULL,
|
|
`notes` text,
|
|
`show_class` text,
|
|
`placement` text,
|
|
`created_at` text DEFAULT (current_timestamp) NOT NULL,
|
|
FOREIGN KEY (`rabbit_id`) REFERENCES `rabbits`(`id`) ON UPDATE no action ON DELETE cascade,
|
|
CONSTRAINT "event_type_check" CHECK("rabbit_events"."type" in ('show', 'sale', 'other'))
|
|
);
|