mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-17 17:27:57 +00:00
Add lib/, t/lib/, and sandbox/. All modules are updated and passing on MySQL 5.1.
This commit is contained in:
40
t/lib/samples/ForeignKeyIterator/fktbls002.sql
Normal file
40
t/lib/samples/ForeignKeyIterator/fktbls002.sql
Normal file
@@ -0,0 +1,40 @@
|
||||
--
|
||||
-- Database: test
|
||||
--
|
||||
|
||||
--
|
||||
-- data
|
||||
-- |
|
||||
-- +--> data_report
|
||||
-- |
|
||||
-- +--> entity
|
||||
--
|
||||
|
||||
CREATE TABLE `data_report` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`date` date DEFAULT NULL,
|
||||
`posted` datetime DEFAULT NULL,
|
||||
`acquired` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `date` (`date`,`posted`,`acquired`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE `entity` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`entity_property_1` varchar(16) DEFAULT NULL,
|
||||
`entity_property_2` varchar(16) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `entity_property_1` (`entity_property_1`,`entity_property_2`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
CREATE TABLE `data` (
|
||||
`data_report` int(11) NOT NULL DEFAULT '0',
|
||||
`hour` tinyint(4) NOT NULL DEFAULT '0',
|
||||
`entity` int(11) NOT NULL DEFAULT '0',
|
||||
`data_1` varchar(16) DEFAULT NULL,
|
||||
`data_2` varchar(16) DEFAULT NULL,
|
||||
PRIMARY KEY (`data_report`,`hour`,`entity`),
|
||||
KEY `entity` (`entity`),
|
||||
CONSTRAINT `data_ibfk_1` FOREIGN KEY (`data_report`) REFERENCES `data_report` (`id`),
|
||||
CONSTRAINT `data_ibfk_2` FOREIGN KEY (`entity`) REFERENCES `entity` (`id`)
|
||||
) ENGINE=InnoDB;
|
Reference in New Issue
Block a user