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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>at.pcgamingfreaks</groupId>
|
<groupId>at.pcgamingfreaks</groupId>
|
||||||
<artifactId>MinePacks</artifactId>
|
<artifactId>MinePacks</artifactId>
|
||||||
<version>1.2</version>
|
<version>1.2.1</version>
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>in-project</id>
|
<id>in-project</id>
|
||||||
|
@ -114,26 +114,14 @@ private void CheckDB()
|
|||||||
{
|
{
|
||||||
stmt.execute("ALTER TABLE `" + Table_Players + "` ADD COLUMN `uuid` CHAR(32) UNIQUE;");
|
stmt.execute("ALTER TABLE `" + Table_Players + "` ADD COLUMN `uuid` CHAR(32) UNIQUE;");
|
||||||
}
|
}
|
||||||
catch(SQLException e)
|
catch(SQLException e) { }
|
||||||
{
|
|
||||||
if(e.getErrorCode() != 1060)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
stmt.execute("CREATE TABLE IF NOT EXISTS `" + Table_Backpacks + "` (`owner` INT UNSIGNED NOT NULL, `itemstacks` BLOB, PRIMARY KEY (`owner`));");
|
stmt.execute("CREATE TABLE IF NOT EXISTS `" + Table_Backpacks + "` (`owner` INT UNSIGNED NOT NULL, `itemstacks` BLOB, PRIMARY KEY (`owner`));");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
stmt.execute("ALTER TABLE `" + Table_Backpacks + "` ADD COLUMN `version` INT DEFAULT 0;");
|
stmt.execute("ALTER TABLE `" + Table_Backpacks + "` ADD COLUMN `version` INT DEFAULT 0;");
|
||||||
}
|
}
|
||||||
catch(SQLException e)
|
catch(SQLException e) { }
|
||||||
{
|
|
||||||
if(e.getErrorCode() != 1060)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stmt.close();
|
stmt.close();
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
|
@ -120,26 +120,14 @@ private void CheckDB()
|
|||||||
{
|
{
|
||||||
stmt.execute("ALTER TABLE `" + Table_Players + "` ADD COLUMN `uuid` CHAR(32) UNIQUE;");
|
stmt.execute("ALTER TABLE `" + Table_Players + "` ADD COLUMN `uuid` CHAR(32) UNIQUE;");
|
||||||
}
|
}
|
||||||
catch(SQLException e)
|
catch(SQLException e) { }
|
||||||
{
|
|
||||||
if(e.getErrorCode() != 1060)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
stmt.execute("CREATE TABLE IF NOT EXISTS `" + Table_Backpacks + "` (`owner` INT UNSIGNED PRIMARY KEY, `itemstacks` BLOB);");
|
stmt.execute("CREATE TABLE IF NOT EXISTS `" + Table_Backpacks + "` (`owner` INT UNSIGNED PRIMARY KEY, `itemstacks` BLOB);");
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
stmt.execute("ALTER TABLE `" + Table_Backpacks + "` ADD COLUMN `version` INT DEFAULT 0;");
|
stmt.execute("ALTER TABLE `" + Table_Backpacks + "` ADD COLUMN `version` INT DEFAULT 0;");
|
||||||
}
|
}
|
||||||
catch(SQLException e)
|
catch(SQLException e) { }
|
||||||
{
|
|
||||||
if(e.getErrorCode() != 1060)
|
|
||||||
{
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stmt.close();
|
stmt.close();
|
||||||
}
|
}
|
||||||
catch (SQLException e)
|
catch (SQLException e)
|
||||||
|
Loading…
Reference in New Issue
Block a user