DROP TABLE IF EXISTS `category`;
CREATE TABLE `category` (
                            `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
                            `name` VARCHAR(255) NOT NULL,
                            PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ;


DROP TABLE IF EXISTS `category_articles`;
CREATE TABLE `category_articles` (
                                     `article_id` INT UNSIGNED NOT NULL,
                                     `category_id` INT UNSIGNED NOT NULL,
                                     PRIMARY KEY (`article_id`, `category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ;


DROP TABLE IF EXISTS `comment`;
CREATE TABLE `comment` (
                           `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
                           `author` VARCHAR(32) NULL DEFAULT NULL,
                           `text` TEXT NULL DEFAULT NULL,
                           `article_id` INT UNSIGNED NULL DEFAULT NULL,
                           PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ;


DROP TABLE IF EXISTS `news`;
CREATE TABLE `news` (
                        `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
                        `title` VARCHAR(50) NULL DEFAULT NULL,
                        `description` VARCHAR(255) NULL DEFAULT NULL,
                        `text` TEXT NULL DEFAULT NULL,
                        PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ;


DROP TABLE IF EXISTS `order`;
CREATE TABLE `order` (
                         `id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
                         `product_name` VARCHAR(50) NOT NULL,
                         `bill_forename` VARCHAR(50) NOT NULL,
                         `bill_surname` VARCHAR(50) NOT NULL,
                         `delivery_forename` VARCHAR(50) NULL DEFAULT NULL,
                         `delivery_surname` VARCHAR(50) NULL DEFAULT NULL,
                         PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci ;