-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 25, 2023 at 11:56 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.3.25

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `rms_enhance`
--

-- --------------------------------------------------------

--
-- Table structure for table `allergy_lists`
--

CREATE TABLE `allergy_lists` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `chefs`
--

CREATE TABLE `chefs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `password` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `cities`
--

CREATE TABLE `cities` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `city_districts`
--

CREATE TABLE `city_districts` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `city_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `components`
--

CREATE TABLE `components` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `component_category_id` bigint(20) UNSIGNED DEFAULT NULL,
  `component_group_id` bigint(20) UNSIGNED DEFAULT NULL,
  `exclude_list_id` bigint(20) UNSIGNED DEFAULT NULL,
  `allergy_list_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `img` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `brand` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'Fresh',
  `measuringunit` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `purchaseunit` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `wastage` double DEFAULT 0,
  `increase` double DEFAULT 0,
  `decrease` double DEFAULT 0,
  `minimum` double DEFAULT 0,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `cholosterol` double DEFAULT 0,
  `sodium` double DEFAULT 0,
  `fiber` double DEFAULT 0,
  `sugar` double DEFAULT 0,
  `vitaminc` double DEFAULT 0,
  `vitamina` double DEFAULT 0,
  `calcium` double DEFAULT 0,
  `iron` double DEFAULT 0,
  `box_quantity` double DEFAULT 0,
  `quantity` double DEFAULT 0,
  `price` double DEFAULT 0,
  `status` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'show',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `component_categories`
--

CREATE TABLE `component_categories` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `purchase_limit` double UNSIGNED DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `component_groups`
--

CREATE TABLE `component_groups` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `component_types`
--

CREATE TABLE `component_types` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `component_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `cholosterol` double DEFAULT 0,
  `sodium` double DEFAULT 0,
  `fiber` double DEFAULT 0,
  `sugar` double DEFAULT 0,
  `vitaminc` double DEFAULT 0,
  `vitamina` double DEFAULT 0,
  `calcium` double DEFAULT 0,
  `iron` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `cuisines`
--

CREATE TABLE `cuisines` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customers`
--

CREATE TABLE `customers` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `fname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `birthdate` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gender` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `whatsapp` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `weight` double DEFAULT NULL,
  `height` double DEFAULT NULL,
  `condition` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'Energetic',
  `password` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `referral` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `instructions` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `vip` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `status` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'active',
  `enabled` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'true',
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_intake_id` bigint(20) UNSIGNED NOT NULL,
  `package_bundle_id` bigint(20) UNSIGNED DEFAULT NULL,
  `delivery_time_id` bigint(20) UNSIGNED DEFAULT NULL,
  `promocode_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_addresses`
--

CREATE TABLE `customer_addresses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `city_id` bigint(20) UNSIGNED DEFAULT NULL,
  `city_district_id` bigint(20) UNSIGNED DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `building` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `floor` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `apartment` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `weekdays` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `instructions` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `enabled` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'true',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_allergies`
--

CREATE TABLE `customer_allergies` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `allergy_list_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_deliveries`
--

CREATE TABLE `customer_deliveries` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `customer_subscription_id` bigint(20) UNSIGNED DEFAULT NULL,
  `package_id` bigint(20) UNSIGNED DEFAULT NULL,
  `delivery_company_id` bigint(20) UNSIGNED DEFAULT NULL,
  `delivery_time_id` bigint(20) UNSIGNED DEFAULT NULL,
  `date` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'not delivered',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_drinks`
--

CREATE TABLE `customer_drinks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `meal_type_id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_plan_drink_id` bigint(20) UNSIGNED DEFAULT NULL,
  `drink_id` bigint(20) UNSIGNED DEFAULT NULL,
  `chef_id` bigint(20) UNSIGNED DEFAULT NULL,
  `date` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'not started',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_excludes`
--

CREATE TABLE `customer_excludes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `exclude_list_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_leads`
--

CREATE TABLE `customer_leads` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `fname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `lname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `birthdate` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gender` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `whatsapp` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `weight` double DEFAULT NULL,
  `height` double DEFAULT NULL,
  `condition` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'Energetic',
  `password` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `instructions` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'pending',
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_intake_id` bigint(20) UNSIGNED NOT NULL,
  `package_bundle_id` bigint(20) UNSIGNED DEFAULT NULL,
  `delivery_time_id` bigint(20) UNSIGNED DEFAULT NULL,
  `promocode_id` bigint(20) UNSIGNED DEFAULT NULL,
  `user_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_lead_addresses`
--

CREATE TABLE `customer_lead_addresses` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_lead_id` bigint(20) UNSIGNED DEFAULT NULL,
  `city_id` bigint(20) UNSIGNED DEFAULT NULL,
  `city_district_id` bigint(20) UNSIGNED DEFAULT NULL,
  `address` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `building` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `floor` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `apartment` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `weekdays` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `instructions` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `enabled` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'true',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_lead_allergies`
--

CREATE TABLE `customer_lead_allergies` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_lead_id` bigint(20) UNSIGNED DEFAULT NULL,
  `allergy_list_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_lead_excludes`
--

CREATE TABLE `customer_lead_excludes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_lead_id` bigint(20) UNSIGNED DEFAULT NULL,
  `exclude_list_id` bigint(20) UNSIGNED DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_lead_subscriptions`
--

CREATE TABLE `customer_lead_subscriptions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_lead_id` bigint(20) UNSIGNED DEFAULT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_intake_id` bigint(20) UNSIGNED NOT NULL,
  `package_bundle_id` bigint(20) UNSIGNED DEFAULT NULL,
  `weekdays` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bag` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'true',
  `bag_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'Paper Bag',
  `bag_price` double DEFAULT 0,
  `price` double DEFAULT 1,
  `totalPrice` double DEFAULT 1,
  `margin_price` double DEFAULT 1,
  `from` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `until` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `plan_meals` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `plan_days` int(11) DEFAULT NULL,
  `plan_cals` double DEFAULT 0,
  `plan_proteins` double DEFAULT 0,
  `plan_carbs` double DEFAULT 0,
  `plan_fats` double DEFAULT 0,
  `intent_id` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `client_secret` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_url` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_status` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_meals`
--

CREATE TABLE `customer_meals` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `meal_type_id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_plan_meal_id` bigint(20) UNSIGNED DEFAULT NULL,
  `package_meal_id` bigint(20) UNSIGNED DEFAULT NULL,
  `meal_id` bigint(20) UNSIGNED DEFAULT NULL,
  `chef_id` bigint(20) UNSIGNED DEFAULT NULL,
  `date` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'not started',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_sides`
--

CREATE TABLE `customer_sides` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `meal_type_id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_plan_side_id` bigint(20) UNSIGNED DEFAULT NULL,
  `side_id` bigint(20) UNSIGNED DEFAULT NULL,
  `chef_id` bigint(20) UNSIGNED DEFAULT NULL,
  `date` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'not started',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_snacks`
--

CREATE TABLE `customer_snacks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED NOT NULL,
  `meal_type_id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_plan_snack_id` bigint(20) UNSIGNED DEFAULT NULL,
  `snack_id` bigint(20) UNSIGNED DEFAULT NULL,
  `chef_id` bigint(20) UNSIGNED DEFAULT NULL,
  `date` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'not started',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `customer_subscriptions`
--

CREATE TABLE `customer_subscriptions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `customer_id` bigint(20) UNSIGNED DEFAULT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_intake_id` bigint(20) UNSIGNED NOT NULL,
  `package_bundle_id` bigint(20) UNSIGNED DEFAULT NULL,
  `promocode_id` bigint(20) UNSIGNED DEFAULT NULL,
  `weekdays` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bag` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'true',
  `bag_type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'Paper Bag',
  `bag_price` double DEFAULT 0,
  `price` double DEFAULT 1,
  `totalPrice` double DEFAULT 1,
  `margin_price` double DEFAULT 1,
  `from` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `until` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `plan_meals` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `plan_days` int(11) DEFAULT NULL,
  `plan_cals` double DEFAULT 0,
  `plan_proteins` double DEFAULT 0,
  `plan_carbs` double DEFAULT 0,
  `plan_fats` double DEFAULT 0,
  `intent_id` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `client_secret` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_url` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_status` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'true',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `days_offs`
--

CREATE TABLE `days_offs` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `number` int(11) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `delivery_companies`
--

CREATE TABLE `delivery_companies` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `delivery_times`
--

CREATE TABLE `delivery_times` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `from` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `until` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `diseases`
--

CREATE TABLE `diseases` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `drinks`
--

CREATE TABLE `drinks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `cuisine_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `img` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'Hot Drink',
  `veg` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'Non-Veg',
  `gluten` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `dairy` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `menu` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `vip` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `general` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `instructions` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` double DEFAULT 0,
  `yield` double DEFAULT 0,
  `serving_number` double DEFAULT 0,
  `serving_price` double DEFAULT 0,
  `serving_weight` double DEFAULT 0,
  `grams` double DEFAULT 0,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `drink_components`
--

CREATE TABLE `drink_components` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `drink_id` bigint(20) UNSIGNED NOT NULL,
  `component_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED DEFAULT NULL,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `quantity_grams` double UNSIGNED DEFAULT 0,
  `cals` double DEFAULT NULL,
  `proteins` double DEFAULT NULL,
  `carbs` double DEFAULT NULL,
  `fats` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `drink_packings`
--

CREATE TABLE `drink_packings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `drink_id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `drink_portions`
--

CREATE TABLE `drink_portions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `drink_id` bigint(20) UNSIGNED NOT NULL,
  `portion_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED DEFAULT NULL,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `quantity_grams` double UNSIGNED DEFAULT 0,
  `cals` double DEFAULT NULL,
  `proteins` double DEFAULT NULL,
  `carbs` double DEFAULT NULL,
  `fats` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `exclude_lists`
--

CREATE TABLE `exclude_lists` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `meals`
--

CREATE TABLE `meals` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `cuisine_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `img` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `department` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `validity` int(11) DEFAULT 1,
  `instructions` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gluten` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `dairy` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `source` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `menu` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `vip` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `general` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `serving_desc` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `meal_drinks`
--

CREATE TABLE `meal_drinks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `meal_id` bigint(20) UNSIGNED NOT NULL,
  `drink_id` bigint(20) UNSIGNED NOT NULL,
  `note` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `meal_packings`
--

CREATE TABLE `meal_packings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `meal_id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `meal_portions`
--

CREATE TABLE `meal_portions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `meal_id` bigint(20) UNSIGNED NOT NULL,
  `portion_id` bigint(20) UNSIGNED NOT NULL,
  `note` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `meal_sauces`
--

CREATE TABLE `meal_sauces` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `meal_id` bigint(20) UNSIGNED NOT NULL,
  `sauce_id` bigint(20) UNSIGNED NOT NULL,
  `note` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `meal_sides`
--

CREATE TABLE `meal_sides` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `meal_id` bigint(20) UNSIGNED NOT NULL,
  `side_id` bigint(20) UNSIGNED NOT NULL,
  `note` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `meal_snacks`
--

CREATE TABLE `meal_snacks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `meal_id` bigint(20) UNSIGNED NOT NULL,
  `snack_id` bigint(20) UNSIGNED NOT NULL,
  `note` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `meal_types`
--

CREATE TABLE `meal_types` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `shorthand` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `meal_type_items`
--

CREATE TABLE `meal_type_items` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `meal_type_id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) UNSIGNED NOT NULL,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `packages`
--

CREATE TABLE `packages` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `img` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `desc` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` double DEFAULT 0,
  `active` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'true',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_bundles`
--

CREATE TABLE `package_bundles` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `img` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `note` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_bundle_days`
--

CREATE TABLE `package_bundle_days` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_bundle_id` bigint(20) UNSIGNED NOT NULL,
  `days` int(10) UNSIGNED DEFAULT NULL,
  `discount` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_bundle_types`
--

CREATE TABLE `package_bundle_types` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_bundle_id` bigint(20) UNSIGNED NOT NULL,
  `meal_type_id` bigint(20) UNSIGNED NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_intakes`
--

CREATE TABLE `package_intakes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `title` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `range` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `desc` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `scale_percentage` double DEFAULT NULL,
  `scale_cals` double DEFAULT NULL,
  `cals` double DEFAULT NULL,
  `proteins` double DEFAULT NULL,
  `carbs` double DEFAULT NULL,
  `fats` double DEFAULT NULL,
  `proteins_percentage` double DEFAULT 0,
  `carbs_percentage` double DEFAULT 0,
  `fats_percentage` double DEFAULT 0,
  `price` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_intake_meals`
--

CREATE TABLE `package_intake_meals` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_intake_id` bigint(20) UNSIGNED NOT NULL,
  `meal_type_id` bigint(20) UNSIGNED NOT NULL,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `price` double DEFAULT 0,
  `proteins_percentage` double DEFAULT 0,
  `carbs_percentage` double DEFAULT 0,
  `fats_percentage` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_meals`
--

CREATE TABLE `package_meals` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_intake_id` bigint(20) UNSIGNED NOT NULL,
  `meal_id` bigint(20) UNSIGNED NOT NULL,
  `meal_type_id` bigint(20) UNSIGNED NOT NULL,
  `meal_type_item_id` bigint(20) UNSIGNED DEFAULT NULL,
  `scale_calories` double DEFAULT NULL,
  `scale_percentage` double DEFAULT NULL,
  `oneRange` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `price` double DEFAULT 0,
  `serving_price` double DEFAULT 0,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `yield` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `serving_number` double DEFAULT 0,
  `serving_grams` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_meal_drinks`
--

CREATE TABLE `package_meal_drinks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_meal_id` bigint(20) UNSIGNED NOT NULL,
  `meal_drink_id` bigint(20) UNSIGNED NOT NULL,
  `drink_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED NOT NULL,
  `quantity` double DEFAULT 0,
  `quantity_grams` double DEFAULT 0,
  `price` double DEFAULT 0,
  `serving_price` double DEFAULT 0,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_meal_packings`
--

CREATE TABLE `package_meal_packings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_meal_id` bigint(20) UNSIGNED NOT NULL,
  `meal_packing_id` bigint(20) UNSIGNED NOT NULL,
  `quantity` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_meal_portions`
--

CREATE TABLE `package_meal_portions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_meal_id` bigint(20) UNSIGNED NOT NULL,
  `meal_portion_id` bigint(20) UNSIGNED NOT NULL,
  `portion_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED NOT NULL,
  `quantity` double DEFAULT 0,
  `quantity_grams` double DEFAULT 0,
  `price` double DEFAULT 0,
  `serving_price` double DEFAULT 0,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_meal_sauces`
--

CREATE TABLE `package_meal_sauces` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_meal_id` bigint(20) UNSIGNED NOT NULL,
  `meal_sauce_id` bigint(20) UNSIGNED NOT NULL,
  `sauce_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED NOT NULL,
  `quantity` double DEFAULT 0,
  `quantity_grams` double DEFAULT 0,
  `price` double DEFAULT 0,
  `serving_price` double DEFAULT 0,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_meal_sides`
--

CREATE TABLE `package_meal_sides` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_meal_id` bigint(20) UNSIGNED NOT NULL,
  `meal_side_id` bigint(20) UNSIGNED NOT NULL,
  `side_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED NOT NULL,
  `quantity` double DEFAULT 0,
  `quantity_grams` double DEFAULT 0,
  `price` double DEFAULT 0,
  `serving_price` double DEFAULT 0,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_meal_snacks`
--

CREATE TABLE `package_meal_snacks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_meal_id` bigint(20) UNSIGNED NOT NULL,
  `meal_snack_id` bigint(20) UNSIGNED NOT NULL,
  `snack_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED NOT NULL,
  `quantity` double DEFAULT 0,
  `quantity_grams` double DEFAULT 0,
  `price` double DEFAULT 0,
  `serving_price` double DEFAULT 0,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_plans`
--

CREATE TABLE `package_plans` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_intake_id` bigint(20) UNSIGNED NOT NULL,
  `date` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_plan_drinks`
--

CREATE TABLE `package_plan_drinks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_intake_id` bigint(20) UNSIGNED NOT NULL,
  `package_plan_id` bigint(20) UNSIGNED DEFAULT NULL,
  `meal_type_id` bigint(20) UNSIGNED DEFAULT NULL,
  `drink_id` bigint(20) UNSIGNED DEFAULT NULL,
  `default` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_plan_meals`
--

CREATE TABLE `package_plan_meals` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_intake_id` bigint(20) UNSIGNED NOT NULL,
  `package_plan_id` bigint(20) UNSIGNED DEFAULT NULL,
  `package_meal_id` bigint(20) UNSIGNED DEFAULT NULL,
  `meal_type_id` bigint(20) UNSIGNED DEFAULT NULL,
  `meal_id` bigint(20) UNSIGNED DEFAULT NULL,
  `default` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_plan_sides`
--

CREATE TABLE `package_plan_sides` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_intake_id` bigint(20) UNSIGNED NOT NULL,
  `package_plan_id` bigint(20) UNSIGNED DEFAULT NULL,
  `meal_type_id` bigint(20) UNSIGNED DEFAULT NULL,
  `side_id` bigint(20) UNSIGNED DEFAULT NULL,
  `default` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `package_plan_snacks`
--

CREATE TABLE `package_plan_snacks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `package_id` bigint(20) UNSIGNED NOT NULL,
  `package_intake_id` bigint(20) UNSIGNED NOT NULL,
  `package_plan_id` bigint(20) UNSIGNED DEFAULT NULL,
  `meal_type_id` bigint(20) UNSIGNED DEFAULT NULL,
  `snack_id` bigint(20) UNSIGNED DEFAULT NULL,
  `default` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `password_resets`
--

