# mysql --u root -p < schema.sql CREATE DATABASE IF NOT EXISTS ddz DEFAULT CHARSET utf8mb4 COLLATE utf8mb4_general_ci; CREATE TABLE IF NOT EXISTS ddz.user ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, openid VARCHAR(50) NOT NULL UNIQUE, name VARCHAR(50) NOT NULL, sex TINYINT(1) NOT NULL, avatar VARCHAR(256), date_joined DATETIME DEFAULT CURRENT_TIMESTAMP, last_modified DATETIME ON UPDATE CURRENT_TIMESTAMP ); CREATE TABLE IF NOT EXISTS ddz.record ( id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, round JSON default {}, robot TINYINT(1) NOT NULL, last_modified DATETIME ON UPDATE CURRENT_TIMESTAMP );