Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Specify sorting criteria manually for a set of records of a many-to-many relationship
- CREATE TABLE `isolator` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
- `name` varchar(127) NOT NULL,
- `surname` varchar(127) NOT NULL,
- PRIMARY KEY (`id`),
- );
- CREATE TABLE `cell` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
- `name` varchar(127) NOT NULL,
- `gen` varchar(127) NOT NULL,
- PRIMARY KEY (`id`),
- );
- CREATE TABLE `cell_isolators` (
- `cell_id` bigint(20) NOT NULL DEFAULT '0',
- `isolator_id` bigint(20) NOT NULL DEFAULT '0',
- PRIMARY KEY (`cell_id`,`isolator_id`),
- CONSTRAINT `cell_isolator_id` FOREIGN KEY (`isolator_id`) REFERENCES `isolator` (`id`),
- CONSTRAINT `isolator_cell_id` FOREIGN KEY (`cell_id`) REFERENCES `cell` (`id`) ON DELETE CASCADE
- );
Add Comment
Please, Sign In to add comment