|
|
@ -3,6 +3,7 @@ |
|
|
|
* The database setup in config.php is required to perform then relevant tests: |
|
|
|
* The database setup in config.php is required to perform then relevant tests: |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS tbl_composite_fk; |
|
|
|
DROP TABLE IF EXISTS tbl_order_item; |
|
|
|
DROP TABLE IF EXISTS tbl_order_item; |
|
|
|
DROP TABLE IF EXISTS tbl_item; |
|
|
|
DROP TABLE IF EXISTS tbl_item; |
|
|
|
DROP TABLE IF EXISTS tbl_order; |
|
|
|
DROP TABLE IF EXISTS tbl_order; |
|
|
@ -76,6 +77,14 @@ CREATE TABLE `tbl_type` ( |
|
|
|
`bool_col2` smallint DEFAULT 1 |
|
|
|
`bool_col2` smallint DEFAULT 1 |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CREATE TABLE `tbl_composite_fk` ( |
|
|
|
|
|
|
|
`id` int(11) NOT NULL, |
|
|
|
|
|
|
|
`order_id` int(11) NOT NULL, |
|
|
|
|
|
|
|
`item_id` int(11) NOT NULL, |
|
|
|
|
|
|
|
PRIMARY KEY (`id`), |
|
|
|
|
|
|
|
CONSTRAINT `FK_composite_fk_order_item` FOREIGN KEY (`order_id`,`item_id`) REFERENCES `tbl_order_item` (`order_id`,`item_id`) ON DELETE CASCADE |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
INSERT INTO tbl_customer (email, name, address, status) VALUES ('user1@example.com', 'user1', 'address1', 1); |
|
|
|
INSERT INTO tbl_customer (email, name, address, status) VALUES ('user1@example.com', 'user1', 'address1', 1); |
|
|
|
INSERT INTO tbl_customer (email, name, address, status) VALUES ('user2@example.com', 'user2', 'address2', 1); |
|
|
|
INSERT INTO tbl_customer (email, name, address, status) VALUES ('user2@example.com', 'user2', 'address2', 1); |
|
|
|
INSERT INTO tbl_customer (email, name, address, status) VALUES ('user3@example.com', 'user3', 'address3', 2); |
|
|
|
INSERT INTO tbl_customer (email, name, address, status) VALUES ('user3@example.com', 'user3', 'address3', 2); |
|
|
|