Permalink
Browse files

Table changes update.

You had spaces instead of tabs.
Added change to `inv_gamemode` so it contains the ADVENTURE game type.
Changed alter table so it matches the create table results.

You'll need to add an alter table check so the ENUM remains up to date for older versions.
  • Loading branch information...
Psithief committed Aug 22, 2012
1 parent 8b4cb37 commit c9d6516523267d2c0266c6023a749db1e637b0a4
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/uk/co/tggl/pluckerpluck/multiinv/mysql/SqlConnector.java
@@ -96,8 +96,8 @@ public boolean addInventoryColumn(String gamemode) {
Statement st;
try {
st = con.createStatement();
- st.executeUpdate("ALTER TABLE `" + prefix + "multiinv` ADD `inv_" + gamemode + "` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL");
- return true;
+ st.executeUpdate("ALTER TABLE `" + prefix + "multiinv` ADD `inv_" + gamemode.toLowerCase() + "` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL");
+ return true;
} catch (SQLException e) {
e.printStackTrace();
return false;
@@ -112,7 +112,7 @@ public boolean createTable() {
"`inv_id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY, " +
"`inv_group` VARCHAR( 50 ) CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL COMMENT 'Inventory group.', " +
"`inv_player` VARCHAR( 16 ) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL COMMENT 'Minecraft player name.', " +
- "`inv_gamemode` ENUM('CREATIVE','SURVIVAL') CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL COMMENT 'CREATIVE or SURVIVAL game mode.', " +
+ "`inv_gamemode` ENUM('ADVENTURE','CREATIVE','SURVIVAL') CHARACTER SET latin1 COLLATE latin1_general_cs NOT NULL COMMENT 'ADVENTURE, CREATIVE or SURVIVAL game mode.', " +
"`inv_health` TINYINT( 4 ) NOT NULL COMMENT 'Valid values are 0 to 20.', " +
"`inv_hunger` TINYINT( 4 ) NOT NULL COMMENT 'Valid values are 0 to 20.', " +
"`inv_saturation` DOUBLE NOT NULL COMMENT 'Valid values are 0.0 to 20.0.', " +

0 comments on commit c9d6516

Please sign in to comment.