ALTER TABLE `recipes` ADD `recipe_filter` INT(11) NULL DEFAULT NULL AFTER `recipe_updated`;

CREATE TABLE `filters_1` (
  `filter_1_id` int(11) NOT NULL,
  `filter_1_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `filter_1_slug` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `filter_1_category` int(11) DEFAULT NULL,
  `filter_1_filter` int(11) DEFAULT NULL,
  `filter_1_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `filter_1_updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `filter_1_author` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;

ALTER TABLE `filters_1`
  ADD PRIMARY KEY (`filter_1_id`),
  ADD UNIQUE KEY `filter_1_slug` (`filter_1_slug`);

ALTER TABLE `filters_1`
  MODIFY `filter_1_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

ALTER TABLE `recipes` ADD `recipe_filter_1` INT(11) NULL DEFAULT NULL AFTER `recipe_filter`;

ALTER TABLE `recipes` ADD `recipe_cepages` JSON DEFAULT NULL AFTER `recipe_filter_1`;

CREATE TABLE `cepages` (
 `cepage_id` int(11) NOT NULL AUTO_INCREMENT,
 `cepage_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `cepage_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
 `cepage_updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
 PRIMARY KEY (`cepage_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT

CREATE TABLE `filters_2` (
  `filter_2_id` int(11) NOT NULL,
  `filter_2_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `filter_2_category` int(11) DEFAULT NULL,
  `filter_2_filter` int(11) DEFAULT NULL,
  `filter_2_filter_1` int(11) DEFAULT NULL,
  `filter_2_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `filter_2_updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `filter_2_author` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;

ALTER TABLE `filters_2`
  ADD PRIMARY KEY (`filter_2_id`);

ALTER TABLE `filters_2`
  MODIFY `filter_2_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

ALTER TABLE `recipes` ADD `recipe_filter_2` INT(11) NULL DEFAULT NULL AFTER `recipe_filter_1`;

CREATE TABLE `filters_3` (
  `filter_3_id` int(11) NOT NULL,
  `filter_3_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `filter_3_category` int(11) DEFAULT NULL,
  `filter_3_filter` int(11) DEFAULT NULL,
  `filter_3_filter_1` int(11) DEFAULT NULL,
  `filter_3_filter_2` int(11) DEFAULT NULL,
  `filter_3_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `filter_3_updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `filter_3_author` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;

ALTER TABLE `filters_3`
  ADD PRIMARY KEY (`filter_3_id`);

ALTER TABLE `filters_3`
  MODIFY `filter_3_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

ALTER TABLE `recipes` ADD `recipe_filter_3` INT(11) NULL DEFAULT NULL AFTER `recipe_filter_2`;

ALTER TABLE `recipes` ADD `recipe_filter_3` INT(11) NULL DEFAULT NULL AFTER `recipe_filter_2`;

CREATE TABLE `contenant` (
 `contenant_id` int(11) NOT NULL AUTO_INCREMENT,
 `contenant_title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
 `contenant_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
 `contenant_updated` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
 PRIMARY KEY (`contenant_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT
