This commit is contained in:
shoopea 2019-05-14 10:31:42 +08:00
parent af34558920
commit 44f622608b

19
sql.go
View File

@ -64,6 +64,16 @@ func initDB() {
failOnError(err, "initDB : create table code_obj_sub_type")
log.Println("initDB : code_obj_sub_type created ...")
_, err = db.Exec(`CREATE TABLE code_obj_castle (
id SMALLINT UNSIGNED NOT NULL
,user_id VARCHAR(32) NOT NULL
,intl_id VARCHAR(32) NOT NULL
,name VARCHAR(80) NOT NULL
,PRIMARY KEY (id)
) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;`)
failOnError(err, "initDB : create table obj_castle")
log.Println("initDB : obj_guild created ...")
_, err = db.Exec(`CREATE TABLE obj (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT
,obj_type_id SMALLINT UNSIGNED NOT NULL
@ -101,15 +111,6 @@ func initDB() {
failOnError(err, "initDB : create table obj_guild")
log.Println("initDB : obj_guild created ...")
_, err = db.Exec(`CREATE TABLE code_obj_castle (
id SMALLINT UNSIGNED NOT NULL
,user_id VARCHAR(32) NOT NULL
,intl_id VARCHAR(32) NOT NULL
,name VARCHAR(80) NOT NULL
) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;`)
failOnError(err, "initDB : create table obj_castle")
log.Println("initDB : obj_guild created ...")
_, err = db.Exec(`CREATE TABLE obj_war (
obj_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT
,start_time DATETIME NOT NULL