mirror of
https://github.com/TotalFreedomMC/PlayerParticles.git
synced 2024-05-28 15:51:17 +00:00
28 lines
1.1 KiB
Java
28 lines
1.1 KiB
Java
package dev.esophose.playerparticles.database.migrations;
|
|
|
|
import dev.esophose.playerparticles.database.DataMigration;
|
|
import dev.esophose.playerparticles.database.DatabaseConnector;
|
|
import java.sql.Connection;
|
|
import java.sql.SQLException;
|
|
import java.sql.Statement;
|
|
|
|
public class _2_Add_Data_Columns extends DataMigration {
|
|
|
|
public _2_Add_Data_Columns() {
|
|
super(2);
|
|
}
|
|
|
|
@Override
|
|
public void migrate(DatabaseConnector connector, Connection connection, String tablePrefix) throws SQLException {
|
|
try (Statement statement = connection.createStatement()) {
|
|
statement.addBatch("ALTER TABLE " + tablePrefix + "particle ADD COLUMN r_end SMALLINT DEFAULT 0");
|
|
statement.addBatch("ALTER TABLE " + tablePrefix + "particle ADD COLUMN g_end SMALLINT DEFAULT 0");
|
|
statement.addBatch("ALTER TABLE " + tablePrefix + "particle ADD COLUMN b_end SMALLINT DEFAULT 0");
|
|
statement.addBatch("ALTER TABLE " + tablePrefix + "particle ADD COLUMN duration INT DEFAULT 20");
|
|
statement.executeBatch();
|
|
}
|
|
}
|
|
|
|
}
|
|
|