Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE IF NOT EXISTS `tip` (
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
- `ticket_id` bigint(20) NOT NULL,
- `opportunity_id` bigint(20) NOT NULL,
- `opportunity_possible_result_id` bigint(20) NOT NULL,
- `resolution_id` smallint(6) NOT NULL,
- PRIMARY KEY (`id`),
- KEY `fk_tip_ticket_id_ticket_id` (`ticket_id`),
- KEY `fk_tip_opportunity_id_opportunity_id_idx` (`opportunity_id`),
- KEY `fk_tip_opportunity_pr_id_opportunity_pr_id_idx` (`opportunity_possible_result_id`),
- KEY `fk_tip_resolution_id_resolution_id_idx` (`resolution_id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=3 ;
- INSERT INTO `tip` (`id`, `ticket_id`, `opportunity_id`, `opportunity_possible_result_id`, `resolution_id`) VALUES
- (1, 1, 11, 63, 1),
- (2, 2, 11, 53, 1);
- --
- -- Omezení
- --
- ALTER TABLE `tip`
- ADD CONSTRAINT `fk_tip_opportunity_id_opportunity_id` FOREIGN KEY (`opportunity_id`) REFERENCES `opportunity` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
- ADD CONSTRAINT `fk_tip_opportunity_pr_id_opportunity_pr_id` FOREIGN KEY (`opportunity_possible_result_id`) REFERENCES `opportunity_possible_result` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
- ADD CONSTRAINT `fk_tip_resolution_id_resolution_id` FOREIGN KEY (`resolution_id`) REFERENCES `resolution` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
- ADD CONSTRAINT `fk_tip_ticket_id_ticket_id` FOREIGN KEY (`ticket_id`) REFERENCES `ticket` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
Advertisement
Add Comment
Please, Sign In to add comment