CREATE TABLE `password_resets` (
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `portions`
--

CREATE TABLE `portions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `cuisine_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `img` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `source` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `validity` int(11) DEFAULT 1,
  `instructions` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` double DEFAULT 0,
  `yield` double DEFAULT 0,
  `serving_number` double DEFAULT 0,
  `serving_price` double DEFAULT 0,
  `serving_weight` double DEFAULT 0,
  `grams` double DEFAULT 0,
  `cals` double DEFAULT NULL,
  `proteins` double DEFAULT NULL,
  `carbs` double DEFAULT NULL,
  `fats` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `portion_components`
--

CREATE TABLE `portion_components` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `portion_id` bigint(20) UNSIGNED NOT NULL,
  `component_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED DEFAULT NULL,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `quantity_grams` double UNSIGNED DEFAULT 0,
  `percentage` double DEFAULT NULL,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `portion_packings`
--

CREATE TABLE `portion_packings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `portion_id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `portion_portions`
--

CREATE TABLE `portion_portions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `portion_id` bigint(20) UNSIGNED NOT NULL,
  `subportion_id` bigint(20) UNSIGNED DEFAULT NULL,
  `unit_id` bigint(20) UNSIGNED DEFAULT NULL,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `quantity_grams` double UNSIGNED DEFAULT 0,
  `percentage` double DEFAULT NULL,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `promocodes`
--

CREATE TABLE `promocodes` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `code` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `percentage` double DEFAULT 0,
  `limit` int(11) DEFAULT 1,
  `used` int(11) DEFAULT 0,
  `status` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'active',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `sauces`
--

CREATE TABLE `sauces` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `cuisine_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `img` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `veg` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `gluten` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `dairy` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `menu` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `vip` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `general` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `instructions` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` double DEFAULT 0,
  `yield` double DEFAULT 0,
  `serving_number` double DEFAULT 0,
  `serving_price` double DEFAULT 0,
  `serving_weight` double DEFAULT 0,
  `grams` double DEFAULT 0,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `sauce_components`
--

CREATE TABLE `sauce_components` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `sauce_id` bigint(20) UNSIGNED NOT NULL,
  `component_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED DEFAULT NULL,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `quantity_grams` double UNSIGNED DEFAULT 0,
  `cals` double DEFAULT NULL,
  `proteins` double DEFAULT NULL,
  `carbs` double DEFAULT NULL,
  `fats` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `sauce_packings`
--

CREATE TABLE `sauce_packings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `sauce_id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `sauce_portions`
--

CREATE TABLE `sauce_portions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `sauce_id` bigint(20) UNSIGNED NOT NULL,
  `portion_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED DEFAULT NULL,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `quantity_grams` double UNSIGNED DEFAULT 0,
  `cals` double DEFAULT NULL,
  `proteins` double DEFAULT NULL,
  `carbs` double DEFAULT NULL,
  `fats` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `logo` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `bag_price` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `sides`
--

CREATE TABLE `sides` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `cuisine_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `img` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `veg` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'Non-Veg',
  `gluten` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `dairy` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `menu` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `vip` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `general` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `instructions` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` double DEFAULT 0,
  `yield` double DEFAULT 0,
  `serving_number` double DEFAULT 0,
  `serving_price` double DEFAULT 0,
  `serving_weight` double DEFAULT 0,
  `grams` double DEFAULT 0,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `side_components`
--

CREATE TABLE `side_components` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `side_id` bigint(20) UNSIGNED NOT NULL,
  `component_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED DEFAULT NULL,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `quantity_grams` double UNSIGNED DEFAULT 0,
  `cals` double DEFAULT NULL,
  `proteins` double DEFAULT NULL,
  `carbs` double DEFAULT NULL,
  `fats` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `side_packings`
--

CREATE TABLE `side_packings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `side_id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `side_portions`
--

CREATE TABLE `side_portions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `side_id` bigint(20) UNSIGNED NOT NULL,
  `portion_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED DEFAULT NULL,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `quantity_grams` double UNSIGNED DEFAULT 0,
  `cals` double DEFAULT NULL,
  `proteins` double DEFAULT NULL,
  `carbs` double DEFAULT NULL,
  `fats` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `snacks`
--

CREATE TABLE `snacks` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `cuisine_id` bigint(20) UNSIGNED DEFAULT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `img` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `veg` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'Non-Veg',
  `gluten` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `dairy` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `menu` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `vip` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `general` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT 'false',
  `instructions` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` double DEFAULT 0,
  `yield` double DEFAULT 0,
  `serving_number` double DEFAULT 0,
  `serving_price` double DEFAULT 0,
  `serving_weight` double DEFAULT 0,
  `grams` double DEFAULT 0,
  `cals` double DEFAULT 0,
  `proteins` double DEFAULT 0,
  `carbs` double DEFAULT 0,
  `fats` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `snack_components`
--

CREATE TABLE `snack_components` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `snack_id` bigint(20) UNSIGNED NOT NULL,
  `component_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED DEFAULT NULL,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `quantity_grams` double UNSIGNED DEFAULT 0,
  `cals` double DEFAULT NULL,
  `proteins` double DEFAULT NULL,
  `carbs` double DEFAULT NULL,
  `fats` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `snack_packings`
--

CREATE TABLE `snack_packings` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `snack_id` bigint(20) UNSIGNED NOT NULL,
  `name` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `snack_portions`
--

CREATE TABLE `snack_portions` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `snack_id` bigint(20) UNSIGNED NOT NULL,
  `portion_id` bigint(20) UNSIGNED NOT NULL,
  `unit_id` bigint(20) UNSIGNED DEFAULT NULL,
  `type` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `role` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity` double UNSIGNED DEFAULT 0,
  `quantity_grams` double UNSIGNED DEFAULT 0,
  `cals` double DEFAULT NULL,
  `proteins` double DEFAULT NULL,
  `carbs` double DEFAULT NULL,
  `fats` double DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `units`
--

CREATE TABLE `units` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `liters` double DEFAULT 0,
  `grams` double DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` bigint(20) UNSIGNED NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `allergy_lists`
--
ALTER TABLE `allergy_lists`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `chefs`
--
ALTER TABLE `chefs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `cities`
--
ALTER TABLE `cities`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `city_districts`
--
ALTER TABLE `city_districts`
  ADD PRIMARY KEY (`id`),
  ADD KEY `city_districts_city_id_foreign` (`city_id`);

--
-- Indexes for table `components`
--
ALTER TABLE `components`
  ADD PRIMARY KEY (`id`),
  ADD KEY `components_component_category_id_foreign` (`component_category_id`),
  ADD KEY `components_component_group_id_foreign` (`component_group_id`),
  ADD KEY `components_exclude_list_id_foreign` (`exclude_list_id`),
  ADD KEY `components_allergy_list_id_foreign` (`allergy_list_id`);

--
-- Indexes for table `component_categories`
--
ALTER TABLE `component_categories`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `component_groups`
--
ALTER TABLE `component_groups`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `component_types`
--
ALTER TABLE `component_types`
  ADD PRIMARY KEY (`id`),
  ADD KEY `component_types_component_id_foreign` (`component_id`);

--
-- Indexes for table `cuisines`
--
ALTER TABLE `cuisines`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customers_package_id_foreign` (`package_id`),
  ADD KEY `customers_package_intake_id_foreign` (`package_intake_id`),
  ADD KEY `customers_package_bundle_id_foreign` (`package_bundle_id`),
  ADD KEY `customers_delivery_time_id_foreign` (`delivery_time_id`),
  ADD KEY `customers_promocode_id_foreign` (`promocode_id`),
  ADD KEY `customers_user_id_foreign` (`user_id`);

--
-- Indexes for table `customer_addresses`
--
ALTER TABLE `customer_addresses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_addresses_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_addresses_city_id_foreign` (`city_id`),
  ADD KEY `customer_addresses_city_district_id_foreign` (`city_district_id`);

--
-- Indexes for table `customer_allergies`
--
ALTER TABLE `customer_allergies`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_allergies_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_allergies_allergy_list_id_foreign` (`allergy_list_id`);

--
-- Indexes for table `customer_deliveries`
--
ALTER TABLE `customer_deliveries`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_deliveries_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_deliveries_customer_subscription_id_foreign` (`customer_subscription_id`),
  ADD KEY `customer_deliveries_package_id_foreign` (`package_id`),
  ADD KEY `customer_deliveries_delivery_company_id_foreign` (`delivery_company_id`),
  ADD KEY `customer_deliveries_delivery_time_id_foreign` (`delivery_time_id`);

--
-- Indexes for table `customer_drinks`
--
ALTER TABLE `customer_drinks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_drinks_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_drinks_meal_type_id_foreign` (`meal_type_id`),
  ADD KEY `customer_drinks_package_id_foreign` (`package_id`),
  ADD KEY `customer_drinks_package_plan_drink_id_foreign` (`package_plan_drink_id`),
  ADD KEY `customer_drinks_drink_id_foreign` (`drink_id`),
  ADD KEY `customer_drinks_chef_id_foreign` (`chef_id`);

--
-- Indexes for table `customer_excludes`
--
ALTER TABLE `customer_excludes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_excludes_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_excludes_exclude_list_id_foreign` (`exclude_list_id`);

--
-- Indexes for table `customer_leads`
--
ALTER TABLE `customer_leads`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_leads_package_id_foreign` (`package_id`),
  ADD KEY `customer_leads_package_intake_id_foreign` (`package_intake_id`),
  ADD KEY `customer_leads_package_bundle_id_foreign` (`package_bundle_id`),
  ADD KEY `customer_leads_delivery_time_id_foreign` (`delivery_time_id`),
  ADD KEY `customer_leads_promocode_id_foreign` (`promocode_id`),
  ADD KEY `customer_leads_user_id_foreign` (`user_id`);

--
-- Indexes for table `customer_lead_addresses`
--
ALTER TABLE `customer_lead_addresses`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_lead_addresses_customer_lead_id_foreign` (`customer_lead_id`),
  ADD KEY `customer_lead_addresses_city_id_foreign` (`city_id`),
  ADD KEY `customer_lead_addresses_city_district_id_foreign` (`city_district_id`);

--
-- Indexes for table `customer_lead_allergies`
--
ALTER TABLE `customer_lead_allergies`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_lead_allergies_customer_lead_id_foreign` (`customer_lead_id`),
  ADD KEY `customer_lead_allergies_allergy_list_id_foreign` (`allergy_list_id`);

--
-- Indexes for table `customer_lead_excludes`
--
ALTER TABLE `customer_lead_excludes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_lead_excludes_customer_lead_id_foreign` (`customer_lead_id`),
  ADD KEY `customer_lead_excludes_exclude_list_id_foreign` (`exclude_list_id`);

--
-- Indexes for table `customer_lead_subscriptions`
--
ALTER TABLE `customer_lead_subscriptions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_lead_subscriptions_customer_lead_id_foreign` (`customer_lead_id`),
  ADD KEY `customer_lead_subscriptions_package_id_foreign` (`package_id`),
  ADD KEY `customer_lead_subscriptions_package_intake_id_foreign` (`package_intake_id`),
  ADD KEY `customer_lead_subscriptions_package_bundle_id_foreign` (`package_bundle_id`);

--
-- Indexes for table `customer_meals`
--
ALTER TABLE `customer_meals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_meals_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_meals_meal_type_id_foreign` (`meal_type_id`),
  ADD KEY `customer_meals_package_id_foreign` (`package_id`),
  ADD KEY `customer_meals_package_plan_meal_id_foreign` (`package_plan_meal_id`),
  ADD KEY `customer_meals_package_meal_id_foreign` (`package_meal_id`),
  ADD KEY `customer_meals_meal_id_foreign` (`meal_id`),
  ADD KEY `customer_meals_chef_id_foreign` (`chef_id`);

--
-- Indexes for table `customer_sides`
--
ALTER TABLE `customer_sides`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_sides_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_sides_meal_type_id_foreign` (`meal_type_id`),
  ADD KEY `customer_sides_package_id_foreign` (`package_id`),
  ADD KEY `customer_sides_package_plan_side_id_foreign` (`package_plan_side_id`),
  ADD KEY `customer_sides_side_id_foreign` (`side_id`),
  ADD KEY `customer_sides_chef_id_foreign` (`chef_id`);

--
-- Indexes for table `customer_snacks`
--
ALTER TABLE `customer_snacks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_snacks_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_snacks_meal_type_id_foreign` (`meal_type_id`),
  ADD KEY `customer_snacks_package_id_foreign` (`package_id`),
  ADD KEY `customer_snacks_package_plan_snack_id_foreign` (`package_plan_snack_id`),
  ADD KEY `customer_snacks_snack_id_foreign` (`snack_id`),
  ADD KEY `customer_snacks_chef_id_foreign` (`chef_id`);

--
-- Indexes for table `customer_subscriptions`
--
ALTER TABLE `customer_subscriptions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_subscriptions_customer_id_foreign` (`customer_id`),
  ADD KEY `customer_subscriptions_package_id_foreign` (`package_id`),
  ADD KEY `customer_subscriptions_package_intake_id_foreign` (`package_intake_id`),
  ADD KEY `customer_subscriptions_package_bundle_id_foreign` (`package_bundle_id`),
  ADD KEY `customer_subscriptions_promocode_id_foreign` (`promocode_id`);

--
-- Indexes for table `days_offs`
--
ALTER TABLE `days_offs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `delivery_companies`
--
ALTER TABLE `delivery_companies`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `delivery_times`
--
ALTER TABLE `delivery_times`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `diseases`
--
ALTER TABLE `diseases`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `drinks`
--
ALTER TABLE `drinks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `drinks_cuisine_id_foreign` (`cuisine_id`);

--
-- Indexes for table `drink_components`
--
ALTER TABLE `drink_components`
  ADD PRIMARY KEY (`id`),
  ADD KEY `drink_components_drink_id_foreign` (`drink_id`),
  ADD KEY `drink_components_component_id_foreign` (`component_id`),
  ADD KEY `drink_components_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `drink_packings`
--
ALTER TABLE `drink_packings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `drink_packings_drink_id_foreign` (`drink_id`);

--
-- Indexes for table `drink_portions`
--
ALTER TABLE `drink_portions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `drink_portions_drink_id_foreign` (`drink_id`),
  ADD KEY `drink_portions_portion_id_foreign` (`portion_id`),
  ADD KEY `drink_portions_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `exclude_lists`
--
ALTER TABLE `exclude_lists`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `meals`
--
ALTER TABLE `meals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `meals_cuisine_id_foreign` (`cuisine_id`);

--
-- Indexes for table `meal_drinks`
--
ALTER TABLE `meal_drinks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `meal_drinks_meal_id_foreign` (`meal_id`),
  ADD KEY `meal_drinks_drink_id_foreign` (`drink_id`);

--
-- Indexes for table `meal_packings`
--
ALTER TABLE `meal_packings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `meal_packings_meal_id_foreign` (`meal_id`);

--
-- Indexes for table `meal_portions`
--
ALTER TABLE `meal_portions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `meal_portions_meal_id_foreign` (`meal_id`),
  ADD KEY `meal_portions_portion_id_foreign` (`portion_id`);

--
-- Indexes for table `meal_sauces`
--
ALTER TABLE `meal_sauces`
  ADD PRIMARY KEY (`id`),
  ADD KEY `meal_sauces_meal_id_foreign` (`meal_id`),
  ADD KEY `meal_sauces_sauce_id_foreign` (`sauce_id`);

--
-- Indexes for table `meal_sides`
--
ALTER TABLE `meal_sides`
  ADD PRIMARY KEY (`id`),
  ADD KEY `meal_sides_meal_id_foreign` (`meal_id`),
  ADD KEY `meal_sides_side_id_foreign` (`side_id`);

--
-- Indexes for table `meal_snacks`
--
ALTER TABLE `meal_snacks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `meal_snacks_meal_id_foreign` (`meal_id`),
  ADD KEY `meal_snacks_snack_id_foreign` (`snack_id`);

--
-- Indexes for table `meal_types`
--
ALTER TABLE `meal_types`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `meal_type_items`
--
ALTER TABLE `meal_type_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `meal_type_items_meal_type_id_foreign` (`meal_type_id`);

--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `packages`
--
ALTER TABLE `packages`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `package_bundles`
--
ALTER TABLE `package_bundles`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_bundles_package_id_foreign` (`package_id`);

--
-- Indexes for table `package_bundle_days`
--
ALTER TABLE `package_bundle_days`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_bundle_days_package_id_foreign` (`package_id`),
  ADD KEY `package_bundle_days_package_bundle_id_foreign` (`package_bundle_id`);

--
-- Indexes for table `package_bundle_types`
--
ALTER TABLE `package_bundle_types`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_bundle_types_package_id_foreign` (`package_id`),
  ADD KEY `package_bundle_types_package_bundle_id_foreign` (`package_bundle_id`),
  ADD KEY `package_bundle_types_meal_type_id_foreign` (`meal_type_id`);

--
-- Indexes for table `package_intakes`
--
ALTER TABLE `package_intakes`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_intakes_package_id_foreign` (`package_id`);

--
-- Indexes for table `package_intake_meals`
--
ALTER TABLE `package_intake_meals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_intake_meals_package_id_foreign` (`package_id`),
  ADD KEY `package_intake_meals_package_intake_id_foreign` (`package_intake_id`),
  ADD KEY `package_intake_meals_meal_type_id_foreign` (`meal_type_id`);

--
-- Indexes for table `package_meals`
--
ALTER TABLE `package_meals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_meals_package_id_foreign` (`package_id`),
  ADD KEY `package_meals_package_intake_id_foreign` (`package_intake_id`),
  ADD KEY `package_meals_meal_id_foreign` (`meal_id`),
  ADD KEY `package_meals_meal_type_id_foreign` (`meal_type_id`),
  ADD KEY `package_meals_meal_type_item_id_foreign` (`meal_type_item_id`);

--
-- Indexes for table `package_meal_drinks`
--
ALTER TABLE `package_meal_drinks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_meal_drinks_package_meal_id_foreign` (`package_meal_id`),
  ADD KEY `package_meal_drinks_meal_drink_id_foreign` (`meal_drink_id`),
  ADD KEY `package_meal_drinks_drink_id_foreign` (`drink_id`),
  ADD KEY `package_meal_drinks_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `package_meal_packings`
--
ALTER TABLE `package_meal_packings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_meal_packings_package_meal_id_foreign` (`package_meal_id`),
  ADD KEY `package_meal_packings_meal_packing_id_foreign` (`meal_packing_id`);

--
-- Indexes for table `package_meal_portions`
--
ALTER TABLE `package_meal_portions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_meal_portions_package_meal_id_foreign` (`package_meal_id`),
  ADD KEY `package_meal_portions_meal_portion_id_foreign` (`meal_portion_id`),
  ADD KEY `package_meal_portions_portion_id_foreign` (`portion_id`),
  ADD KEY `package_meal_portions_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `package_meal_sauces`
--
ALTER TABLE `package_meal_sauces`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_meal_sauces_package_meal_id_foreign` (`package_meal_id`),
  ADD KEY `package_meal_sauces_meal_sauce_id_foreign` (`meal_sauce_id`),
  ADD KEY `package_meal_sauces_sauce_id_foreign` (`sauce_id`),
  ADD KEY `package_meal_sauces_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `package_meal_sides`
--
ALTER TABLE `package_meal_sides`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_meal_sides_package_meal_id_foreign` (`package_meal_id`),
  ADD KEY `package_meal_sides_meal_side_id_foreign` (`meal_side_id`),
  ADD KEY `package_meal_sides_side_id_foreign` (`side_id`),
  ADD KEY `package_meal_sides_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `package_meal_snacks`
--
ALTER TABLE `package_meal_snacks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_meal_snacks_package_meal_id_foreign` (`package_meal_id`),
  ADD KEY `package_meal_snacks_meal_snack_id_foreign` (`meal_snack_id`),
  ADD KEY `package_meal_snacks_snack_id_foreign` (`snack_id`),
  ADD KEY `package_meal_snacks_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `package_plans`
--
ALTER TABLE `package_plans`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_plans_package_id_foreign` (`package_id`),
  ADD KEY `package_plans_package_intake_id_foreign` (`package_intake_id`);

--
-- Indexes for table `package_plan_drinks`
--
ALTER TABLE `package_plan_drinks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_plan_drinks_package_id_foreign` (`package_id`),
  ADD KEY `package_plan_drinks_package_intake_id_foreign` (`package_intake_id`),
  ADD KEY `package_plan_drinks_package_plan_id_foreign` (`package_plan_id`),
  ADD KEY `package_plan_drinks_meal_type_id_foreign` (`meal_type_id`),
  ADD KEY `package_plan_drinks_drink_id_foreign` (`drink_id`);

--
-- Indexes for table `package_plan_meals`
--
ALTER TABLE `package_plan_meals`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_plan_meals_package_id_foreign` (`package_id`),
  ADD KEY `package_plan_meals_package_intake_id_foreign` (`package_intake_id`),
  ADD KEY `package_plan_meals_package_plan_id_foreign` (`package_plan_id`),
  ADD KEY `package_plan_meals_package_meal_id_foreign` (`package_meal_id`),
  ADD KEY `package_plan_meals_meal_type_id_foreign` (`meal_type_id`),
  ADD KEY `package_plan_meals_meal_id_foreign` (`meal_id`);

--
-- Indexes for table `package_plan_sides`
--
ALTER TABLE `package_plan_sides`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_plan_sides_package_id_foreign` (`package_id`),
  ADD KEY `package_plan_sides_package_intake_id_foreign` (`package_intake_id`),
  ADD KEY `package_plan_sides_package_plan_id_foreign` (`package_plan_id`),
  ADD KEY `package_plan_sides_meal_type_id_foreign` (`meal_type_id`),
  ADD KEY `package_plan_sides_side_id_foreign` (`side_id`);

--
-- Indexes for table `package_plan_snacks`
--
ALTER TABLE `package_plan_snacks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `package_plan_snacks_package_id_foreign` (`package_id`),
  ADD KEY `package_plan_snacks_package_intake_id_foreign` (`package_intake_id`),
  ADD KEY `package_plan_snacks_package_plan_id_foreign` (`package_plan_id`),
  ADD KEY `package_plan_snacks_meal_type_id_foreign` (`meal_type_id`),
  ADD KEY `package_plan_snacks_snack_id_foreign` (`snack_id`);

--
-- Indexes for table `password_resets`
--
ALTER TABLE `password_resets`
  ADD KEY `password_resets_email_index` (`email`);

--
-- Indexes for table `portions`
--
ALTER TABLE `portions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `portions_cuisine_id_foreign` (`cuisine_id`);

--
-- Indexes for table `portion_components`
--
ALTER TABLE `portion_components`
  ADD PRIMARY KEY (`id`),
  ADD KEY `portion_components_portion_id_foreign` (`portion_id`),
  ADD KEY `portion_components_component_id_foreign` (`component_id`),
  ADD KEY `portion_components_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `portion_packings`
--
ALTER TABLE `portion_packings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `portion_packings_portion_id_foreign` (`portion_id`);

--
-- Indexes for table `portion_portions`
--
ALTER TABLE `portion_portions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `portion_portions_portion_id_foreign` (`portion_id`),
  ADD KEY `portion_portions_subportion_id_foreign` (`subportion_id`),
  ADD KEY `portion_portions_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `promocodes`
--
ALTER TABLE `promocodes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `sauces`
--
ALTER TABLE `sauces`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sauces_cuisine_id_foreign` (`cuisine_id`);

--
-- Indexes for table `sauce_components`
--
ALTER TABLE `sauce_components`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sauce_components_sauce_id_foreign` (`sauce_id`),
  ADD KEY `sauce_components_component_id_foreign` (`component_id`),
  ADD KEY `sauce_components_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `sauce_packings`
--
ALTER TABLE `sauce_packings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sauce_packings_sauce_id_foreign` (`sauce_id`);

--
-- Indexes for table `sauce_portions`
--
ALTER TABLE `sauce_portions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sauce_portions_sauce_id_foreign` (`sauce_id`),
  ADD KEY `sauce_portions_portion_id_foreign` (`portion_id`),
  ADD KEY `sauce_portions_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `sides`
--
ALTER TABLE `sides`
  ADD PRIMARY KEY (`id`),
  ADD KEY `sides_cuisine_id_foreign` (`cuisine_id`);

--
-- Indexes for table `side_components`
--
ALTER TABLE `side_components`
  ADD PRIMARY KEY (`id`),
  ADD KEY `side_components_side_id_foreign` (`side_id`),
  ADD KEY `side_components_component_id_foreign` (`component_id`),
  ADD KEY `side_components_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `side_packings`
--
ALTER TABLE `side_packings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `side_packings_side_id_foreign` (`side_id`);

--
-- Indexes for table `side_portions`
--
ALTER TABLE `side_portions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `side_portions_side_id_foreign` (`side_id`),
  ADD KEY `side_portions_portion_id_foreign` (`portion_id`),
  ADD KEY `side_portions_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `snacks`
--
ALTER TABLE `snacks`
  ADD PRIMARY KEY (`id`),
  ADD KEY `snacks_cuisine_id_foreign` (`cuisine_id`);

--
-- Indexes for table `snack_components`
--
ALTER TABLE `snack_components`
  ADD PRIMARY KEY (`id`),
  ADD KEY `snack_components_snack_id_foreign` (`snack_id`),
  ADD KEY `snack_components_component_id_foreign` (`component_id`),
  ADD KEY `snack_components_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `snack_packings`
--
ALTER TABLE `snack_packings`
  ADD PRIMARY KEY (`id`),
  ADD KEY `snack_packings_snack_id_foreign` (`snack_id`);

--
-- Indexes for table `snack_portions`
--
ALTER TABLE `snack_portions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `snack_portions_snack_id_foreign` (`snack_id`),
  ADD KEY `snack_portions_portion_id_foreign` (`portion_id`),
  ADD KEY `snack_portions_unit_id_foreign` (`unit_id`);

--
-- Indexes for table `units`
--
ALTER TABLE `units`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `users_email_unique` (`email`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `allergy_lists`
--
ALTER TABLE `allergy_lists`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `chefs`
--
ALTER TABLE `chefs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `cities`
--
ALTER TABLE `cities`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `city_districts`
--
ALTER TABLE `city_districts`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `components`
--
ALTER TABLE `components`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `component_categories`
--
ALTER TABLE `component_categories`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `component_groups`
--
ALTER TABLE `component_groups`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `component_types`
--
ALTER TABLE `component_types`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `cuisines`
--
ALTER TABLE `cuisines`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_addresses`
--
ALTER TABLE `customer_addresses`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_allergies`
--
ALTER TABLE `customer_allergies`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_deliveries`
--
ALTER TABLE `customer_deliveries`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_drinks`
--
ALTER TABLE `customer_drinks`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_excludes`
--
ALTER TABLE `customer_excludes`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_leads`
--
ALTER TABLE `customer_leads`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_lead_addresses`
--
ALTER TABLE `customer_lead_addresses`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_lead_allergies`
--
ALTER TABLE `customer_lead_allergies`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_lead_excludes`
--
ALTER TABLE `customer_lead_excludes`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_lead_subscriptions`
--
ALTER TABLE `customer_lead_subscriptions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_meals`
--
ALTER TABLE `customer_meals`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_sides`
--
ALTER TABLE `customer_sides`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_snacks`
--
ALTER TABLE `customer_snacks`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `customer_subscriptions`
--
ALTER TABLE `customer_subscriptions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `days_offs`
--
ALTER TABLE `days_offs`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `delivery_companies`
--
ALTER TABLE `delivery_companies`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `delivery_times`
--
ALTER TABLE `delivery_times`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `diseases`
--
ALTER TABLE `diseases`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `drinks`
--
ALTER TABLE `drinks`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `drink_components`
--
ALTER TABLE `drink_components`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `drink_packings`
--
ALTER TABLE `drink_packings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `drink_portions`
--
ALTER TABLE `drink_portions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `exclude_lists`
--
ALTER TABLE `exclude_lists`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `meals`
--
ALTER TABLE `meals`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `meal_drinks`
--
ALTER TABLE `meal_drinks`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `meal_packings`
--
ALTER TABLE `meal_packings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `meal_portions`
--
ALTER TABLE `meal_portions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `meal_sauces`
--
ALTER TABLE `meal_sauces`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `meal_sides`
--
ALTER TABLE `meal_sides`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `meal_snacks`
--
ALTER TABLE `meal_snacks`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `meal_types`
--
ALTER TABLE `meal_types`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `meal_type_items`
--
ALTER TABLE `meal_type_items`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `packages`
--
ALTER TABLE `packages`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_bundles`
--
ALTER TABLE `package_bundles`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_bundle_days`
--
ALTER TABLE `package_bundle_days`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_bundle_types`
--
ALTER TABLE `package_bundle_types`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_intakes`
--
ALTER TABLE `package_intakes`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_intake_meals`
--
ALTER TABLE `package_intake_meals`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_meals`
--
ALTER TABLE `package_meals`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_meal_drinks`
--
ALTER TABLE `package_meal_drinks`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_meal_packings`
--
ALTER TABLE `package_meal_packings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_meal_portions`
--
ALTER TABLE `package_meal_portions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_meal_sauces`
--
ALTER TABLE `package_meal_sauces`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_meal_sides`
--
ALTER TABLE `package_meal_sides`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_meal_snacks`
--
ALTER TABLE `package_meal_snacks`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_plans`
--
ALTER TABLE `package_plans`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_plan_drinks`
--
ALTER TABLE `package_plan_drinks`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_plan_meals`
--
ALTER TABLE `package_plan_meals`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_plan_sides`
--
ALTER TABLE `package_plan_sides`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `package_plan_snacks`
--
ALTER TABLE `package_plan_snacks`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `portions`
--
ALTER TABLE `portions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `portion_components`
--
ALTER TABLE `portion_components`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `portion_packings`
--
ALTER TABLE `portion_packings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `portion_portions`
--
ALTER TABLE `portion_portions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `promocodes`
--
ALTER TABLE `promocodes`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sauces`
--
ALTER TABLE `sauces`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sauce_components`
--
ALTER TABLE `sauce_components`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sauce_packings`
--
ALTER TABLE `sauce_packings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sauce_portions`
--
ALTER TABLE `sauce_portions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sides`
--
ALTER TABLE `sides`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `side_components`
--
ALTER TABLE `side_components`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `side_packings`
--
ALTER TABLE `side_packings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `side_portions`
--
ALTER TABLE `side_portions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `snacks`
--
ALTER TABLE `snacks`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `snack_components`
--
ALTER TABLE `snack_components`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `snack_packings`
--
ALTER TABLE `snack_packings`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `snack_portions`
--
ALTER TABLE `snack_portions`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `units`
--
ALTER TABLE `units`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `city_districts`
--
ALTER TABLE `city_districts`
  ADD CONSTRAINT `city_districts_city_id_foreign` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `components`
--
ALTER TABLE `components`
  ADD CONSTRAINT `components_allergy_list_id_foreign` FOREIGN KEY (`allergy_list_id`) REFERENCES `allergy_lists` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `components_component_category_id_foreign` FOREIGN KEY (`component_category_id`) REFERENCES `component_categories` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `components_component_group_id_foreign` FOREIGN KEY (`component_group_id`) REFERENCES `component_groups` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `components_exclude_list_id_foreign` FOREIGN KEY (`exclude_list_id`) REFERENCES `exclude_lists` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `component_types`
--
ALTER TABLE `component_types`
  ADD CONSTRAINT `component_types_component_id_foreign` FOREIGN KEY (`component_id`) REFERENCES `components` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customers`
--
ALTER TABLE `customers`
  ADD CONSTRAINT `customers_delivery_time_id_foreign` FOREIGN KEY (`delivery_time_id`) REFERENCES `delivery_times` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customers_package_bundle_id_foreign` FOREIGN KEY (`package_bundle_id`) REFERENCES `package_bundles` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customers_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customers_package_intake_id_foreign` FOREIGN KEY (`package_intake_id`) REFERENCES `package_intakes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customers_promocode_id_foreign` FOREIGN KEY (`promocode_id`) REFERENCES `promocodes` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customers_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `customer_addresses`
--
ALTER TABLE `customer_addresses`
  ADD CONSTRAINT `customer_addresses_city_district_id_foreign` FOREIGN KEY (`city_district_id`) REFERENCES `city_districts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_addresses_city_id_foreign` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_addresses_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_allergies`
--
ALTER TABLE `customer_allergies`
  ADD CONSTRAINT `customer_allergies_allergy_list_id_foreign` FOREIGN KEY (`allergy_list_id`) REFERENCES `allergy_lists` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_allergies_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_deliveries`
--
ALTER TABLE `customer_deliveries`
  ADD CONSTRAINT `customer_deliveries_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_deliveries_customer_subscription_id_foreign` FOREIGN KEY (`customer_subscription_id`) REFERENCES `customer_subscriptions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_deliveries_delivery_company_id_foreign` FOREIGN KEY (`delivery_company_id`) REFERENCES `delivery_companies` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_deliveries_delivery_time_id_foreign` FOREIGN KEY (`delivery_time_id`) REFERENCES `delivery_times` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_deliveries_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_drinks`
--
ALTER TABLE `customer_drinks`
  ADD CONSTRAINT `customer_drinks_chef_id_foreign` FOREIGN KEY (`chef_id`) REFERENCES `chefs` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_drinks_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_drinks_drink_id_foreign` FOREIGN KEY (`drink_id`) REFERENCES `drinks` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_drinks_meal_type_id_foreign` FOREIGN KEY (`meal_type_id`) REFERENCES `meal_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_drinks_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_drinks_package_plan_drink_id_foreign` FOREIGN KEY (`package_plan_drink_id`) REFERENCES `package_plan_drinks` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `customer_excludes`
--
ALTER TABLE `customer_excludes`
  ADD CONSTRAINT `customer_excludes_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_excludes_exclude_list_id_foreign` FOREIGN KEY (`exclude_list_id`) REFERENCES `exclude_lists` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_leads`
--
ALTER TABLE `customer_leads`
  ADD CONSTRAINT `customer_leads_delivery_time_id_foreign` FOREIGN KEY (`delivery_time_id`) REFERENCES `delivery_times` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_leads_package_bundle_id_foreign` FOREIGN KEY (`package_bundle_id`) REFERENCES `package_bundles` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_leads_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_leads_package_intake_id_foreign` FOREIGN KEY (`package_intake_id`) REFERENCES `package_intakes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_leads_promocode_id_foreign` FOREIGN KEY (`promocode_id`) REFERENCES `promocodes` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_leads_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `customer_lead_addresses`
--
ALTER TABLE `customer_lead_addresses`
  ADD CONSTRAINT `customer_lead_addresses_city_district_id_foreign` FOREIGN KEY (`city_district_id`) REFERENCES `city_districts` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_lead_addresses_city_id_foreign` FOREIGN KEY (`city_id`) REFERENCES `cities` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_lead_addresses_customer_lead_id_foreign` FOREIGN KEY (`customer_lead_id`) REFERENCES `customer_leads` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_lead_allergies`
--
ALTER TABLE `customer_lead_allergies`
  ADD CONSTRAINT `customer_lead_allergies_allergy_list_id_foreign` FOREIGN KEY (`allergy_list_id`) REFERENCES `allergy_lists` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_lead_allergies_customer_lead_id_foreign` FOREIGN KEY (`customer_lead_id`) REFERENCES `customer_leads` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_lead_excludes`
--
ALTER TABLE `customer_lead_excludes`
  ADD CONSTRAINT `customer_lead_excludes_customer_lead_id_foreign` FOREIGN KEY (`customer_lead_id`) REFERENCES `customer_leads` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_lead_excludes_exclude_list_id_foreign` FOREIGN KEY (`exclude_list_id`) REFERENCES `exclude_lists` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_lead_subscriptions`
--
ALTER TABLE `customer_lead_subscriptions`
  ADD CONSTRAINT `customer_lead_subscriptions_customer_lead_id_foreign` FOREIGN KEY (`customer_lead_id`) REFERENCES `customer_leads` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_lead_subscriptions_package_bundle_id_foreign` FOREIGN KEY (`package_bundle_id`) REFERENCES `package_bundles` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_lead_subscriptions_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_lead_subscriptions_package_intake_id_foreign` FOREIGN KEY (`package_intake_id`) REFERENCES `package_intakes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `customer_meals`
--
ALTER TABLE `customer_meals`
  ADD CONSTRAINT `customer_meals_chef_id_foreign` FOREIGN KEY (`chef_id`) REFERENCES `chefs` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_meals_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_meals_meal_id_foreign` FOREIGN KEY (`meal_id`) REFERENCES `meals` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_meals_meal_type_id_foreign` FOREIGN KEY (`meal_type_id`) REFERENCES `meal_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_meals_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_meals_package_meal_id_foreign` FOREIGN KEY (`package_meal_id`) REFERENCES `package_meals` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_meals_package_plan_meal_id_foreign` FOREIGN KEY (`package_plan_meal_id`) REFERENCES `package_plan_meals` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `customer_sides`
--
ALTER TABLE `customer_sides`
  ADD CONSTRAINT `customer_sides_chef_id_foreign` FOREIGN KEY (`chef_id`) REFERENCES `chefs` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_sides_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_sides_meal_type_id_foreign` FOREIGN KEY (`meal_type_id`) REFERENCES `meal_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_sides_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_sides_package_plan_side_id_foreign` FOREIGN KEY (`package_plan_side_id`) REFERENCES `package_plan_sides` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_sides_side_id_foreign` FOREIGN KEY (`side_id`) REFERENCES `sides` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `customer_snacks`
--
ALTER TABLE `customer_snacks`
  ADD CONSTRAINT `customer_snacks_chef_id_foreign` FOREIGN KEY (`chef_id`) REFERENCES `chefs` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_snacks_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_snacks_meal_type_id_foreign` FOREIGN KEY (`meal_type_id`) REFERENCES `meal_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_snacks_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_snacks_package_plan_snack_id_foreign` FOREIGN KEY (`package_plan_snack_id`) REFERENCES `package_plan_snacks` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_snacks_snack_id_foreign` FOREIGN KEY (`snack_id`) REFERENCES `snacks` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `customer_subscriptions`
--
ALTER TABLE `customer_subscriptions`
  ADD CONSTRAINT `customer_subscriptions_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_subscriptions_package_bundle_id_foreign` FOREIGN KEY (`package_bundle_id`) REFERENCES `package_bundles` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `customer_subscriptions_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_subscriptions_package_intake_id_foreign` FOREIGN KEY (`package_intake_id`) REFERENCES `package_intakes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `customer_subscriptions_promocode_id_foreign` FOREIGN KEY (`promocode_id`) REFERENCES `promocodes` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `drinks`
--
ALTER TABLE `drinks`
  ADD CONSTRAINT `drinks_cuisine_id_foreign` FOREIGN KEY (`cuisine_id`) REFERENCES `cuisines` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `drink_components`
--
ALTER TABLE `drink_components`
  ADD CONSTRAINT `drink_components_component_id_foreign` FOREIGN KEY (`component_id`) REFERENCES `components` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `drink_components_drink_id_foreign` FOREIGN KEY (`drink_id`) REFERENCES `drinks` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `drink_components_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `drink_packings`
--
ALTER TABLE `drink_packings`
  ADD CONSTRAINT `drink_packings_drink_id_foreign` FOREIGN KEY (`drink_id`) REFERENCES `drinks` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `drink_portions`
--
ALTER TABLE `drink_portions`
  ADD CONSTRAINT `drink_portions_drink_id_foreign` FOREIGN KEY (`drink_id`) REFERENCES `drinks` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `drink_portions_portion_id_foreign` FOREIGN KEY (`portion_id`) REFERENCES `portions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `drink_portions_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `meals`
--
ALTER TABLE `meals`
  ADD CONSTRAINT `meals_cuisine_id_foreign` FOREIGN KEY (`cuisine_id`) REFERENCES `cuisines` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `meal_drinks`
--
ALTER TABLE `meal_drinks`
  ADD CONSTRAINT `meal_drinks_drink_id_foreign` FOREIGN KEY (`drink_id`) REFERENCES `drinks` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `meal_drinks_meal_id_foreign` FOREIGN KEY (`meal_id`) REFERENCES `meals` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `meal_packings`
--
ALTER TABLE `meal_packings`
  ADD CONSTRAINT `meal_packings_meal_id_foreign` FOREIGN KEY (`meal_id`) REFERENCES `meals` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `meal_portions`
--
ALTER TABLE `meal_portions`
  ADD CONSTRAINT `meal_portions_meal_id_foreign` FOREIGN KEY (`meal_id`) REFERENCES `meals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `meal_portions_portion_id_foreign` FOREIGN KEY (`portion_id`) REFERENCES `portions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `meal_sauces`
--
ALTER TABLE `meal_sauces`
  ADD CONSTRAINT `meal_sauces_meal_id_foreign` FOREIGN KEY (`meal_id`) REFERENCES `meals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `meal_sauces_sauce_id_foreign` FOREIGN KEY (`sauce_id`) REFERENCES `sauces` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `meal_sides`
--
ALTER TABLE `meal_sides`
  ADD CONSTRAINT `meal_sides_meal_id_foreign` FOREIGN KEY (`meal_id`) REFERENCES `meals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `meal_sides_side_id_foreign` FOREIGN KEY (`side_id`) REFERENCES `sides` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `meal_snacks`
--
ALTER TABLE `meal_snacks`
  ADD CONSTRAINT `meal_snacks_meal_id_foreign` FOREIGN KEY (`meal_id`) REFERENCES `meals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `meal_snacks_snack_id_foreign` FOREIGN KEY (`snack_id`) REFERENCES `snacks` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `meal_type_items`
--
ALTER TABLE `meal_type_items`
  ADD CONSTRAINT `meal_type_items_meal_type_id_foreign` FOREIGN KEY (`meal_type_id`) REFERENCES `meal_types` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_bundles`
--
ALTER TABLE `package_bundles`
  ADD CONSTRAINT `package_bundles_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_bundle_days`
--
ALTER TABLE `package_bundle_days`
  ADD CONSTRAINT `package_bundle_days_package_bundle_id_foreign` FOREIGN KEY (`package_bundle_id`) REFERENCES `package_bundles` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_bundle_days_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_bundle_types`
--
ALTER TABLE `package_bundle_types`
  ADD CONSTRAINT `package_bundle_types_meal_type_id_foreign` FOREIGN KEY (`meal_type_id`) REFERENCES `meal_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_bundle_types_package_bundle_id_foreign` FOREIGN KEY (`package_bundle_id`) REFERENCES `package_bundles` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_bundle_types_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_intakes`
--
ALTER TABLE `package_intakes`
  ADD CONSTRAINT `package_intakes_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_intake_meals`
--
ALTER TABLE `package_intake_meals`
  ADD CONSTRAINT `package_intake_meals_meal_type_id_foreign` FOREIGN KEY (`meal_type_id`) REFERENCES `meal_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_intake_meals_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_intake_meals_package_intake_id_foreign` FOREIGN KEY (`package_intake_id`) REFERENCES `package_intakes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_meals`
--
ALTER TABLE `package_meals`
  ADD CONSTRAINT `package_meals_meal_id_foreign` FOREIGN KEY (`meal_id`) REFERENCES `meals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meals_meal_type_id_foreign` FOREIGN KEY (`meal_type_id`) REFERENCES `meal_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meals_meal_type_item_id_foreign` FOREIGN KEY (`meal_type_item_id`) REFERENCES `meal_type_items` (`id`) ON DELETE SET NULL,
  ADD CONSTRAINT `package_meals_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meals_package_intake_id_foreign` FOREIGN KEY (`package_intake_id`) REFERENCES `package_intakes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_meal_drinks`
--
ALTER TABLE `package_meal_drinks`
  ADD CONSTRAINT `package_meal_drinks_drink_id_foreign` FOREIGN KEY (`drink_id`) REFERENCES `drinks` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_drinks_meal_drink_id_foreign` FOREIGN KEY (`meal_drink_id`) REFERENCES `meal_drinks` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_drinks_package_meal_id_foreign` FOREIGN KEY (`package_meal_id`) REFERENCES `package_meals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_drinks_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_meal_packings`
--
ALTER TABLE `package_meal_packings`
  ADD CONSTRAINT `package_meal_packings_meal_packing_id_foreign` FOREIGN KEY (`meal_packing_id`) REFERENCES `meal_packings` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_packings_package_meal_id_foreign` FOREIGN KEY (`package_meal_id`) REFERENCES `package_meals` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_meal_portions`
--
ALTER TABLE `package_meal_portions`
  ADD CONSTRAINT `package_meal_portions_meal_portion_id_foreign` FOREIGN KEY (`meal_portion_id`) REFERENCES `meal_portions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_portions_package_meal_id_foreign` FOREIGN KEY (`package_meal_id`) REFERENCES `package_meals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_portions_portion_id_foreign` FOREIGN KEY (`portion_id`) REFERENCES `portions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_portions_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_meal_sauces`
--
ALTER TABLE `package_meal_sauces`
  ADD CONSTRAINT `package_meal_sauces_meal_sauce_id_foreign` FOREIGN KEY (`meal_sauce_id`) REFERENCES `meal_sauces` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_sauces_package_meal_id_foreign` FOREIGN KEY (`package_meal_id`) REFERENCES `package_meals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_sauces_sauce_id_foreign` FOREIGN KEY (`sauce_id`) REFERENCES `sauces` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_sauces_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_meal_sides`
--
ALTER TABLE `package_meal_sides`
  ADD CONSTRAINT `package_meal_sides_meal_side_id_foreign` FOREIGN KEY (`meal_side_id`) REFERENCES `meal_sides` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_sides_package_meal_id_foreign` FOREIGN KEY (`package_meal_id`) REFERENCES `package_meals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_sides_side_id_foreign` FOREIGN KEY (`side_id`) REFERENCES `sides` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_sides_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_meal_snacks`
--
ALTER TABLE `package_meal_snacks`
  ADD CONSTRAINT `package_meal_snacks_meal_snack_id_foreign` FOREIGN KEY (`meal_snack_id`) REFERENCES `meal_snacks` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_snacks_package_meal_id_foreign` FOREIGN KEY (`package_meal_id`) REFERENCES `package_meals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_snacks_snack_id_foreign` FOREIGN KEY (`snack_id`) REFERENCES `snacks` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_meal_snacks_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_plans`
--
ALTER TABLE `package_plans`
  ADD CONSTRAINT `package_plans_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plans_package_intake_id_foreign` FOREIGN KEY (`package_intake_id`) REFERENCES `package_intakes` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_plan_drinks`
--
ALTER TABLE `package_plan_drinks`
  ADD CONSTRAINT `package_plan_drinks_drink_id_foreign` FOREIGN KEY (`drink_id`) REFERENCES `drinks` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_drinks_meal_type_id_foreign` FOREIGN KEY (`meal_type_id`) REFERENCES `meal_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_drinks_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_drinks_package_intake_id_foreign` FOREIGN KEY (`package_intake_id`) REFERENCES `package_intakes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_drinks_package_plan_id_foreign` FOREIGN KEY (`package_plan_id`) REFERENCES `package_plans` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_plan_meals`
--
ALTER TABLE `package_plan_meals`
  ADD CONSTRAINT `package_plan_meals_meal_id_foreign` FOREIGN KEY (`meal_id`) REFERENCES `meals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_meals_meal_type_id_foreign` FOREIGN KEY (`meal_type_id`) REFERENCES `meal_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_meals_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_meals_package_intake_id_foreign` FOREIGN KEY (`package_intake_id`) REFERENCES `package_intakes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_meals_package_meal_id_foreign` FOREIGN KEY (`package_meal_id`) REFERENCES `package_meals` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_meals_package_plan_id_foreign` FOREIGN KEY (`package_plan_id`) REFERENCES `package_plans` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_plan_sides`
--
ALTER TABLE `package_plan_sides`
  ADD CONSTRAINT `package_plan_sides_meal_type_id_foreign` FOREIGN KEY (`meal_type_id`) REFERENCES `meal_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_sides_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_sides_package_intake_id_foreign` FOREIGN KEY (`package_intake_id`) REFERENCES `package_intakes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_sides_package_plan_id_foreign` FOREIGN KEY (`package_plan_id`) REFERENCES `package_plans` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_sides_side_id_foreign` FOREIGN KEY (`side_id`) REFERENCES `sides` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `package_plan_snacks`
--
ALTER TABLE `package_plan_snacks`
  ADD CONSTRAINT `package_plan_snacks_meal_type_id_foreign` FOREIGN KEY (`meal_type_id`) REFERENCES `meal_types` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_snacks_package_id_foreign` FOREIGN KEY (`package_id`) REFERENCES `packages` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_snacks_package_intake_id_foreign` FOREIGN KEY (`package_intake_id`) REFERENCES `package_intakes` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_snacks_package_plan_id_foreign` FOREIGN KEY (`package_plan_id`) REFERENCES `package_plans` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `package_plan_snacks_snack_id_foreign` FOREIGN KEY (`snack_id`) REFERENCES `snacks` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `portions`
--
ALTER TABLE `portions`
  ADD CONSTRAINT `portions_cuisine_id_foreign` FOREIGN KEY (`cuisine_id`) REFERENCES `cuisines` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `portion_components`
--
ALTER TABLE `portion_components`
  ADD CONSTRAINT `portion_components_component_id_foreign` FOREIGN KEY (`component_id`) REFERENCES `components` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `portion_components_portion_id_foreign` FOREIGN KEY (`portion_id`) REFERENCES `portions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `portion_components_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `portion_packings`
--
ALTER TABLE `portion_packings`
  ADD CONSTRAINT `portion_packings_portion_id_foreign` FOREIGN KEY (`portion_id`) REFERENCES `portions` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `portion_portions`
--
ALTER TABLE `portion_portions`
  ADD CONSTRAINT `portion_portions_portion_id_foreign` FOREIGN KEY (`portion_id`) REFERENCES `portions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `portion_portions_subportion_id_foreign` FOREIGN KEY (`subportion_id`) REFERENCES `portions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `portion_portions_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `sauces`
--
ALTER TABLE `sauces`
  ADD CONSTRAINT `sauces_cuisine_id_foreign` FOREIGN KEY (`cuisine_id`) REFERENCES `cuisines` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `sauce_components`
--
ALTER TABLE `sauce_components`
  ADD CONSTRAINT `sauce_components_component_id_foreign` FOREIGN KEY (`component_id`) REFERENCES `components` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `sauce_components_sauce_id_foreign` FOREIGN KEY (`sauce_id`) REFERENCES `sauces` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `sauce_components_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `sauce_packings`
--
ALTER TABLE `sauce_packings`
  ADD CONSTRAINT `sauce_packings_sauce_id_foreign` FOREIGN KEY (`sauce_id`) REFERENCES `sauces` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `sauce_portions`
--
ALTER TABLE `sauce_portions`
  ADD CONSTRAINT `sauce_portions_portion_id_foreign` FOREIGN KEY (`portion_id`) REFERENCES `portions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `sauce_portions_sauce_id_foreign` FOREIGN KEY (`sauce_id`) REFERENCES `sauces` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `sauce_portions_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `sides`
--
ALTER TABLE `sides`
  ADD CONSTRAINT `sides_cuisine_id_foreign` FOREIGN KEY (`cuisine_id`) REFERENCES `cuisines` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `side_components`
--
ALTER TABLE `side_components`
  ADD CONSTRAINT `side_components_component_id_foreign` FOREIGN KEY (`component_id`) REFERENCES `components` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `side_components_side_id_foreign` FOREIGN KEY (`side_id`) REFERENCES `sides` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `side_components_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `side_packings`
--
ALTER TABLE `side_packings`
  ADD CONSTRAINT `side_packings_side_id_foreign` FOREIGN KEY (`side_id`) REFERENCES `sides` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `side_portions`
--
ALTER TABLE `side_portions`
  ADD CONSTRAINT `side_portions_portion_id_foreign` FOREIGN KEY (`portion_id`) REFERENCES `portions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `side_portions_side_id_foreign` FOREIGN KEY (`side_id`) REFERENCES `sides` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `side_portions_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `snacks`
--
ALTER TABLE `snacks`
  ADD CONSTRAINT `snacks_cuisine_id_foreign` FOREIGN KEY (`cuisine_id`) REFERENCES `cuisines` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `snack_components`
--
ALTER TABLE `snack_components`
  ADD CONSTRAINT `snack_components_component_id_foreign` FOREIGN KEY (`component_id`) REFERENCES `components` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `snack_components_snack_id_foreign` FOREIGN KEY (`snack_id`) REFERENCES `snacks` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `snack_components_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `snack_packings`
--
ALTER TABLE `snack_packings`
  ADD CONSTRAINT `snack_packings_snack_id_foreign` FOREIGN KEY (`snack_id`) REFERENCES `snacks` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `snack_portions`
--
ALTER TABLE `snack_portions`
  ADD CONSTRAINT `snack_portions_portion_id_foreign` FOREIGN KEY (`portion_id`) REFERENCES `portions` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `snack_portions_snack_id_foreign` FOREIGN KEY (`snack_id`) REFERENCES `snacks` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `snack_portions_unit_id_foreign` FOREIGN KEY (`unit_id`) REFERENCES `units` (`id`) ON DELETE CASCADE;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
