33 lines
1.2 KiB
Java
33 lines
1.2 KiB
Java
package com.craftaro.epicanchors.files.migration;
|
|
|
|
import com.craftaro.core.database.DataMigration;
|
|
import com.craftaro.core.database.DatabaseConnector;
|
|
import com.craftaro.epicanchors.EpicAnchors;
|
|
import com.craftaro.epicanchors.files.DataManager;
|
|
|
|
import java.sql.Connection;
|
|
import java.sql.SQLException;
|
|
import java.sql.Statement;
|
|
|
|
public class _1_InitialMigration extends DataMigration {
|
|
public _1_InitialMigration() {
|
|
super(1);
|
|
}
|
|
|
|
@Override
|
|
public void migrate(DatabaseConnector databaseConnector, String tablePrefix) throws SQLException {
|
|
try (Statement statement = databaseConnector.getConnection().createStatement()) {
|
|
statement.execute("CREATE TABLE " + EpicAnchors.getPlugin(EpicAnchors.class).getDataManager().getTablePrefix() + "anchors (" +
|
|
"id INTEGER NOT NULL," +
|
|
"world_name TEXT NOT NULL," +
|
|
"x INTEGER NOT NULL," +
|
|
"y INTEGER NOT NULL," +
|
|
"z INTEGER NOT NULL," +
|
|
"ticks_left INTEGER NOT NULL," +
|
|
"owner VARCHAR(36)," +
|
|
"PRIMARY KEY(id AUTOINCREMENT)" +
|
|
");");
|
|
}
|
|
}
|
|
}
|