CREATE TABLE `daily_cache_locks` (
  `_cache_id` varchar(128) COLLATE utf8_bin NOT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `datatype` enum('ticket','clock_entry', 'sales_report') COLLATE utf8_bin NOT NULL,
  `store_id` varchar(64) COLLATE utf8_bin DEFAULT NULL,
  `days_ago` int(11) NOT NULL,
  `created_at` datetime DEFAULT NULL,
  PRIMARY KEY (`id`,`_cache_id`),
  KEY `store_id_datatype_days_ago_idx` (`_cache_id`,`store_id`,`datatype`,`days_ago`),
  KEY `created_at_idx` (`created_at`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;