forked from LogBlock/LogBlock
Fixed table auto creation
This commit is contained in:
@ -274,19 +274,19 @@ public class LogBlock extends JavaPlugin
|
||||
String table = Config.worldTables.get(i);
|
||||
if (!dbm.getTables(null, null, table, null).next()) {
|
||||
log.log(Level.INFO, "[LogBlock] Crating table " + table + ".");
|
||||
state.execute("CREATE TABLE `" + table + "` (`id` int(11) NOT NULL AUTO_INCREMENT, `date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `playerid` SMALLINT UNSIGNED NOT NULL DEFAULT '0', `replaced` int(11) NOT NULL DEFAULT '0', `type` int(11) NOT NULL DEFAULT '0', `data` TINYINT NOT NULL DEFAULT '0', `x` int(11) NOT NULL DEFAULT '0', `y` int(11) NOT NULL DEFAULT '0',`z` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), KEY `coords` (`y`,`x`,`z`), KEY `type` (`type`), KEY `data` (`data`), KEY `replaced` (`replaced`));");
|
||||
state.execute("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`));");
|
||||
if (!dbm.getTables(null, null, table, null).next())
|
||||
return false;
|
||||
}
|
||||
if (!dbm.getTables(null, null, table + "-sign", null).next()) {
|
||||
log.log(Level.INFO, "[LogBlock] Crating table " + table + "-sign.");
|
||||
state.execute("CREATE TABLE `" + table + "-sign` (`id` int(11) NOT NULL, `signtext` TEXT, PRIMARY KEY (`id`));");
|
||||
state.execute("CREATE TABLE `" + table + "-sign` (`id` INT NOT NULL, `signtext` TEXT, PRIMARY KEY (`id`));");
|
||||
if (!dbm.getTables(null, null, table + "-sign", null).next())
|
||||
return false;
|
||||
}
|
||||
if (!dbm.getTables(null, null, table + "-chest", null).next()) {
|
||||
log.log(Level.INFO, "[LogBlock] Crating table " + table + "-chest.");
|
||||
state.execute("CREATE TABLE `" + table + "-chest` (`id` int(11) NOT NULL, `inID` SMALLINT, `inAmount` TINYINT, `outID` SMALLINT, `outAmount` TINYINT,PRIMARY KEY (`id`));");
|
||||
state.execute("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`));");
|
||||
if (!dbm.getTables(null, null, table + "-chest", null).next())
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user