· 8 years ago · May 20, 2018, 11:02 AM
1CREATE TABLE IF NOT EXISTS `media_categories` (
2`category_id` INT NOT NULL ,
3`media_id` INT NOT NULL ,
4INDEX `fk_media_categories_1` ( `category_id` ASC ) ,
5INDEX `fk_media_categories_2` ( `media_id` ASC ) ,
6CONSTRAINT `fk_media_categories_1` FOREIGN KEY ( `category_id` ) REFERENCES `categories` (
7`id`
8) ON DELETE NO ACTION ON UPDATE NO ACTION ,
9CONSTRAINT `fk_media_categories_2` FOREIGN KEY ( `media_id` ) REFERENCES `media` (
10`id`
11) ON DELETE NO ACTION ON UPDATE NO ACTION
12) ENGINE = InnoDB;