This commit is contained in:
shoopea 2019-05-02 18:18:23 +08:00
parent 3a49004f19
commit ea9d42e547

4
sql.go
View File

@ -58,7 +58,7 @@ func initDB() {
name VARCHAR(80) NOT NULL, name VARCHAR(80) NOT NULL,
guild_id SMALLINT(5), guild_id SMALLINT(5),
PRIMARY KEY (id), PRIMARY KEY (id),
) ENGINE = InnoDB ROW_FORMAT = DEFAULT CHARSET=utf8mb4;`) ) ENGINE = InnoDB ROW_FORMAT = DEFAULT CHARSET=utf8mb4_unicode_ci;`)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
@ -69,7 +69,7 @@ func initDB() {
direction ENUM('incoming', 'outgoing'), direction ENUM('incoming', 'outgoing'),
text VARCHAR(4096) NOT NULL, text VARCHAR(4096) NOT NULL,
FOREIGN KEY (user_id) REFERENCES user(id) ON DELETE CASCADE FOREIGN KEY (user_id) REFERENCES user(id) ON DELETE CASCADE
) ENGINE = InnoDB ROW_FORMAT = DEFAULT CHARSET=utf8mb4;`) ) ENGINE = InnoDB ROW_FORMAT = DEFAULT CHARSET=utf8mb4_unicode_ci;`)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }