mince/database/2023_08_17_001507_create_servers_table.php

26 lines
1.5 KiB
PHP

<?php
use Index\Db\DbConnection;
use Index\Db\Migration\DbMigration;
final class CreateServersTable_20230817_001507 implements DbMigration {
public function migrate(DbConnection $conn): void {
$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
');
}
}