CREATE TABLE `audits` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_type` varchar(255) DEFAULT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `event` varchar(255) NOT NULL,
  `auditable_type` varchar(255) NOT NULL,
  `auditable_id` bigint(20) unsigned NOT NULL,
  `old_values` text DEFAULT NULL,
  `new_values` text DEFAULT NULL,
  `url` text DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` varchar(1023) DEFAULT NULL,
  `tags` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `audits_auditable_type_auditable_id_index` (`auditable_type`,`auditable_id`),
  KEY `audits_user_id_user_type_index` (`user_id`,`user_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `cashflow_lines` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `cmt` double(8,2) DEFAULT NULL,
  `cmt_terms` int(11) DEFAULT NULL,
  `cmt_currency` enum('€','£','$') NOT NULL,
  `yarn` double(8,2) DEFAULT NULL,
  `yarn_terms` int(11) DEFAULT NULL,
  `yarn_currency` enum('€','£','$') NOT NULL,
  `sale` double(8,2) DEFAULT NULL,
  `sale_terms` int(11) DEFAULT NULL,
  `sale_currency` enum('€','£','$') NOT NULL,
  `vat` double(8,2) DEFAULT NULL,
  `customer_po` varchar(255) DEFAULT NULL,
  `customer_ref` varchar(255) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `colour` varchar(255) DEFAULT NULL,
  `incoterms` enum('EXW','FCA','CPT','CIP','DAP','DPU','DDP','FAS','FOB','CFR','CIF') NOT NULL,
  `exfty` varchar(255) DEFAULT NULL,
  `cashflows_id` bigint(20) unsigned DEFAULT NULL,
  `shipment_lines_id` bigint(20) unsigned DEFAULT NULL,
  `seasons_id` bigint(20) unsigned DEFAULT NULL,
  `suppliers_id` bigint(20) unsigned DEFAULT NULL,
  `customers_id` bigint(20) unsigned DEFAULT NULL,
  `designs_id` bigint(20) unsigned DEFAULT NULL,
  `factored` tinyint(1) NOT NULL DEFAULT 0,
  `qty` double(8,2) DEFAULT NULL,
  `is_full_factored` tinyint(1) NOT NULL DEFAULT 0,
  `is_compelte` tinyint(1) NOT NULL DEFAULT 0,
  `is_complete` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `cashflow_lines_cashflows_id_foreign` (`cashflows_id`),
  KEY `cashflow_lines_shipment_lines_id_foreign` (`shipment_lines_id`),
  KEY `cashflow_lines_seasons_id_foreign` (`seasons_id`),
  KEY `cashflow_lines_suppliers_id_foreign` (`suppliers_id`),
  KEY `cashflow_lines_customers_id_foreign` (`customers_id`),
  KEY `cashflow_lines_designs_id_foreign` (`designs_id`),
  CONSTRAINT `cashflow_lines_cashflows_id_foreign` FOREIGN KEY (`cashflows_id`) REFERENCES `cashflows` (`id`) ON DELETE SET NULL,
  CONSTRAINT `cashflow_lines_customers_id_foreign` FOREIGN KEY (`customers_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `cashflow_lines_designs_id_foreign` FOREIGN KEY (`designs_id`) REFERENCES `designs` (`id`) ON DELETE SET NULL,
  CONSTRAINT `cashflow_lines_seasons_id_foreign` FOREIGN KEY (`seasons_id`) REFERENCES `seasons` (`id`) ON DELETE SET NULL,
  CONSTRAINT `cashflow_lines_shipment_lines_id_foreign` FOREIGN KEY (`shipment_lines_id`) REFERENCES `shipment_lines` (`id`) ON DELETE SET NULL,
  CONSTRAINT `cashflow_lines_suppliers_id_foreign` FOREIGN KEY (`suppliers_id`) REFERENCES `suppliers` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `cashflows` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`data`)),
  `locked` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `colourway_yarns` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `colourways_id` bigint(20) unsigned NOT NULL,
  `cust_ref` varchar(255) DEFAULT NULL,
  `percentage` double DEFAULT NULL,
  `price` double DEFAULT NULL,
  `not_full_factored` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `yarn_colours_id` bigint(20) unsigned NOT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `colourway_yarns_colourways_id_foreign` (`colourways_id`),
  KEY `colourway_yarns_yarn_colours_id_foreign` (`yarn_colours_id`),
  CONSTRAINT `colourway_yarns_colourways_id_foreign` FOREIGN KEY (`colourways_id`) REFERENCES `colourways` (`id`) ON DELETE CASCADE,
  CONSTRAINT `colourway_yarns_yarn_colours_id_foreign` FOREIGN KEY (`yarn_colours_id`) REFERENCES `yarn_colours` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `colourways` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `style_versions_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `image` varchar(255) DEFAULT NULL,
  `comments` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `cancelled` tinyint(1) NOT NULL DEFAULT 0,
  `accessories` text DEFAULT NULL,
  `colour_type` enum('solid','melange','mixed') NOT NULL DEFAULT 'solid',
  `img_thumb` varchar(255) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `composition` varchar(255) DEFAULT NULL,
  `customer_description` varchar(255) DEFAULT NULL,
  `testing_comments` varchar(255) DEFAULT NULL,
  `colour_approval_comments` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `colourways_style_versions_id_foreign` (`style_versions_id`),
  CONSTRAINT `colourways_style_versions_id_foreign` FOREIGN KEY (`style_versions_id`) REFERENCES `style_versions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `commodity_codes` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `description` text NOT NULL,
  `cet_duty_rate` varchar(255) NOT NULL,
  `ukgt_duty_rate` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `countries` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `country` varchar(255) NOT NULL,
  `code` char(2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `countries_code_unique` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `counts` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `count` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `customer_addresses` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `customer_id` bigint(20) unsigned NOT NULL,
  `line1` varchar(255) NOT NULL,
  `line2` varchar(255) DEFAULT NULL,
  `line3` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `region` varchar(255) DEFAULT NULL,
  `postcode` varchar(255) DEFAULT NULL,
  `countries_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `customer_addresses_customer_id_foreign` (`customer_id`),
  KEY `customer_addresses_countries_id_foreign` (`countries_id`),
  CONSTRAINT `customer_addresses_countries_id_foreign` FOREIGN KEY (`countries_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE,
  CONSTRAINT `customer_addresses_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `customer_agents` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `name` text NOT NULL,
  `email` text NOT NULL,
  `phone` text NOT NULL,
  `customers_id` bigint(20) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `customer_agents_customers_id_foreign` (`customers_id`),
  CONSTRAINT `customer_agents_customers_id_foreign` FOREIGN KEY (`customers_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `customer_order_files` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `customer_orders_id` bigint(20) unsigned NOT NULL,
  `filename` varchar(255) NOT NULL,
  `file` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `customer_order_files_customer_orders_id_foreign` (`customer_orders_id`),
  CONSTRAINT `customer_order_files_customer_orders_id_foreign` FOREIGN KEY (`customer_orders_id`) REFERENCES `customer_orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `customer_order_line_quantities` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `customer_order_lines_id` bigint(20) unsigned NOT NULL,
  `sizes_id` bigint(20) unsigned NOT NULL,
  `qty` int(11) NOT NULL,
  `SKU` varchar(255) DEFAULT NULL,
  `barcode` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `price` double(8,2) DEFAULT NULL,
  `discount` double(8,2) DEFAULT NULL,
  `commission` double(8,2) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `quote_cache` decimal(10,2) DEFAULT NULL,
  `cmt_cache` decimal(10,2) DEFAULT NULL,
  `cost_cache` decimal(10,2) DEFAULT NULL,
  `quote_status_cache` varchar(255) DEFAULT NULL,
  `cmt_status_cache` varchar(255) DEFAULT NULL,
  `transport_budget_cache` decimal(10,2) DEFAULT NULL,
  `prices_id` bigint(20) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `customer_order_line_quantities_customer_order_lines_id_foreign` (`customer_order_lines_id`),
  KEY `customer_order_line_quantities_sizes_id_foreign` (`sizes_id`),
  KEY `customer_order_line_quantities_prices_id_foreign` (`prices_id`),
  CONSTRAINT `customer_order_line_quantities_customer_order_lines_id_foreign` FOREIGN KEY (`customer_order_lines_id`) REFERENCES `customer_order_lines` (`id`) ON DELETE CASCADE,
  CONSTRAINT `customer_order_line_quantities_prices_id_foreign` FOREIGN KEY (`prices_id`) REFERENCES `prices` (`id`) ON DELETE SET NULL,
  CONSTRAINT `customer_order_line_quantities_sizes_id_foreign` FOREIGN KEY (`sizes_id`) REFERENCES `sizes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `customer_order_lines` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `customer_orders_id` bigint(20) unsigned NOT NULL,
  `colourways_id` bigint(20) unsigned NOT NULL,
  `location` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `actual_ship_date` date DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `factory_cust_date` date DEFAULT NULL,
  `cp_notes` text DEFAULT NULL,
  `colour_approved_date` date DEFAULT NULL,
  `lab_dips_sent_date` date DEFAULT NULL,
  `colour_approval_comments` text DEFAULT NULL,
  `wh_cust_date` date DEFAULT NULL,
  `start_knit` date DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `bulk_yarn_order_date` varchar(255) DEFAULT NULL,
  `bulk_yarn_order_comments` varchar(255) DEFAULT NULL,
  `bulk_yarn_order_delivery_date` varchar(255) DEFAULT NULL,
  `bulk_yarn_order_delivery_comments` varchar(255) DEFAULT NULL,
  `order_sent_factory` date DEFAULT NULL,
  `cancelled` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  KEY `customer_order_lines_customer_orders_id_foreign` (`customer_orders_id`),
  KEY `customer_order_lines_colourways_id_foreign` (`colourways_id`),
  CONSTRAINT `customer_order_lines_colourways_id_foreign` FOREIGN KEY (`colourways_id`) REFERENCES `colourways` (`id`) ON DELETE CASCADE,
  CONSTRAINT `customer_order_lines_customer_orders_id_foreign` FOREIGN KEY (`customer_orders_id`) REFERENCES `customer_orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `customer_orders` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `departments_id` bigint(20) unsigned NOT NULL,
  `seasons_id` bigint(20) unsigned NOT NULL,
  `customers_id` bigint(20) unsigned NOT NULL,
  `customer_po` varchar(255) NOT NULL,
  `order_date` date DEFAULT NULL,
  `cancelled` tinyint(1) NOT NULL DEFAULT 0,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `incoterms` enum('EXW','FCA','CPT','CIP','DAP','DPU','DDP','FAS','FOB','CFR','CIF') NOT NULL,
  `cust_ship_no` varchar(255) DEFAULT NULL,
  `customer_addresses_id` bigint(20) unsigned DEFAULT NULL,
  `incomplete_flag` tinyint(1) NOT NULL DEFAULT 0,
  `order_type` enum('wholesale','commission') NOT NULL DEFAULT 'wholesale',
  `sent_to_factory` date DEFAULT NULL,
  `asn` text DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `received` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `customer_orders_departments_id_foreign` (`departments_id`),
  KEY `customer_orders_seasons_id_foreign` (`seasons_id`),
  KEY `customer_orders_customers_id_foreign` (`customers_id`),
  KEY `customer_orders_customer_addresses_id_foreign` (`customer_addresses_id`),
  CONSTRAINT `customer_orders_customer_addresses_id_foreign` FOREIGN KEY (`customer_addresses_id`) REFERENCES `customer_addresses` (`id`) ON DELETE SET NULL,
  CONSTRAINT `customer_orders_customers_id_foreign` FOREIGN KEY (`customers_id`) REFERENCES `customers` (`id`),
  CONSTRAINT `customer_orders_departments_id_foreign` FOREIGN KEY (`departments_id`) REFERENCES `departments` (`id`) ON DELETE CASCADE,
  CONSTRAINT `customer_orders_seasons_id_foreign` FOREIGN KEY (`seasons_id`) REFERENCES `seasons` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `customers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `countries_id` bigint(20) unsigned NOT NULL,
  `contact` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `finance_contact` varchar(255) DEFAULT NULL,
  `finance_email` varchar(255) DEFAULT NULL,
  `finance_phone` varchar(255) DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `finance_notes` text DEFAULT NULL,
  `payment_terms` int(10) unsigned DEFAULT NULL,
  `factored` tinyint(1) DEFAULT NULL,
  `currency` enum('€','£','$') NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `settings` text DEFAULT NULL,
  `show_mid` tinyint(1) DEFAULT NULL,
  `logo` varchar(255) DEFAULT NULL,
  `show_embroidery` tinyint(1) DEFAULT NULL,
  `customs` tinyint(1) DEFAULT NULL,
  `yc_email` varchar(255) DEFAULT NULL,
  `yc_address` text DEFAULT NULL,
  `vat` varchar(255) DEFAULT NULL,
  `eori` varchar(255) DEFAULT NULL,
  `samples_required` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`samples_required`)),
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `customers_name_unique` (`name`),
  UNIQUE KEY `customers_email_unique` (`email`),
  UNIQUE KEY `customers_finance_email_unique` (`finance_email`),
  KEY `customers_countries_id_foreign` (`countries_id`),
  CONSTRAINT `customers_countries_id_foreign` FOREIGN KEY (`countries_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `departments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `type` enum('wholesale','commission') NOT NULL DEFAULT 'wholesale',
  `hidden` tinyint(1) NOT NULL DEFAULT 0,
  `locked` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `departments_description_unique` (`description`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `designs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(255) NOT NULL,
  `customers_id` bigint(20) unsigned NOT NULL,
  `issued` date DEFAULT NULL,
  `gauge_id` bigint(20) unsigned NOT NULL,
  `yarn` varchar(255) NOT NULL,
  `factory_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `designs_customers_id_foreign` (`customers_id`),
  KEY `designs_gauge_id_foreign` (`gauge_id`),
  KEY `designs_factory_id_foreign` (`factory_id`),
  CONSTRAINT `designs_customers_id_foreign` FOREIGN KEY (`customers_id`) REFERENCES `customers` (`id`),
  CONSTRAINT `designs_factory_id_foreign` FOREIGN KEY (`factory_id`) REFERENCES `suppliers` (`id`),
  CONSTRAINT `designs_gauge_id_foreign` FOREIGN KEY (`gauge_id`) REFERENCES `gauges` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `failed_jobs` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) NOT NULL,
  `connection` text NOT NULL,
  `queue` text NOT NULL,
  `payload` longtext NOT NULL,
  `exception` longtext NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT current_timestamp(),
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `gauges` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `gauge` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `materials` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `material` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `materials_material_unique` (`material`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `prices` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `style_versions_id` bigint(20) unsigned DEFAULT NULL,
  `name` varchar(255) DEFAULT NULL,
  `model` enum('standard','full_factored','manual') DEFAULT NULL,
  `yarn_trans` double(8,2) DEFAULT NULL,
  `yarn_trans_currency` char(3) DEFAULT '€',
  `cmt` double(8,2) DEFAULT NULL,
  `cmt_currency` char(3) DEFAULT '€',
  `gmt_trans` double(8,2) DEFAULT NULL,
  `gmt_trans_currency` char(3) DEFAULT '€',
  `notes` text DEFAULT NULL,
  `aoc` double NOT NULL DEFAULT 0,
  `weight` double(8,2) DEFAULT NULL,
  `yarn` double(8,2) DEFAULT NULL,
  `fabric` double(8,2) DEFAULT NULL,
  `accessory` double(8,2) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `yarn_currency` char(3) DEFAULT '€',
  `fabric_currency` char(3) DEFAULT '€',
  `accessory_currency` char(3) DEFAULT '€',
  `target` double(8,2) DEFAULT NULL,
  `costed_weight` double(8,5) DEFAULT NULL,
  `min_qty` int(11) DEFAULT NULL,
  `label` double(8,2) DEFAULT NULL,
  `label_currency` char(3) DEFAULT '€',
  `yarn_value` double(8,2) DEFAULT NULL,
  `yarn_value_currency` char(3) DEFAULT '€',
  `sizes_id` bigint(20) unsigned DEFAULT NULL,
  `customer_notes` text DEFAULT NULL,
  `embroidery` double(8,2) DEFAULT NULL,
  `embroidery_currency` char(3) DEFAULT '€',
  `testing` double(8,2) DEFAULT NULL,
  `testing_courier` double(8,2) DEFAULT NULL,
  `weight_comments` text DEFAULT NULL,
  `cost_comments` text DEFAULT NULL,
  `comments_toggle` tinyint(1) DEFAULT 0,
  `colourways_id` bigint(20) unsigned DEFAULT NULL,
  `cmt_status` enum('not_confirmed','estimate','confirmed') NOT NULL,
  `quote_status` enum('not_confirmed','estimate','confirmed') NOT NULL,
  `valid_until` date DEFAULT NULL,
  `colour_type` enum('solid','melange','mixed') DEFAULT NULL,
  `quote` double(8,2) DEFAULT NULL,
  `quotes_sent` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`quotes_sent`)),
  `deleted_at` timestamp NULL DEFAULT NULL,
  `discount` int(11) DEFAULT NULL,
  `duty` double(8,2) NOT NULL DEFAULT 0.00,
  PRIMARY KEY (`id`),
  KEY `prices_style_versions_id_foreign` (`style_versions_id`),
  KEY `prices_sizes_id_foreign` (`sizes_id`),
  KEY `prices_colourways_id_foreign` (`colourways_id`),
  CONSTRAINT `prices_colourways_id_foreign` FOREIGN KEY (`colourways_id`) REFERENCES `colourways` (`id`) ON DELETE CASCADE,
  CONSTRAINT `prices_sizes_id_foreign` FOREIGN KEY (`sizes_id`) REFERENCES `sizes` (`id`) ON DELETE CASCADE,
  CONSTRAINT `prices_style_versions_id_foreign` FOREIGN KEY (`style_versions_id`) REFERENCES `style_versions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `sample_types` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `charge` tinyint(1) DEFAULT NULL,
  `charge_proto` tinyint(1) DEFAULT NULL,
  `charge_surcharge` tinyint(1) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sample_types_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `samples` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `sample_types_id` bigint(20) unsigned NOT NULL,
  `colourways_id` bigint(20) unsigned DEFAULT NULL,
  `date_expected` date DEFAULT NULL,
  `date_sent` date DEFAULT NULL,
  `tracking` varchar(255) DEFAULT NULL,
  `weight` double DEFAULT NULL,
  `sizes_id` bigint(20) unsigned DEFAULT NULL,
  `date_received` date DEFAULT NULL,
  `do_not_charge` tinyint(1) NOT NULL DEFAULT 0,
  `comments` text DEFAULT NULL,
  `qty` int(11) DEFAULT NULL,
  `rt_invoice` varchar(255) DEFAULT NULL,
  `fty_invoice` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `do_not_charge_dev` tinyint(1) DEFAULT 0,
  `finance_comments` text DEFAULT NULL,
  `fn_notes` text DEFAULT NULL,
  `po` varchar(255) DEFAULT NULL,
  `approved_date` date DEFAULT NULL,
  `status` enum('pending','approved','rejected') NOT NULL DEFAULT 'pending',
  `production_comment` varchar(255) DEFAULT NULL,
  `fn_complete` tinyint(1) NOT NULL DEFAULT 0,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `samples_sample_types_id_foreign` (`sample_types_id`),
  KEY `samples_colourways_id_foreign` (`colourways_id`),
  KEY `samples_sizes_id_foreign` (`sizes_id`),
  CONSTRAINT `samples_colourways_id_foreign` FOREIGN KEY (`colourways_id`) REFERENCES `colourways` (`id`) ON DELETE CASCADE,
  CONSTRAINT `samples_sample_types_id_foreign` FOREIGN KEY (`sample_types_id`) REFERENCES `sample_types` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `seasons` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(255) NOT NULL,
  `start_date` date NOT NULL,
  `end_date` date NOT NULL,
  `euro_rate` double(8,2) NOT NULL,
  `usd_rate` double(8,2) NOT NULL,
  `markup` tinyint(4) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `settings` text DEFAULT NULL,
  `gbp_rate` double(8,2) NOT NULL DEFAULT 1.00,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `locked` tinyint(1) NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `seasons_description_unique` (`description`),
  UNIQUE KEY `seasons_start_date_unique` (`start_date`),
  UNIQUE KEY `seasons_end_date_unique` (`end_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `sessions` (
  `id` varchar(255) NOT NULL,
  `user_id` bigint(20) unsigned DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `user_agent` text DEFAULT NULL,
  `payload` text NOT NULL,
  `last_activity` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `shipment_files` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `shipment_id` bigint(20) unsigned NOT NULL,
  `filename` varchar(255) NOT NULL,
  `file` varchar(255) NOT NULL,
  `type` enum('customs','transporters_invoice','packingList','other') NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `shipment_files_shipment_id_foreign` (`shipment_id`),
  CONSTRAINT `shipment_files_shipment_id_foreign` FOREIGN KEY (`shipment_id`) REFERENCES `shipments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `shipment_line_sizes` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `sizes_id` bigint(20) unsigned NOT NULL,
  `shipment_line_id` bigint(20) unsigned NOT NULL,
  `qty` double(8,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `shipped_qty` double(8,2) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `shipment_line_sizes_sizes_id_foreign` (`sizes_id`),
  KEY `shipment_line_sizes_shipment_line_id_foreign` (`shipment_line_id`),
  CONSTRAINT `shipment_line_sizes_shipment_line_id_foreign` FOREIGN KEY (`shipment_line_id`) REFERENCES `shipment_lines` (`id`) ON DELETE CASCADE,
  CONSTRAINT `shipment_line_sizes_sizes_id_foreign` FOREIGN KEY (`sizes_id`) REFERENCES `sizes` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `shipment_lines` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `shipment_id` bigint(20) unsigned DEFAULT NULL,
  `customer_order_lines_id` bigint(20) unsigned NOT NULL,
  `truck_plates` varchar(255) DEFAULT NULL,
  `collection_date` date DEFAULT NULL,
  `delivery_date` date DEFAULT NULL,
  `complete` tinyint(1) NOT NULL DEFAULT 0,
  `rt_invoice` varchar(255) DEFAULT NULL,
  `factory_invoice` varchar(255) DEFAULT NULL,
  `customs_agency_invoice` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `cp_notes` text DEFAULT NULL,
  `cp_photoshoot_deadline` date DEFAULT NULL,
  `transporter_invoioce` varchar(255) DEFAULT NULL,
  `ss_comments` text DEFAULT NULL,
  `invoiced` tinyint(1) NOT NULL DEFAULT 0,
  `buttons` text DEFAULT NULL,
  `labels` text DEFAULT NULL,
  `care` text DEFAULT NULL,
  `pp_sent` date DEFAULT NULL,
  `buttons_done` tinyint(1) NOT NULL DEFAULT 0,
  `labels_done` tinyint(1) NOT NULL DEFAULT 0,
  `care_done` tinyint(1) NOT NULL DEFAULT 0,
  `no_invoiced` int(11) DEFAULT NULL,
  `fn_notes` text DEFAULT NULL,
  `factory_order_yarn` tinyint(1) NOT NULL DEFAULT 0,
  `yarn_comments` text DEFAULT NULL,
  `sealer_deadline` date DEFAULT NULL,
  `exfty` date DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `notes` varchar(255) DEFAULT NULL,
  `shipment_status` enum('approved','rejected','pending') DEFAULT NULL,
  `shipment_comments` text DEFAULT NULL,
  `sealer_status` enum('approved','rejected','pending') DEFAULT NULL,
  `sealer_comments` text DEFAULT NULL,
  `first_exfty` date DEFAULT NULL,
  `start_knit_comments` varchar(255) DEFAULT NULL,
  `shipped_qty` int(11) DEFAULT NULL,
  `customer_invoice_no` varchar(255) DEFAULT NULL,
  `pl_sent_date` date DEFAULT NULL,
  `payment_reference` varchar(255) DEFAULT NULL,
  `bol_reference` varchar(255) DEFAULT NULL,
  `bol_tracking_factory` varchar(255) DEFAULT NULL,
  `bol_tracking_rt` varchar(255) DEFAULT NULL,
  `container_no` varchar(255) DEFAULT NULL,
  `container_eta` date DEFAULT NULL,
  `asn` varchar(255) DEFAULT NULL,
  `asn_transferred_date` date DEFAULT NULL,
  `asn_transferred_comments` varchar(255) DEFAULT NULL,
  `flag_issue` tinyint(1) NOT NULL DEFAULT 0,
  `foy_ordered` tinyint(1) NOT NULL DEFAULT 0,
  `foy_due` date DEFAULT NULL,
  `foy_delivered` tinyint(1) NOT NULL DEFAULT 0,
  `buttons_ordered` tinyint(1) NOT NULL DEFAULT 0,
  `buttons_due` date DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `shipment_lines_shipment_id_foreign` (`shipment_id`),
  KEY `shipment_lines_customer_order_lines_id_foreign` (`customer_order_lines_id`),
  CONSTRAINT `shipment_lines_customer_order_lines_id_foreign` FOREIGN KEY (`customer_order_lines_id`) REFERENCES `customer_order_lines` (`id`) ON DELETE CASCADE,
  CONSTRAINT `shipment_lines_shipment_id_foreign` FOREIGN KEY (`shipment_id`) REFERENCES `shipments` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `shipments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `organiser` varchar(255) DEFAULT NULL,
  `transporter_id` bigint(20) unsigned DEFAULT NULL,
  `cost` double DEFAULT NULL,
  `additional_cost` double(8,2) DEFAULT NULL,
  `customs_submitted` tinyint(1) NOT NULL DEFAULT 0,
  `transporter_invoice` varchar(255) DEFAULT NULL,
  `comments` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `customs_submitted_text` varchar(255) DEFAULT NULL,
  `no_cartons` int(11) DEFAULT NULL,
  `weight` int(11) DEFAULT NULL,
  `no_trucks` int(11) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `shipments_transporter_id_foreign` (`transporter_id`),
  CONSTRAINT `shipments_transporter_id_foreign` FOREIGN KEY (`transporter_id`) REFERENCES `suppliers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `sizes` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `order` int(11) NOT NULL DEFAULT 1,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `sizes_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `style_versions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `styles_id` bigint(20) unsigned NOT NULL,
  `factory_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `gauge_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `yarn_ends` int(11) DEFAULT NULL,
  `issued` date DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `style_versions_styles_id_foreign` (`styles_id`),
  KEY `style_versions_factory_id_foreign` (`factory_id`),
  KEY `style_versions_gauge_id_foreign` (`gauge_id`),
  CONSTRAINT `style_versions_factory_id_foreign` FOREIGN KEY (`factory_id`) REFERENCES `suppliers` (`id`),
  CONSTRAINT `style_versions_gauge_id_foreign` FOREIGN KEY (`gauge_id`) REFERENCES `gauges` (`id`),
  CONSTRAINT `style_versions_styles_id_foreign` FOREIGN KEY (`styles_id`) REFERENCES `styles` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `styles` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `designs_id` bigint(20) unsigned DEFAULT NULL,
  `departments_id` bigint(20) unsigned NOT NULL,
  `seasons_id` bigint(20) unsigned NOT NULL,
  `customers_id` bigint(20) unsigned NOT NULL,
  `customer_ref` varchar(255) DEFAULT NULL,
  `commodity_codes_id` bigint(20) unsigned DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `carryover` tinyint(1) NOT NULL DEFAULT 0,
  `category` enum('mens','ladies','accessories','childrens') DEFAULT NULL,
  `cancelled` tinyint(1) NOT NULL DEFAULT 0,
  `deleted_at` timestamp NULL DEFAULT NULL,
  `customer_samp_no` varchar(255) DEFAULT NULL,
  `green_seal_approval_comments` varchar(255) DEFAULT NULL,
  `photo_shoot_sample_comments` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_key_styles_designs_etc` (`designs_id`,`departments_id`,`seasons_id`,`customers_id`,`category`,`customer_ref`),
  KEY `styles_departments_id_foreign` (`departments_id`),
  KEY `styles_seasons_id_foreign` (`seasons_id`),
  KEY `styles_customers_id_foreign` (`customers_id`),
  KEY `styles_commodity_codes_id_foreign` (`commodity_codes_id`),
  CONSTRAINT `styles_commodity_codes_id_foreign` FOREIGN KEY (`commodity_codes_id`) REFERENCES `commodity_codes` (`id`),
  CONSTRAINT `styles_customers_id_foreign` FOREIGN KEY (`customers_id`) REFERENCES `customers` (`id`),
  CONSTRAINT `styles_departments_id_foreign` FOREIGN KEY (`departments_id`) REFERENCES `departments` (`id`) ON DELETE CASCADE,
  CONSTRAINT `styles_designs_id_foreign` FOREIGN KEY (`designs_id`) REFERENCES `designs` (`id`) ON DELETE CASCADE,
  CONSTRAINT `styles_seasons_id_foreign` FOREIGN KEY (`seasons_id`) REFERENCES `seasons` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `supplier_addresses` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) NOT NULL,
  `suppliers_id` bigint(20) unsigned NOT NULL,
  `line1` varchar(255) NOT NULL,
  `line2` varchar(255) DEFAULT NULL,
  `line3` varchar(255) DEFAULT NULL,
  `city` varchar(255) DEFAULT NULL,
  `region` varchar(255) DEFAULT NULL,
  `postcode` varchar(255) DEFAULT NULL,
  `countries_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `supplier_addresses_suppliers_id_foreign` (`suppliers_id`),
  KEY `supplier_addresses_countries_id_foreign` (`countries_id`),
  CONSTRAINT `supplier_addresses_countries_id_foreign` FOREIGN KEY (`countries_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE,
  CONSTRAINT `supplier_addresses_suppliers_id_foreign` FOREIGN KEY (`suppliers_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `suppliers` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `type` enum('yarn','fabric','accessory','factory','transporter') DEFAULT NULL,
  `name` varchar(255) NOT NULL,
  `countries_id` bigint(20) unsigned NOT NULL,
  `contact` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `phone` varchar(255) DEFAULT NULL,
  `finance_contact` varchar(255) DEFAULT NULL,
  `finance_email` varchar(255) DEFAULT NULL,
  `finance_phone` varchar(255) DEFAULT NULL,
  `payment_terms` int(10) unsigned DEFAULT NULL,
  `currency` enum('€','£','$') NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `customs` tinyint(1) DEFAULT NULL,
  `mid` varchar(255) DEFAULT NULL,
  `logo` varchar(255) DEFAULT NULL,
  `yc_email` varchar(255) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `suppliers_name_unique` (`name`),
  UNIQUE KEY `suppliers_email_unique` (`email`),
  UNIQUE KEY `suppliers_finance_email_unique` (`finance_email`),
  KEY `suppliers_countries_id_foreign` (`countries_id`),
  CONSTRAINT `suppliers_countries_id_foreign` FOREIGN KEY (`countries_id`) REFERENCES `countries` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `team_invitations` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `team_id` bigint(20) unsigned NOT NULL,
  `email` varchar(255) NOT NULL,
  `role` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `team_invitations_team_id_email_unique` (`team_id`,`email`),
  CONSTRAINT `team_invitations_team_id_foreign` FOREIGN KEY (`team_id`) REFERENCES `teams` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `team_user` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `team_id` bigint(20) unsigned NOT NULL,
  `user_id` bigint(20) unsigned NOT NULL,
  `role` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `team_user_team_id_user_id_unique` (`team_id`,`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `teams` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` bigint(20) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `personal_team` tinyint(1) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `teams_user_id_index` (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `user_departments` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `users_id` bigint(20) unsigned DEFAULT NULL,
  `departments_id` bigint(20) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_departments_users_id_foreign` (`users_id`),
  KEY `user_departments_departments_id_foreign` (`departments_id`),
  CONSTRAINT `user_departments_departments_id_foreign` FOREIGN KEY (`departments_id`) REFERENCES `departments` (`id`) ON DELETE CASCADE,
  CONSTRAINT `user_departments_users_id_foreign` FOREIGN KEY (`users_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!50001 DROP VIEW IF EXISTS `vw_colourways`*/;
/*!50001 CREATE VIEW `vw_colourways` AS SELECT
 1 AS `id`,
  1 AS `style_versions_id`,
  1 AS `name`,
  1 AS `image`,
  1 AS `comments`,
  1 AS `created_at`,
  1 AS `updated_at`,
  1 AS `cancelled`,
  1 AS `accessories`,
  1 AS `colour_type`,
  1 AS `img_thumb`,
  1 AS `yarn_cost_kg_eur` */;
/*!50001 DROP VIEW IF EXISTS `vw_critical_path`*/;
/*!50001 CREATE VIEW `vw_critical_path` AS SELECT
 1 AS `id`,
  1 AS `season`,
  1 AS `factory_id`,
  1 AS `factory`,
  1 AS `departments_id`,
  1 AS `customer`,
  1 AS `customer_id`,
  1 AS `order_issued`,
  1 AS `customer_po`,
  1 AS `description`,
  1 AS `colour`,
  1 AS `img_thumb`,
  1 AS `truck`,
  1 AS `truck_organiser`,
  1 AS `truck_price`,
  1 AS `truck_currency`,
  1 AS `transporter`,
  1 AS `collection_date`,
  1 AS `customs_ern`,
  1 AS `shipped`,
  1 AS `rt_invoice`,
  1 AS `factory_invoice`,
  1 AS `customs_invoice`,
  1 AS `transporter_invoice`,
  1 AS `finance_complete`,
  1 AS `complete`,
  1 AS `shipment_id`,
  1 AS `revised_exfty`,
  1 AS `customer_orders_id`,
  1 AS `styles_id`,
  1 AS `colourways_id`,
  1 AS `colour_type`,
  1 AS `style_versions_id`,
  1 AS `cust_currency`,
  1 AS `fact_currency`,
  1 AS `coo`,
  1 AS `fn_notes`,
  1 AS `customer_factored`,
  1 AS `customer_terms`,
  1 AS `seasons_id`,
  1 AS `incoterms`,
  1 AS `customer_exfty`,
  1 AS `yarn_comments`,
  1 AS `buttons_done`,
  1 AS `labels_done`,
  1 AS `care_done`,
  1 AS `factory_order_yarn`,
  1 AS `cp_photoshoot_deadline`,
  1 AS `button`,
  1 AS `label`,
  1 AS `care`,
  1 AS `sealer_required`,
  1 AS `shipment_required`,
  1 AS `style`,
  1 AS `sizes`,
  1 AS `sealer`,
  1 AS `shipment`,
  1 AS `shipped_sizes`,
  1 AS `total_shipped`,
  1 AS `total_qty`,
  1 AS `prices`,
  1 AS `truck_first_collection`,
  1 AS `origional_exfty`,
  1 AS `yarns` */;
/*!50001 DROP VIEW IF EXISTS `vw_finance_samples`*/;
/*!50001 CREATE VIEW `vw_finance_samples` AS SELECT
 1 AS `id`,
  1 AS `season`,
  1 AS `customer`,
  1 AS `rt_no`,
  1 AS `customer_ref`,
  1 AS `description`,
  1 AS `size`,
  1 AS `colourway`,
  1 AS `po`,
  1 AS `sample_type`,
  1 AS `sample_type_id`,
  1 AS `factory`,
  1 AS `carryover`,
  1 AS `qty`,
  1 AS `date_expected`,
  1 AS `date_received`,
  1 AS `date_sent`,
  1 AS `fn_notes`,
  1 AS `rt_invoice`,
  1 AS `fty_invoice`,
  1 AS `finance_comments`,
  1 AS `do_not_charge`,
  1 AS `cust_settings`,
  1 AS `colourways_id`,
  1 AS `colour_type`,
  1 AS `cust_currency`,
  1 AS `fact_currency`,
  1 AS `styles_id`,
  1 AS `orders`,
  1 AS `prices`,
  1 AS `seasons_id`,
  1 AS `factory_id`,
  1 AS `coo`,
  1 AS `departments_id`,
  1 AS `category`,
  1 AS `customers_id`,
  1 AS `fn_complete`,
  1 AS `cw_cancelled`,
  1 AS `s_cancelled` */;
/*!50001 DROP VIEW IF EXISTS `vw_prices`*/;
/*!50001 CREATE VIEW `vw_prices` AS SELECT
 1 AS `margin`,
  1 AS `subtotal_customs_gbp`,
  1 AS `subtotal_gbp`,
  1 AS `yarn_value`,
  1 AS `total_yarn_cost`,
  1 AS `yarnkg`,
  1 AS `yarnkg_currency`,
  1 AS `design_id`,
  1 AS `description`,
  1 AS `style_id`,
  1 AS `customer_ref`,
  1 AS `seasons_id`,
  1 AS `style_version_id`,
  1 AS `style_version_name`,
  1 AS `factory_id`,
  1 AS `factory`,
  1 AS `price_id`,
  1 AS `price_name`,
  1 AS `model`,
  1 AS `comments_toggle`,
  1 AS `sizes_id`,
  1 AS `colour_type`,
  1 AS `colourways_id`,
  1 AS `yarn_trans_currency`,
  1 AS `yarn_trans`,
  1 AS `weight`,
  1 AS `costed_weight`,
  1 AS `cmt`,
  1 AS `cmt_status`,
  1 AS `valid_until`,
  1 AS `aoc`,
  1 AS `accessory_currency`,
  1 AS `accessory`,
  1 AS `label_currency`,
  1 AS `label`,
  1 AS `gmt_trans_currency`,
  1 AS `gmt_trans`,
  1 AS `embroidery_currency`,
  1 AS `embroidery`,
  1 AS `testing`,
  1 AS `testing_courier`,
  1 AS `quote_status`,
  1 AS `target`,
  1 AS `min_qty`,
  1 AS `notes`,
  1 AS `customer_notes`,
  1 AS `fact_currency`,
  1 AS `cust_currency`,
  1 AS `customer_id`,
  1 AS `customer_customs`,
  1 AS `factory_customs`,
  1 AS `season_locked`,
  1 AS `image`,
  1 AS `no_style_version_prices`,
  1 AS `yarn`,
  1 AS `colourways`,
  1 AS `historic`,
  1 AS `quotes_sent`,
  1 AS `weight_comments`,
  1 AS `cost_comments`,
  1 AS `quote`,
  1 AS `quote_gbp`,
  1 AS `coo`,
  1 AS `coo_name`,
  1 AS `departments_id`,
  1 AS `category`,
  1 AS `style_cancelled`,
  1 AS `sizes_name`,
  1 AS `colourways_name`,
  1 AS `last_updated_by`,
  1 AS `yarn_cost_kg` */;
CREATE TABLE `yarn_colours` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `yarn_id` bigint(20) unsigned DEFAULT NULL,
  `reference` varchar(255) NOT NULL,
  `description` varchar(255) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `yarn_colours_yarn_id_foreign` (`yarn_id`),
  CONSTRAINT `yarn_colours_yarn_id_foreign` FOREIGN KEY (`yarn_id`) REFERENCES `yarns` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `yarn_compositions` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `yarn_id` bigint(20) unsigned NOT NULL,
  `materials_id` bigint(20) unsigned NOT NULL,
  `percentage` double(8,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `yarn_compositions_yarn_id_foreign` (`yarn_id`),
  KEY `yarn_compositions_materials_id_foreign` (`materials_id`),
  CONSTRAINT `yarn_compositions_materials_id_foreign` FOREIGN KEY (`materials_id`) REFERENCES `materials` (`id`) ON DELETE CASCADE,
  CONSTRAINT `yarn_compositions_yarn_id_foreign` FOREIGN KEY (`yarn_id`) REFERENCES `yarns` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `yarn_order_files` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `yarn_order_id` bigint(20) unsigned DEFAULT NULL,
  `file` varchar(255) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `filename` varchar(255) NOT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `yarn_order_files_yarn_orders_foreign` (`yarn_order_id`),
  CONSTRAINT `yarn_order_files_yarn_orders_foreign` FOREIGN KEY (`yarn_order_id`) REFERENCES `yarn_orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `yarn_order_line_styles` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `yarn_order_lines_id` bigint(20) unsigned DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `customer_order_lines_id` bigint(20) unsigned DEFAULT NULL,
  `invoice_no` varchar(255) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `yarn_order_line_styles_yarn_order_lines_id_foreign` (`yarn_order_lines_id`),
  KEY `yarn_order_line_styles_customer_order_lines_id_foreign` (`customer_order_lines_id`),
  CONSTRAINT `yarn_order_line_styles_customer_order_lines_id_foreign` FOREIGN KEY (`customer_order_lines_id`) REFERENCES `customer_order_lines` (`id`) ON DELETE CASCADE,
  CONSTRAINT `yarn_order_line_styles_yarn_order_lines_id_foreign` FOREIGN KEY (`yarn_order_lines_id`) REFERENCES `yarn_order_lines` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `yarn_order_lines` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `yarn_order_id` bigint(20) unsigned DEFAULT NULL,
  `price` double(8,2) DEFAULT NULL,
  `qty` double(8,2) NOT NULL,
  `spinner_invoice_no` varchar(255) DEFAULT NULL,
  `factory_invoice_no` varchar(255) DEFAULT NULL,
  `recd` double(8,2) DEFAULT NULL,
  `ship_date` date DEFAULT NULL,
  `actual_ship_date` date DEFAULT NULL,
  `delivery_date` date DEFAULT NULL,
  `notes` text DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `yarn_colours_id` bigint(20) unsigned DEFAULT NULL,
  `invoice_no` varchar(255) DEFAULT NULL,
  `invoiced_qty` varchar(255) DEFAULT NULL,
  `fn_notes` varchar(255) DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `yarn_order_lines_yarn_order_id_foreign` (`yarn_order_id`),
  KEY `yarn_order_lines_yarn_colours_id_foreign` (`yarn_colours_id`),
  CONSTRAINT `yarn_order_lines_yarn_colours_id_foreign` FOREIGN KEY (`yarn_colours_id`) REFERENCES `yarn_colours` (`id`) ON DELETE CASCADE,
  CONSTRAINT `yarn_order_lines_yarn_order_id_foreign` FOREIGN KEY (`yarn_order_id`) REFERENCES `yarn_orders` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `yarn_orders` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `suppliers_id` bigint(20) unsigned DEFAULT NULL,
  `date` date NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `comments` text DEFAULT NULL,
  `invoice_to_id` bigint(20) unsigned NOT NULL,
  `deliver_to_id` bigint(20) unsigned NOT NULL,
  `customers_id` bigint(20) unsigned DEFAULT NULL,
  `seasons_id` bigint(20) unsigned DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `yarn_orders_suppliers_id_foreign` (`suppliers_id`),
  KEY `yarn_orders_customers_id_foreign` (`customers_id`),
  KEY `yarn_orders_seasons_id_foreign` (`seasons_id`),
  CONSTRAINT `yarn_orders_customers_id_foreign` FOREIGN KEY (`customers_id`) REFERENCES `customers` (`id`) ON DELETE SET NULL,
  CONSTRAINT `yarn_orders_seasons_id_foreign` FOREIGN KEY (`seasons_id`) REFERENCES `seasons` (`id`) ON DELETE CASCADE,
  CONSTRAINT `yarn_orders_suppliers_id_foreign` FOREIGN KEY (`suppliers_id`) REFERENCES `suppliers` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `yarns` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `suppliers_id` bigint(20) unsigned NOT NULL,
  `description` varchar(255) NOT NULL,
  `counts_id` bigint(20) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `yarns_suppliers_id_foreign` (`suppliers_id`),
  KEY `yarns_counts_id_foreign` (`counts_id`),
  CONSTRAINT `yarns_counts_id_foreign` FOREIGN KEY (`counts_id`) REFERENCES `counts` (`id`),
  CONSTRAINT `yarns_suppliers_id_foreign` FOREIGN KEY (`suppliers_id`) REFERENCES `suppliers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!50003 DROP FUNCTION IF EXISTS `convert_currency` */;
DELIMITER ;;
CREATE DEFINER=`laravel`@`localhost` FUNCTION `convert_currency`(value float, currency_in char, currency_out char, season_id integer) RETURNS float
    DETERMINISTIC
BEGIN

            RETURN
            CASE when (value = 0 OR value IS NULL)
                THEN 0
                ELSE

                (
                    SELECT
                        (value /
                        CASE currency_in
                            WHEN '€' THEN seasons.euro_rate
                            WHEN '$' THEN seasons.usd_rate
                            WHEN '£' THEN seasons.gbp_rate
                        END)
                        *
                        CASE currency_out
                            WHEN '€' THEN seasons.euro_rate
                            WHEN '$' THEN seasons.usd_rate
                            WHEN '£' THEN seasons.gbp_rate
                        END as price

                    FROM
                    seasons
                    where id=season_id
                )
                END
                ;

            END ;;
DELIMITER ;
/*!50001 DROP VIEW IF EXISTS `vw_colourways`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`laravel`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `vw_colourways` AS select 1 AS `id`,1 AS `style_versions_id`,1 AS `name`,1 AS `image`,1 AS `comments`,1 AS `created_at`,1 AS `updated_at`,1 AS `cancelled`,1 AS `accessories`,1 AS `colour_type`,1 AS `img_thumb`,1 AS `yarn_cost_kg_eur` */;
/*!50001 DROP VIEW IF EXISTS `vw_critical_path`*/;
/*!50001 DROP VIEW IF EXISTS `vw_finance_samples`*/;
/*!50001 DROP VIEW IF EXISTS `vw_prices`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`laravel`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `vw_prices` AS select 1 AS `margin`,1 AS `subtotal_customs_gbp`,1 AS `subtotal_gbp`,1 AS `yarn_value`,1 AS `total_yarn_cost`,1 AS `yarnkg`,1 AS `yarnkg_currency`,1 AS `design_id`,1 AS `description`,1 AS `style_id`,1 AS `customer_ref`,1 AS `seasons_id`,1 AS `style_version_id`,1 AS `style_version_name`,1 AS `factory_id`,1 AS `factory`,1 AS `price_id`,1 AS `price_name`,1 AS `model`,1 AS `comments_toggle`,1 AS `sizes_id`,1 AS `colour_type`,1 AS `colourways_id`,1 AS `yarn_trans_currency`,1 AS `yarn_trans`,1 AS `weight`,1 AS `costed_weight`,1 AS `cmt`,1 AS `cmt_status`,1 AS `valid_until`,1 AS `aoc`,1 AS `accessory_currency`,1 AS `accessory`,1 AS `label_currency`,1 AS `label`,1 AS `gmt_trans_currency`,1 AS `gmt_trans`,1 AS `embroidery_currency`,1 AS `embroidery`,1 AS `testing`,1 AS `testing_courier`,1 AS `quote_status`,1 AS `target`,1 AS `min_qty`,1 AS `notes`,1 AS `customer_notes`,1 AS `fact_currency`,1 AS `cust_currency`,1 AS `customer_id`,1 AS `customer_customs`,1 AS `factory_customs`,1 AS `season_locked`,1 AS `image`,1 AS `no_style_version_prices`,1 AS `yarn`,1 AS `colourways`,1 AS `historic`,1 AS `quotes_sent`,1 AS `weight_comments`,1 AS `cost_comments`,1 AS `quote`,1 AS `quote_gbp`,1 AS `coo`,1 AS `coo_name`,1 AS `departments_id`,1 AS `category`,1 AS `style_cancelled`,1 AS `sizes_name`,1 AS `colourways_name`,1 AS `last_updated_by`,1 AS `yarn_cost_kg` */;


INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1,'2014_10_12_000000_create_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (2,'2014_10_12_100000_create_password_resets_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (3,'2014_10_12_200000_add_two_factor_columns_to_users_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (4,'2019_08_19_000000_create_failed_jobs_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (5,'2019_12_14_000001_create_personal_access_tokens_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (6,'2020_03_22_172334_create_countries_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (7,'2020_03_23_110941_create_departments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (8,'2020_03_23_121055_create_commodity_codes_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (9,'2020_05_21_100000_create_teams_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (10,'2020_05_21_200000_create_team_user_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (11,'2020_05_21_300000_create_team_invitations_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (12,'2021_03_25_075235_create_suppliers_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (13,'2021_03_26_090555_create_customers_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (14,'2021_03_26_151632_create_customer_addresses_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (15,'2021_03_26_151641_create_supplier_addresses_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (16,'2021_04_04_085436_create_seasons_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (17,'2021_04_20_102112_create_fabrics_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (18,'2021_07_11_104852_create_sizes_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (19,'2021_07_15_122517_create_gauges_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (20,'2021_07_15_122524_create_counts_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (21,'2021_07_16_082551_create_raw_materials_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (22,'2021_07_16_082551_create_yarns_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (23,'2021_08_12_103520_create_designs_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (24,'2021_08_12_103523_create_styles_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (25,'2021_08_12_124715_create_style_versions_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (26,'2021_08_12_161735_create_style_version_prices_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (27,'2021_08_12_162019_create_colourways',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (28,'2021_08_12_162818_create_colourway_yarns_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (29,'2021_08_12_162947_create_colourway_fabrics_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (30,'2021_08_12_165115_create_customer_orders_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (31,'2021_08_12_170019_create_customer_order_lines_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (32,'2021_08_12_171614_add_style_version_prices_id_to_styles',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (33,'2021_08_12_172041_create_customer_order_line_quantities_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (34,'2021_08_19_142352_create_customer_order_line_knit_dates_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (35,'2021_08_19_142353_create_customer_order_line_cust_dates_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (36,'2021_08_19_142354_create_customer_order_line_raw_mat_orders_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (37,'2021_11_20_124531_create_accessories_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (38,'2021_11_20_130329_create_colourway_accessories_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (39,'2022_02_18_153959_create_sample_types_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (40,'2022_02_18_160507_create_customer_sample_rules_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (41,'2022_02_28_102619_create_samples_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (42,'2022_03_01_112755_create_materials_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (43,'2022_03_01_173145_create_yarn_composition_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (44,'2022_03_08_151848_create_style_version_price_sizes_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (45,'2022_03_20_082915_create_customer_order_files_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (46,'2022_03_24_190716_create_shipments_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (47,'2022_03_24_190746_create_shipment_lines_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (48,'2022_03_24_190749_create_shipment_line_sizes_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (49,'2022_03_24_191654_create_shipment_files_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (50,'2022_03_28_104854_create_shipment_line_exfty_dates_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (51,'2022_04_27_080711_create_sessions_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (52,'2022_05_10_100742_update_commodity_codes_table',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (53,'2022_05_10_123523_add_last_updated_by_to_designs',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (54,'2022_05_10_153706_update_customer_po_in_customer_orders',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (55,'2022_05_10_155011_add_factory_cust_date_to_customer_order_lines',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (56,'2022_05_16_124619_update_price_in_colourway_yarns',1);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (57,'2022_05_31_141813_update_quote_in_style_versions',2);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (58,'2022_06_01_195430_update_weight_in_samples',3);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (59,'2022_06_08_095412_add_estimate_to_style_versions',4);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (60,'2022_05_16_143448_add_email_to_customer_addresses',5);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (61,'2022_05_16_143455_add_email_to_supplier_addresses',5);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (62,'2022_05_16_143908_update_pricing_model_in_style_versions',5);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (63,'2022_06_09_090852_create_customer_order_raw_mat_orders_table',5);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (64,'2022_06_21_080000_add_settings_to_users',6);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (67,'2022_06_22_093624_add_details_to_styles',7);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (68,'2022_06_22_093843_add_yarn_ends_to_style_versions',7);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (69,'2022_06_22_182911_add_settings_to_customers',8);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (72,'2022_06_23_103013_add_incoterms_to_orders',9);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (73,'2022_06_23_103024_remove_incoterms_from_customers',10);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (74,'2022_06_23_130025_add_cust_ship_no_to_customer_orders',11);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (75,'2022_06_23_185052_add_settings_to_seasons',12);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (76,'2022_06_29_094814_update_settings_on_customers',13);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (77,'2022_06_29_094814_update_settings_on_customers copy',14);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (78,'2022_06_29_094815_update_settings_on_seasons',14);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (79,'2022_07_14_105257_update_supplier_email_in_supplier_addresses_table',15);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (80,'2022_07_18_131953_add_cancelled_to_colourways',16);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (81,'2022_07_18_141207_add_dont_charge_dev_to_samples',17);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (83,'2022_07_19_151428_add_finance_comments_to_samples',18);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (84,'2022_07_27_070551_add_customs_and_other_to_style_versions',19);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (85,'2022_07_29_072156_add_cancelled_and_category_to_styles',20);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (91,'2022_10_06_114130_create_yarn_colours_table',21);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (92,'2022_10_06_114210_add_yarn_colours_id_to_colourway_yarns',21);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (93,'2022_10_07_113241_update_yarn_colours_id_on_colourway_yarns',22);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (94,'2022_10_07_114013_remove_yarn_colour_from_colourway_yarns',23);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (95,'2022_10_07_123200_create_fabric_colours_table',24);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (96,'2022_10_07_123247_add_fabric_colours_id_to_colourway_fabrics_table',24);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (97,'2022_10_07_123719_remove_fabric_colour_from_colourway_fabrics',25);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (98,'2022_10_11_141809_create_accessory_colours_table',26);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (99,'2022_10_11_141836_add_accessory_colours_id_to_colourway_accessories_table',26);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (100,'2022_10_11_144412_remove_colour_from_colourway_accessories_table',27);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (101,'2022_10_11_150308_add_cp_comments_to_customer_order_lines_table',28);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (102,'2022_10_11_170019_add_fn_notes_and_po_to_samples_table',29);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (103,'2022_10_19_135740_create_yarn_orders_table',30);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (107,'2022_10_19_135746_create_yarn_order_lines_table',31);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (108,'2022_10_19_135754_create_accessory_orders_table',31);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (109,'2022_10_19_135800_create_accessory_order_lines_table',31);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (110,'2022_11_02_122407_add_to_style_versions_table',32);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (147,'2022_11_11_102735_create_prices_table',33);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (148,'2022_11_11_102809_create_price_sizes_table',33);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (149,'2022_11_11_102841_create_price_quote_histories_table',33);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (150,'2022_11_16_132342_add_currency_to_prices',34);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (152,'2022_11_23_114643_remove_from_prices_table',35);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (153,'2022_12_02_111411_remove_colourway_yarns_id_from_yarn_order_lines_table',36);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (156,'2022_12_02_113037_create_yarn_order_line_styles_table',37);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (157,'2022_12_02_150515_add_customer_order_lines_id_to_yarn_order_line_styles',38);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (158,'2022_12_02_150531_remove_customer_order_lines_id_from_yarn_order_lines_table',38);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (160,'2022_12_02_150935_add_yarn_colours_id_to_yarn_orders',39);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (161,'2022_12_06_150138_add_target_to_prices_table',40);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (162,'2022_12_08_123148_remove_style_versions_id_from_yarn_order_line_styles',41);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (163,'2022_12_15_142742_add_type_to_accessories_table',42);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (164,'2023_01_04_150913_add_cp_notes_to_shipment_lines_table',43);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (165,'2023_01_05_095501_add_cp_fields_to_shipment_lines',44);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (167,'2023_01_09_112854_add_costed_weight_to_prices_table',45);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (170,'2023_01_09_114450_add_costed_weight_to_prices_table',46);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (171,'2023_01_09_163645_add_customs_to_suppliers_table',47);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (172,'2023_01_10_112839_add_min_qty_to_prices_table',48);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (173,'2023_01_10_155901_add_labels_cost_to_prices_table',49);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (174,'2023_01_11_104630_add_yarn_value_to_prices_table',50);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (175,'2023_01_11_104800_add_yarn_value_currency_to_prices_table',51);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (176,'2023_01_12_130652_add_size_to_prices_table',52);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (177,'2023_01_20_102639_update_styles_table',53);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (178,'2023_01_20_105253_add_customs_submitted_text_to_shipments',54);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (179,'2023_01_26_125030_add_confirmed_to_shipment_lines',55);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (180,'2023_01_27_082136_add_shipped_qty_to_shipment_line_sizes_table',56);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (181,'2023_02_01_150139_add_customer_comments_to_prices_table',57);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (182,'2023_02_01_155227_add_mid_to_customers_table',58);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (183,'2023_02_01_155236_add_mid_to_suppliers_table',58);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (184,'2023_02_03_120452_add_date_sent_to_price_quote_history',59);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (185,'2023_02_03_132021_add_logo_to_customers_table',60);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (186,'2023_02_06_095932_add_transporter_invoice_to_shipment_lines_table',61);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (189,'2023_02_07_093715_add_customer_addresses_id_to_customer_orders_table',62);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (194,'2023_02_07_110726_add_fields_to_yarn_order_lines_table',63);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (196,'2023_02_07_114121_create_yarn_order_files_table',64);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (197,'2023_02_07_120428_add_filename_to_yarn_order_files_table',65);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (198,'2023_02_08_142018_update_shipments_table',66);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (199,'2023_02_08_153534_add_sent_by_to_price_quote_histories_table',67);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (200,'2023_02_09_103503_add_comments_to_yarn_orders_table',68);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (201,'2023_02_09_113007_add_phone_to_users_table',69);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (202,'2023_02_09_133830_drop_invoice_and_factory_from_yarn_order_lines',70);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (203,'2023_02_15_092127_add_approved_date_to_samples_table',71);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (205,'2023_02_20_090511_add_issues_to_style_versions_table',72);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (206,'2023_02_21_153026_change_customer_order_lines_table',73);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (207,'2023_02_22_082918_add_sample_comments_to_shipment_lines_table',73);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (208,'2023_02_22_085837_add_to_shipments_table',74);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (209,'2023_02_28_125156_add_embroidery_to_prices_table',75);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (210,'2023_02_28_131206_add_embroidery_currency_to_prices_table',76);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (211,'2023_02_28_131822_add_showembroidery_to_customers_table',77);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (212,'2023_03_01_111449_drop_price_from_style_versions',78);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (213,'2023_03_06_145710_add_order_to_sizes_table',79);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (214,'2023_03_15_144741_add_customer_ref_to_designs',80);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (216,'2023_03_15_164257_add_jersey_fields_to_colourways',81);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (218,'2023_03_21_110435_add_testing_to_prices',82);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (219,'2023_03_21_150114_add_customs_to_customers',83);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (220,'2023_03_22_120658_add_incomplete_flag_to_customer_orders',84);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (221,'2023_03_22_121737_update_colourway_yarns',85);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (222,'2023_03_22_121841_update_colourway_accessories',86);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (223,'2023_03_24_075634_add_delivery_notes_to_shipment_lines',87);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (224,'2023_03_24_141823_update_styles_table',88);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (228,'2023_03_28_101547_add_recent_ex_ft_to_shipment_lines_table',89);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (229,'2023_03_30_093456_add_order_type_to_customer_orders_table',90);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (231,'2023_04_04_092700_add_comms_to_customer_order_line_quantities',91);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (232,'2023_04_17_105657_add_currency_to_customer_orders',92);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (233,'2023_04_18_105049_add_comments_to_prices',93);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (234,'2023_04_18_105238_add_comments_toggle_to_prices',94);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (235,'2023_04_19_133937_add_invoiced_to_shipment_lines',95);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (236,'2023_04_20_125338_add_ss_approved_to_shipment_lines',96);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (237,'2023_04_24_092721_add_cmt_quote_selector_to_prices',97);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (238,'2023_04_25_074112_addcolourways_to_prices',98);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (239,'2023_04_25_090836_update_cmt_quote_status_on_prices_table',99);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (240,'2023_04_25_090837_update_cmt_quote_status_on_prices_table',100);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (241,'2023_04_26_112531_add_invoice_to_yarn_order_line_styles_table',101);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (242,'2023_05_03_101538_add_fn_complete_to_shipment_lines',102);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (243,'2023_05_03_105402_add_valid_until_to_prices',103);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (245,'2023_05_04_073522_add_colour_type_to_colourways',104);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (246,'2023_05_04_091052_add_colour_type_to_prices',105);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (248,'2023_05_08_105309_update_fn_complete_on_shipment_lines',106);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (249,'2023_05_08_111059_edit_complete_on_shipment_lines',106);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (250,'2023_05_08_111438_update_shipment_lines',106);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (251,'2023_05_08_111558_update_shipment_lines',106);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (252,'2023_05_09_095123_add_img_thumb_to_colourways',107);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (253,'2023_05_17_130407_add_invoice_to_yarn_order_lines',108);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (254,'2023_05_24_102234_add_sealer_to_colourways',109);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (255,'2023_05_24_103019_add_shipment_samples_to_shipment_lines',110);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (256,'2023_05_25_084916_remove_cp_boxes_from_shipment_lines',111);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (257,'2023_05_25_085158_remove_cp_boxes_from_shipment_lines',112);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (258,'2023_05_25_090003_add_cp_bits_to_shipment_lines',113);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (259,'2023_05_25_090205_add_cp_bits_to_shipment_lines',114);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (260,'2023_05_25_100837_add_cp_bits_to_shipment_lines',115);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (261,'2023_05_25_140508_add_customer_to_yarn_orders',116);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (262,'2023_05_25_155542_update_cancelled_on_customer_orders',117);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (263,'2023_06_08_140404_add_no_invoiced_to_shipment_lines',118);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (264,'2023_06_12_121316_create_customer_agents_table',119);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (265,'2023_06_12_121432_create_y_c_orders_table',119);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (266,'2023_06_12_121513_create_y_c_order_lines_table',119);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (267,'2023_06_15_121159_add_order_to_y_c_order_lines',120);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (268,'2023_06_16_142611_change_y_c_order_lines',121);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (269,'2023_06_20_095914_update_notes_on_y_c_orders',122);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (270,'2023_06_20_101112_create_y_c_yarn_seasons_table',122);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (271,'2023_06_20_101239_add_prices_to_y_c_yarn_seasons',122);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (272,'2023_06_20_101632_add_agents_to_yarns',122);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (273,'2023_06_20_103518_update_yarns',122);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (274,'2023_06_21_142248_add_price_to_y_c_yarn_seasons',122);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (275,'2023_06_21_142443_add_price_to_y_c_yarn_seasons',122);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (276,'2023_06_21_144559_add_price_to_y_c_yarn_seasons',122);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (277,'2023_06_22_090049_add_yarn_seasons_to_y_c_order_lines',122);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (278,'2023_07_06_154625_add_spinner_to_y_c_orders',123);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (279,'2023_07_06_161247_add_logo_to_suppliers',124);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (280,'2023_07_19_121257_add_y_c_emails_to_suppliers',125);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (281,'2023_07_30_180515_update_colourway_yarns_table',126);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (282,'2023_08_01_081239_add_yc_email_to_customers',127);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (283,'2023_08_01_085637_add_yc_address_to_customers',128);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (284,'2023_08_01_085649_add_address_to_yc_orders',129);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (285,'2023_08_04_103500_add_fn_notes_to_shipment_lines',130);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (286,'2023_08_04_122236_add_swatch_to_y_c_order_lines',131);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (287,'2023_08_08_111820_add_vat_eori_to_customers',132);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (288,'2023_08_15_085041_add_to_prices',133);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (289,'2023_08_25_124859_update_shipment_lines_table',134);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (290,'2023_08_29_134954_change_shipment_lines_table',135);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (291,'2023_08_30_095624_update_shipment_lines_table',136);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (294,'2023_09_01_134657_update_styles_table',137);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (295,'2023_09_01_134725_update_colourways_table',137);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (298,'2023_09_04_120921_add_default_to_colourways',138);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (299,'2023_09_06_134657_update_styles_table',139);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (300,'2023_09_19_091524_add_sealer_deadline_to_shipment_lines',140);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (301,'2023_12_19_121252_drop_all_loop_tables',141);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (302,'2023_09_07_131023_update_styles_table',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (303,'2023_09_11_131517_add_status_to_samples',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (304,'2023_09_19_091412_add_sealer_deadline_to_shipment_lines',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (305,'2023_09_19_100103_add_to_customer_orders',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (306,'2023_09_19_104909_add_to_customer_orders',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (307,'2023_09_19_114300_add_to_customer_order_lines',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (308,'2023_09_19_121609_create_audits_table',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (309,'2023_09_19_123206_add_to_customer_order_lines',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (310,'2023_09_19_124001_add_to_customer_order_lines',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (311,'2023_09_19_135540_move_start_knit_dates',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (312,'2023_09_19_135541_move_factory_customer_dates',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (313,'2023_09_19_150800_add_exfty_to_shipment_lines',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (314,'2023_09_19_150857_move_exfty_to_sl',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (315,'2023_10_19_085038_update_yarn_orders_table',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (316,'2023_10_24_113442_update_shipments_table',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (317,'2023_10_25_082947_add_production_comment_to_samples',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (318,'2023_10_26_131856_add_to_shipment_lines_table',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (319,'2023_10_26_144200_edit_to_shipment_lines_table',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (320,'2023_10_27_081609_drop_style_versions_id_from_samples',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (321,'2023_10_27_095823_edit_samples_table',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (322,'2023_10_27_111322_add_samples_required_to_customers',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (323,'2023_11_01_151706_edit_samples_table',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (324,'2023_11_02_145504_add_gbp_rate_to_seasons',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (325,'2023_11_02_153158_add_yarn_cost_to_colourways_function',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (326,'2023_11_08_100510_add_convert_currency_function',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (327,'2023_11_08_105114_add_quote_to_prices_table',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (328,'2023_11_08_105208_add_historic_prices_function',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (329,'2023_11_08_120818_edit_aoc_prices_table',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (330,'2023_11_08_122950_add_colourways_view',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (331,'2023_11_08_151257_add_quotes_sent_to_prices_table',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (332,'2023_11_08_151346_add_convert_quotes_sent',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (333,'2023_11_08_162960_add_prices_view',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (334,'2023_11_13_091425_add_fn_complete_to_samples',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (335,'2023_11_14_145135_migrate_samples_required',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (336,'2023_11_15_145926_add_soft_deletes_to_designs',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (337,'2023_11_15_155118_add_soft_deletes_to_all_tables',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (338,'2023_11_23_120122_create_view_styles',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (339,'2023_11_23_133836_drop_unused_tables',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (340,'2023_11_23_143354_remove_unused_columns',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (341,'2023_11_24_101400_drop_currency_from_orders',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (342,'2023_12_08_113328_add_notes_to_shipment_line',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (343,'2023_12_11_110529_create_view_shipment_schedule',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (344,'2023_12_11_110530_create_view_critical_path',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (345,'2023_12_20_092149_create_view_finance_samples_view',142);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (347,'2023_12_26_083711_create_thumbnails',143);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (348,'2023_12_26_090815_delete_unused_images',144);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (349,'2023_12_26_090816_delete_unused_images',145);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (350,'2023_12_26_090816_delete_unused_order_line_files',146);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (351,'2023_12_26_090817_delete_unused_shipment_files copy',147);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (352,'2023_12_26_090818_delete_unused_yof',147);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (355,'2024_01_02_161229_import_fty_date',148);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (356,'2024_01_04_103834_update_convert_currency_function',149);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (357,'2024_01_05_085956_add_type_to_departments',150);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (358,'2024_01_05_091021_add_hidden_to_departments',151);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (359,'2024_01_08_145246_add_defaults_to_prices',152);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (360,'2024_01_26_085451_add_lock_to_seasons',153);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (361,'2024_01_29_093818_add_lock_to_departments',154);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (362,'2024_02_14_122950_add_colourways_view',155);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (363,'2024_02_14_122950_add_colourways_view copy',156);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (364,'2024_02_15_153158_add_yarn_cost_to_colourways_function',157);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (365,'2024_02_15_163040_update_view_shipment_schedule',158);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (366,'2024_02_15_163041_add_sample_override_to_shipment_lines',158);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (367,'2024_02_15_163042_update_view_shipment_schedule',158);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (368,'2024_02_15_163043_update_vw_critical_path',158);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (369,'2024_02_15_163044_move_all_prices_to_1',158);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (370,'2024_02_15_163045_update_view_colourways',158);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (371,'2024_02_15_163046_add_first_exfty_to_shipment_line',158);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (372,'2024_02_15_163500_move_first_exfty_date',158);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (373,'2024_02_21_142927_add_sample_override_to_shipment_lines',159);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (374,'2024_03_01_110029_create_user_departments_table',160);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (375,'2024_03_01_111010_add_users_to_departments',161);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (376,'2024_03_11_151915_add_to_styles',162);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (377,'2024_03_11_151919_add_to_colourways',162);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (378,'2024_03_11_151922_add_to_prices',162);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (379,'2024_03_11_151936_add_to_customer_orders',162);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (380,'2024_03_11_151939_add_to_customer_order_lines',162);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (381,'2024_03_11_151944_add_to_shipment_lines',162);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (382,'2024_03_12_095240_add_sent_factory_to_customer_order_lines',163);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (383,'2024_03_12_105754_add_colour_approval_to_colourways',164);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (384,'2024_03_12_162929_add_rename_asn_comments_to_shipment_lines',165);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (385,'2024_03_13_130103_update_received_on_customer_orders',166);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (386,'2024_03_14_085012_change_order_date_to_null_on_customer_orders',167);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (387,'2024_04_02_103841_update_finance_samples_view',168);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (388,'2024_05_13_091203_create_cashflows_table',169);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (389,'2024_05_13_091207_create_cashflow_lines_table',170);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (390,'2024_05_14_073523_add_to_cashflows_table',171);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (391,'2024_05_14_080431_add_to_cashflow_lines_table',172);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (392,'2024_05_14_084640_add_to_cashflow_lines_table',173);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (393,'2024_05_14_090204_add_to_cashflow_lines_table',174);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (395,'2024_05_14_092717_add_to_cashflow_lines_table',175);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (396,'2024_05_14_132851_remove_from_cashflow_lines_table',176);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (397,'2024_05_28_151618_add_price_cache_to_customer_order_line_quantities_table',177);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (401,'2024_05_29_075309_add_status_to_customer_order_line_quantities',178);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (402,'2024_05_29_094651_calculate_price_cache_for_each_line',178);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (404,'2024_05_30_083537_add_transport_budget_cache_to_customer_order_line_quantities',179);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (406,'2024_05_30_083749_calc_prices_cache',180);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (407,'2024_05_31_094737_repair_asos_prices',181);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (408,'2024_05_31_103749_calc_prices_cache',181);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (409,'2024_05_31_123421_drop_cashflow_view',182);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (410,'2024_05_31_123718_drop_ss_view',183);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (411,'2024_05_31_123916_drop_cp_view',184);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (412,'2024_05_31_123955_drop_prices_view',185);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (413,'2024_05_31_124525_drop_styles_view',186);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (414,'2024_06_12_130822_add_flag_issue_to_shipment_lines',187);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (415,'2024_07_02_094858_add_cancelled_to_customer_order_lines',188);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (416,'2024_07_08_084349_add_duty_to_pricing',189);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (419,'2024_07_22_083856_add_cp_bits_to_shipment_lines',190);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (420,'2024_07_30_143133_remove_sent_to_factory_from_customer_order_lines',191);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (421,'2024_07_31_102234_update_convert_currency_function',192);
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (422,'2024_08_12_102234_update_convert_currency_function',193);
