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