-- +migrate Up
CREATE TABLE `category_products` (
    `category_id` INT NOT NULL,
    `product_id` INT NOT NULL,
    PRIMARY KEY (`category_id`, `product_id`),
    FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE,
    FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_persian_ci;

-- +migrate Down
DROP TABLE IF EXISTS `category_products`;
