This commit is contained in:
shoopea 2019-07-09 16:07:46 +08:00
parent b87ebc9f9f
commit 180177f834

7
sql.go
View File

@ -110,6 +110,13 @@ func initDB() {
failOnError(err, "initDB : create table obj_user") failOnError(err, "initDB : create table obj_user")
log.Println("initDB : obj_user created ...") log.Println("initDB : obj_user created ...")
_, err = db.Exec(`CREATE VIEW obj_user_v AS
SELECT ou.obj_id
,ou.name COLLATE utf8mb4_unicode_ci AS name
FROM obj_user ou;`)
failOnError(err, "initDB : create view obj_user_v")
log.Println("initDB : obj_user_v created ...")
_, err = db.Exec(`CREATE TABLE obj_war ( _, err = db.Exec(`CREATE TABLE obj_war (
obj_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT obj_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT
,start_time DATETIME NOT NULL ,start_time DATETIME NOT NULL