-- Important before executing:
-- Replace %table% with the tablename you specified in config.yml.
-- Example: If your table is called lb-main, then:
-- RENAME TABLE `blocks` TO `lb-main`;
-- RENAME TABLE `extra` TO `lb-main-extra`;

-- Execute for each table in worldTables:
CREATE TABLE `%table%` (
  `id` INT NOT NULL AUTO_INCREMENT,
  `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `playerid` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
  `replaced` TINYINT UNSIGNED NOT NULL DEFAULT '0',
  `type` TINYINT UNSIGNED NOT NULL DEFAULT '0',
  `data` TINYINT UNSIGNED NOT NULL DEFAULT '0',
  `x` SMALLINT NOT NULL DEFAULT '0',
  `y` TINYINT UNSIGNED NOT NULL DEFAULT '0',
  `z` SMALLINT NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `coords` (`y`,`x`,`z`),
  KEY `type` (`type`),
  KEY `data` (`data`),
  KEY `replaced` (`replaced`)
);

CREATE TABLE `%table%-sign` (
  `id` INT NOT NULL,
  `signtext` TEXT,
  PRIMARY KEY (`id`)
);

CREATE TABLE `%table%-chest` (
  `id` INT NOT NULL,
  `intype` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
  `inamount` TINYINT UNSIGNED NOT NULL DEFAULT '0',
  `outtype` SMALLINT UNSIGNED NOT NULL DEFAULT '0',
  `outamount` TINYINT UNSIGNED NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`)
);

--Execute once:
CREATE TABLE `lb-players` (
  `playerid` SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
  `playername` varchar(32) NOT NULL DEFAULT '-',
  PRIMARY KEY (`playerid`),
  UNIQUE (`playername`)
);