SET NAMES 'utf8';
DROP TABLE IF EXISTS `caches`;
CREATE TABLE `caches` (
  `cache_id` int(10) unsigned NOT NULL auto_increment,
  `uuid` varchar(36) NOT NULL,
  `node` tinyint(3) unsigned NOT NULL default '0',
  `date_created` datetime NOT NULL COMMENT 'via Trigger (caches)',
  `last_modified` datetime NOT NULL COMMENT 'via Trigger (caches)',
  `user_id` int(10) unsigned NOT NULL,
  `name` varchar(255) NOT NULL,
  `longitude` double NOT NULL,
  `latitude` double NOT NULL,
  `type` tinyint(3) unsigned NOT NULL,
  `status` tinyint(3) unsigned NOT NULL,
  `country` char(2) NOT NULL,
  `date_hidden` date NOT NULL,
  `size` tinyint(3) unsigned NOT NULL,
  `difficulty` tinyint(3) unsigned NOT NULL,
  `terrain` tinyint(3) unsigned NOT NULL,
  `logpw` varchar(20) default NULL,
  `search_time` float unsigned NOT NULL default '0',
  `way_length` float unsigned NOT NULL default '0',
  `wp_gc` varchar(7) NOT NULL,
  `wp_nc` varchar(6) NOT NULL,
  `wp_oc` varchar(6) default NULL,
  `desc_languages` varchar(60) NOT NULL COMMENT 'via Trigger (cache_desc)',
  `default_desclang` char(2) NOT NULL,
  `date_activate` datetime default NULL,
  `need_npa_recalc` tinyint(1) NOT NULL,
  PRIMARY KEY  (`cache_id`),
  UNIQUE KEY `uuid` (`uuid`),
  UNIQUE KEY `wp_oc` (`wp_oc`),
  KEY `longitude` (`longitude`,`latitude`),
  KEY `date_created` (`date_created`),
  KEY `latitude` (`latitude`),
  KEY `country` (`country`),
  KEY `status` (`status`,`date_activate`),
  KEY `last_modified` (`last_modified`),
  KEY `wp_gc` (`wp_gc`),
  KEY `user_id` (`user_id`),
  KEY `date_activate` (`date_activate`),
  KEY `need_npa_recalc` (`need_npa_recalc`),
  KEY `type` (`type`),
  KEY `size` (`size`),
  KEY `difficulty` (`difficulty`),
  KEY `terrain` (`terrain`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;
