From d7456136644ca70a65098640dc4cd9a39960b7e9 Mon Sep 17 00:00:00 2001 From: shoopea Date: Mon, 6 May 2019 21:48:43 +0800 Subject: [PATCH] test --- sql.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sql.go b/sql.go index 75715da..237924e 100644 --- a/sql.go +++ b/sql.go @@ -46,7 +46,7 @@ func initDB() { ,intl_id VARCHAR(32) NOT NULL ,name VARCHAR(80) NOT NULL ,PRIMARY KEY (id) - ) ENGINE = InnoDB CHARSET=utf8 COLLATE utf8_unicode_ci;`) + ) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;`) failOnError(err, "initDB : create table code_obj_type") _, err = db.Exec(`CREATE TABLE code_obj_sub_type ( @@ -56,7 +56,7 @@ func initDB() { ,obj_type_id SMALLINT UNSIGNED NOT NULL ,PRIMARY KEY (id) ,FOREIGN KEY (obj_type_id) REFERENCES code_obj_type(id) ON DELETE CASCADE - ) ENGINE = InnoDB CHARSET=utf8 COLLATE utf8_unicode_ci;`) + ) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;`) failOnError(err, "initDB : create table code_obj_sub_type") _, err = db.Exec(`CREATE TABLE obj ( @@ -64,7 +64,7 @@ func initDB() { ,obj_type_id SMALLINT UNSIGNED NOT NULL ,obj_sub_type_id SMALLINT UNSIGNED NOT NULL ,PRIMARY KEY (id) - ) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARSET=utf8 COLLATE utf8_unicode_ci;`) + ) ENGINE = InnoDB AUTO_INCREMENT = 0 CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;`) failOnError(err, "initDB : create table obj") _, err = db.Exec(`CREATE TABLE obj_user ( @@ -77,7 +77,7 @@ func initDB() { ,busy_until TIMESTAMP ,role ENUM('commander', 'bartender', 'squire', 'none') ,FOREIGN KEY (obj_id) REFERENCES obj(id) ON DELETE CASCADE - ) ENGINE = InnoDB CHARSET=utf8 COLLATE utf8_unicode_ci;`) + ) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;`) failOnError(err, "initDB : create table obj_user") _, err = db.Exec(`CREATE TABLE obj_guild ( @@ -87,7 +87,7 @@ func initDB() { ,chat_id BIGINT NOT NULL ,deposit_chat_id BIGINT NOT NULL ,FOREIGN KEY (obj_id) REFERENCES obj(id) ON DELETE CASCADE - ) ENGINE = InnoDB CHARSET=utf8 COLLATE utf8_unicode_ci;`) + ) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;`) failOnError(err, "initDB : create table obj_guild") _, err = db.Exec(`CREATE TABLE obj_msg ( @@ -100,7 +100,7 @@ func initDB() { ,text VARCHAR(4096) NOT NULL ,FOREIGN KEY (obj_id) REFERENCES obj(id) ON DELETE CASCADE ,UNIQUE KEY (msg_id, chat_id, sender_user_id) - ) ENGINE = InnoDB CHARSET=utf8 COLLATE utf8_unicode_ci;`) + ) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;`) failOnError(err, "initDB : create table obj_msg") _, err = db.Exec(`CREATE TABLE obj_msg_report ( @@ -114,7 +114,7 @@ func initDB() { ,stamina TINYINT NOT NULL ,crit TINYINT NOT NULL ,FOREIGN KEY (obj_id) REFERENCES obj(id) ON DELETE CASCADE - ) ENGINE = InnoDB CHARSET=utf8 COLLATE utf8_unicode_ci;`) + ) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;`) failOnError(err, "initDB : create table obj_msg_report") _, err = db.Exec(`INSERT INTO code_obj_type (id, intl_id, name)