CREATE DATABASE IF NOT EXISTS chatlogs
  CHARACTER SET utf8mb4
  COLLATE utf8mb4_unicode_ci;

USE chatlogs;

CREATE TABLE IF NOT EXISTS chat_logs (
    id         BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    player     VARCHAR(64)  NOT NULL,
    message    TEXT         NOT NULL,
    server     VARCHAR(255) NOT NULL DEFAULT '',
    timestamp  VARCHAR(64)  NOT NULL,
    created_at TIMESTAMP    NOT NULL DEFAULT CURRENT_TIMESTAMP,

    INDEX idx_player     (player),
    INDEX idx_server     (server),
    INDEX idx_created_at (created_at)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
