добавлены индексы в таблицы
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
CREATE TABLE IF NOT EXISTS players (
|
||||
id INT AUTO_INCREMENT,
|
||||
uuid VARCHAR(36) NOT NULL,
|
||||
id INT AUTO_INCREMENT PRIMARY KEY NOT NULL,
|
||||
uuid VARCHAR(36) NOT NULL UNIQUE,
|
||||
name VARCHAR(16) NOT NULL,
|
||||
location_x DOUBLE NOT NULL,
|
||||
location_y DOUBLE NOT NULL,
|
||||
@@ -8,4 +8,7 @@ CREATE TABLE IF NOT EXISTS players (
|
||||
location_yaw FLOAT NOT NULL,
|
||||
location_pitch FLOAT NOT NULL,
|
||||
location_world varchar(64) NOT NULL
|
||||
);
|
||||
);
|
||||
|
||||
CREATE INDEX idx_players_uuid ON players(uuid);
|
||||
CREATE INDEX idx_players_name ON players(name);
|
||||
@@ -68,6 +68,8 @@ public class TestDAO {
|
||||
|
||||
@Before
|
||||
public void init() throws IOException {
|
||||
jdbcTemplate.execute("DROP INDEX IF EXISTS idx_players_uuid;");
|
||||
jdbcTemplate.execute("DROP INDEX IF EXISTS idx_players_name;");
|
||||
jdbcTemplate.execute("DROP TABLE IF EXISTS players;");
|
||||
jdbcTemplate.execute(IOUtils.resourceToString("/sqls/create_tables.sql", StandardCharsets.UTF_8));
|
||||
createPlayer();
|
||||
|
||||
Reference in New Issue
Block a user