Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE IF NOT EXISTS `mydb`.`properties_posts_rel` (
- `post_id` INT UNSIGNED NOT NULL,
- `property_id` INT UNSIGNED NOT NULL,
- PRIMARY KEY (`post_id`, `property_id`),
- INDEX `rel_property_idx` (`property_id` ASC),
- CONSTRAINT `rel_property`
- FOREIGN KEY (`property_id`)
- REFERENCES `mydb`.`properties` (`property_id`)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION,
- CONSTRAINT `rel_post`
- FOREIGN KEY (`post_id`)
- REFERENCES `mydb`.`posts` (`post_id`)
- ON DELETE NO ACTION
- ON UPDATE NO ACTION)
- ENGINE = InnoDB;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement