Bugfix for SQLite and UUIDs

This commit is contained in:
Georg 2015-03-20 12:49:07 +01:00
parent 2c73e5d33e
commit 4276af6938
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>at.pcgamingfreaks</groupId>
<artifactId>MinePacks</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<repositories>
<repository>
<id>in-project</id>

View File

@ -113,12 +113,12 @@ private void CheckDB()
try
{
Statement stmt = GetConnection().createStatement();
stmt.execute("CREATE TABLE IF NOT EXISTS `" + Table_Players + "` (`player_id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` CHAR(16) NOT NULL UNIQUE);");
stmt.execute("CREATE TABLE IF NOT EXISTS `" + Table_Players + "` (`player_id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` CHAR(16) NOT NULL UNIQUE)" + ((plugin.UseUUIDs) ? ", `uuid` CHAR(32) UNIQUE" : "") +";");
if(plugin.UseUUIDs)
{
try
{
stmt.execute("ALTER TABLE `" + Table_Players + "` ADD COLUMN `uuid` CHAR(32) UNIQUE;");
stmt.execute("ALTER TABLE `" + Table_Players + "` ADD COLUMN `uuid` CHAR(32);");
}
catch(SQLException e) { }
}