names fix

This commit is contained in:
shoopea 2019-08-12 16:55:15 +08:00
parent eace24d67f
commit 9202a79283
2 changed files with 12 additions and 3 deletions

View File

@ -108,10 +108,7 @@ func resetObjItem() {
reloadObjItem(`513`, `Silver Arrow`, objSubTypeItemMisc, 10) reloadObjItem(`513`, `Silver Arrow`, objSubTypeItemMisc, 10)
reloadObjItem(`515`, `Broad Arrows Pack`, objSubTypeItemMisc, -1) reloadObjItem(`515`, `Broad Arrows Pack`, objSubTypeItemMisc, -1)
reloadObjItem(`517`, `Heavy Arrows Pack`, objSubTypeItemMisc, -1) reloadObjItem(`517`, `Heavy Arrows Pack`, objSubTypeItemMisc, -1)
reloadObjItem(`518`, `Hay`, objSubTypeItemResource, -1)
reloadObjItem(`519`, `Compound Arrows Pack`, objSubTypeItemMisc, -1) reloadObjItem(`519`, `Compound Arrows Pack`, objSubTypeItemMisc, -1)
reloadObjItem(`520`, `Hamsters`, objSubTypeItemResource, -1)
reloadObjItem(`521`, `Cheese`, objSubTypeItemResource, -1)
reloadObjItem(`614`, `🎟Gift Coupon 'Pig'`, objSubTypeItemMisc, 1) reloadObjItem(`614`, `🎟Gift Coupon 'Pig'`, objSubTypeItemMisc, 1)
reloadObjItem(`615`, `🎟Gift Coupon 'Horse'`, objSubTypeItemMisc, 1) reloadObjItem(`615`, `🎟Gift Coupon 'Horse'`, objSubTypeItemMisc, 1)
reloadObjItem(`616`, `🎟Gift Coupon 'Owl'`, objSubTypeItemMisc, 1) reloadObjItem(`616`, `🎟Gift Coupon 'Owl'`, objSubTypeItemMisc, 1)

12
sql.go
View File

@ -387,6 +387,18 @@ func initDB() {
failOnError(err, "initDB : create view obj_name_v") failOnError(err, "initDB : create view obj_name_v")
log.Println("initDB : obj_name_v created ...") log.Println("initDB : obj_name_v created ...")
_, err = db.Exec(`CREATE VIEW obj_item_name_v AS
SELECT obi.obj_id
,obi.intl_id
,obn.name COLLATE utf8mb4_unicode_ci AS name
,obn.priority
FROM obj_name obn
,obj_item obi
WHERE obi.obj_id = obn.obj_id
ORDER BY obi.intl_id ASC;`)
failOnError(err, "initDB : create view obj_item_name_v")
log.Println("initDB : obj_item_name_v created ...")
_, err = db.Exec(`INSERT INTO code_obj_type (id, intl_id, name) _, err = db.Exec(`INSERT INTO code_obj_type (id, intl_id, name)
VALUES (` + strconv.Itoa(objTypeUser) + `, "user", "User") VALUES (` + strconv.Itoa(objTypeUser) + `, "user", "User")
,(` + strconv.Itoa(objTypeGuild) + `, "guild", "Guild") ,(` + strconv.Itoa(objTypeGuild) + `, "guild", "Guild")