-- Alembic Revision: 325de501b4d5

CREATE TABLE `barcodes` (
  `_cache_id` varchar(128) COLLATE utf8_bin NOT NULL,
  `key` bigint(20) NOT NULL AUTO_INCREMENT,
  `menu_item_id` varchar(64) COLLATE utf8_bin DEFAULT NULL,
  `price_level_key` bigint(20) DEFAULT NULL,
  `id` varchar(64) COLLATE utf8_bin NOT NULL,
  `code` varchar(128) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`key`),
  CONSTRAINT `fk_barcodes_menu_item` FOREIGN KEY (`_cache_id`, `menu_item_id`) REFERENCES `menu_items` (`_cache_id`, `id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_barcodes_price_level` FOREIGN KEY (`price_level_key`, `_cache_id`) REFERENCES `price_levels` (`key`, `_cache_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
