2023-05-25 19:20:03 +02:00
|
|
|
package com.craftaro.ultimatestacker.database.migrations;
|
2019-08-02 15:59:10 +02:00
|
|
|
|
2023-06-11 13:14:56 +02:00
|
|
|
import com.craftaro.core.database.DataMigration;
|
|
|
|
import com.craftaro.core.database.DatabaseConnector;
|
|
|
|
import com.craftaro.core.database.MySQLConnector;
|
2019-08-02 15:59:10 +02:00
|
|
|
|
2023-09-13 13:51:40 +02:00
|
|
|
import java.sql.Connection;
|
2019-08-02 15:59:10 +02:00
|
|
|
import java.sql.SQLException;
|
|
|
|
import java.sql.Statement;
|
|
|
|
|
|
|
|
public class _1_InitialMigration extends DataMigration {
|
|
|
|
|
|
|
|
public _1_InitialMigration() {
|
|
|
|
super(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2023-09-13 13:51:40 +02:00
|
|
|
public void migrate(Connection connection, String tablePrefix) throws SQLException {
|
2019-08-02 15:59:10 +02:00
|
|
|
|
2019-08-03 05:02:50 +02:00
|
|
|
// Create spawners table
|
2023-09-13 13:51:40 +02:00
|
|
|
try (Statement statement = connection.createStatement()) {
|
2023-01-25 23:20:44 +01:00
|
|
|
statement.execute("CREATE TABLE IF NOT EXISTS " + tablePrefix + "spawners (" +
|
2023-09-13 13:51:40 +02:00
|
|
|
"id INTEGER PRIMARY KEY AUTO_INCREMENT, " +
|
2019-08-02 15:59:10 +02:00
|
|
|
"amount INTEGER NOT NULL," +
|
|
|
|
"world TEXT NOT NULL, " +
|
|
|
|
"x DOUBLE NOT NULL, " +
|
|
|
|
"y DOUBLE NOT NULL, " +
|
|
|
|
"z DOUBLE NOT NULL " +
|
|
|
|
")");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|