mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-25 13:46:22 +00:00
Add lib/, t/lib/, and sandbox/. All modules are updated and passing on MySQL 5.1.
This commit is contained in:
18
t/lib/samples/sakila.rental.null.sql
Normal file
18
t/lib/samples/sakila.rental.null.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
-- Modified so the customer_id is nullable.
|
||||
CREATE TABLE `rental` (
|
||||
`rental_id` int(11) NOT NULL auto_increment,
|
||||
`rental_date` datetime NOT NULL,
|
||||
`inventory_id` mediumint(8) unsigned NOT NULL,
|
||||
`customer_id` smallint(5) unsigned default NULL,
|
||||
`return_date` datetime default NULL,
|
||||
`staff_id` tinyint(3) unsigned NOT NULL,
|
||||
`last_update` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`rental_id`),
|
||||
UNIQUE KEY `rental_date` (`rental_date`,`inventory_id`,`customer_id`),
|
||||
KEY `idx_fk_inventory_id` (`inventory_id`),
|
||||
KEY `idx_fk_customer_id` (`customer_id`),
|
||||
KEY `idx_fk_staff_id` (`staff_id`),
|
||||
CONSTRAINT `fk_rental_customer` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`) ON UPDATE CASCADE,
|
||||
CONSTRAINT `fk_rental_inventory` FOREIGN KEY (`inventory_id`) REFERENCES `inventory` (`inventory_id`) ON UPDATE CASCADE,
|
||||
CONSTRAINT `fk_rental_staff` FOREIGN KEY (`staff_id`) REFERENCES `staff` (`staff_id`) ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8
|
Reference in New Issue
Block a user