-- Schema for the CM bot dev DB. Mounted at
-- /docker-entrypoint-initdb.d/01-schema.sql in the mysql:8.0 container;
-- runs once on first volume initialization.
CREATE TABLE IF NOT EXISTS acc (
    username VARCHAR(64) PRIMARY KEY,
    password VARCHAR(128) NOT NULL,
    status   VARCHAR(32) DEFAULT '',
    link     VARCHAR(512) DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

CREATE TABLE IF NOT EXISTS user (
    f_username       VARCHAR(64) PRIMARY KEY,
    f_password       VARCHAR(128) NOT NULL,
    t_username       VARCHAR(64) NOT NULL,
    t_password       VARCHAR(128) NOT NULL,
    last_update_time TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
