2023-08-17 00:23:55 +00:00
|
|
|
<?php
|
2024-10-05 14:48:18 +00:00
|
|
|
use Index\Db\DbConnection;
|
|
|
|
use Index\Db\Migration\DbMigration;
|
2023-08-17 00:23:55 +00:00
|
|
|
|
2024-10-05 14:48:18 +00:00
|
|
|
final class CreateServersTable_20230817_001507 implements DbMigration {
|
|
|
|
public function migrate(DbConnection $conn): void {
|
2023-08-17 00:23:55 +00:00
|
|
|
$conn->execute('
|
|
|
|
CREATE TABLE servers (
|
|
|
|
server_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
|
|
|
server_name VARCHAR(255) NOT NULL COLLATE "utf8mb4_unicode_520_ci",
|
|
|
|
server_details TEXT NOT NULL DEFAULT "" COLLATE "utf8mb4_unicode_520_ci",
|
|
|
|
server_order SMALLINT(6) NOT NULL DEFAULT "0",
|
|
|
|
server_java_address VARCHAR(255) NULL DEFAULT NULL COLLATE "ascii_general_ci",
|
|
|
|
server_java_version VARCHAR(255) NULL DEFAULT NULL COLLATE "ascii_general_ci",
|
|
|
|
server_bedrock_address VARCHAR(255) NULL DEFAULT NULL COLLATE "ascii_general_ci",
|
|
|
|
server_bedrock_version VARCHAR(255) NULL DEFAULT NULL COLLATE "ascii_general_ci",
|
|
|
|
server_created TIMESTAMP NOT NULL DEFAULT current_timestamp(),
|
|
|
|
server_deleted TIMESTAMP NULL DEFAULT NULL,
|
|
|
|
PRIMARY KEY (server_id),
|
|
|
|
KEY servers_created_index (server_created),
|
|
|
|
KEY servers_deleted_index (server_deleted),
|
|
|
|
KEY servers_order_index (server_order)
|
|
|
|
) ENGINE=InnoDB COLLATE=utf8mb4_bin
|
|
|
|
');
|
|
|
|
}
|
|
|
|
}
|