CREATE TABLE IF NOT EXISTS file_record (
    id               VARCHAR(36)  NOT NULL PRIMARY KEY,
    hash             VARCHAR(64)  NOT NULL,
    original_name    VARCHAR(255),
    mime_type        VARCHAR(128),
    size             BIGINT       NOT NULL,
    ext              VARCHAR(16),
    storage_path     VARCHAR(512) NOT NULL,
    thumbnail_path   VARCHAR(512),
    thumbnail_size   BIGINT       NOT NULL,
    created_at       DATETIME(6)  NOT NULL,
    last_accessed_at DATETIME(6)  NOT NULL,
    UNIQUE KEY uk_file_record_hash (hash)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
