mirror of
https://github.com/GeorgH93/Minepacks.git
synced 2024-11-14 10:45:23 +01:00
Suppress error if added column already exists
This commit is contained in:
parent
50a2936b8d
commit
2c73e5d33e
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>at.pcgamingfreaks</groupId>
|
||||
<artifactId>MinePacks</artifactId>
|
||||
<version>1.2</version>
|
||||
<version>1.2.1</version>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>in-project</id>
|
||||
|
@ -114,26 +114,14 @@ private void CheckDB()
|
||||
{
|
||||
stmt.execute("ALTER TABLE `" + Table_Players + "` ADD COLUMN `uuid` CHAR(32) UNIQUE;");
|
||||
}
|
||||
catch(SQLException e)
|
||||
{
|
||||
if(e.getErrorCode() != 1060)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
catch(SQLException e) { }
|
||||
}
|
||||
stmt.execute("CREATE TABLE IF NOT EXISTS `" + Table_Backpacks + "` (`owner` INT UNSIGNED NOT NULL, `itemstacks` BLOB, PRIMARY KEY (`owner`));");
|
||||
try
|
||||
{
|
||||
stmt.execute("ALTER TABLE `" + Table_Backpacks + "` ADD COLUMN `version` INT DEFAULT 0;");
|
||||
}
|
||||
catch(SQLException e)
|
||||
{
|
||||
if(e.getErrorCode() != 1060)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
catch(SQLException e) { }
|
||||
stmt.close();
|
||||
}
|
||||
catch (SQLException e)
|
||||
|
@ -120,26 +120,14 @@ private void CheckDB()
|
||||
{
|
||||
stmt.execute("ALTER TABLE `" + Table_Players + "` ADD COLUMN `uuid` CHAR(32) UNIQUE;");
|
||||
}
|
||||
catch(SQLException e)
|
||||
{
|
||||
if(e.getErrorCode() != 1060)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
catch(SQLException e) { }
|
||||
}
|
||||
stmt.execute("CREATE TABLE IF NOT EXISTS `" + Table_Backpacks + "` (`owner` INT UNSIGNED PRIMARY KEY, `itemstacks` BLOB);");
|
||||
try
|
||||
{
|
||||
stmt.execute("ALTER TABLE `" + Table_Backpacks + "` ADD COLUMN `version` INT DEFAULT 0;");
|
||||
}
|
||||
catch(SQLException e)
|
||||
{
|
||||
if(e.getErrorCode() != 1060)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
catch(SQLException e) { }
|
||||
stmt.close();
|
||||
}
|
||||
catch (SQLException e)
|
||||
|
Loading…
Reference in New Issue
Block a user