test new contraints/keys for obj_msg
This commit is contained in:
parent
4c01afb0de
commit
62ef0516c6
2
msg.go
2
msg.go
@ -137,6 +137,7 @@ func parseSubTypeMessageGRolesAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWa
|
|||||||
} else {
|
} else {
|
||||||
cwm.TreasurerID64 = 0
|
cwm.TreasurerID64 = 0
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
log.Printf("parseSubTypeMessageGRolesAck : Guild roles Ack identified\n")
|
log.Printf("parseSubTypeMessageGRolesAck : Guild roles Ack identified\n")
|
||||||
log.Printf("parseSubTypeMessageGRolesAck : Bartender : %s\n", r.ReplaceAllString(m.Text, "${Bartender}"))
|
log.Printf("parseSubTypeMessageGRolesAck : Bartender : %s\n", r.ReplaceAllString(m.Text, "${Bartender}"))
|
||||||
log.Printf("parseSubTypeMessageGRolesAck : Commander : %s\n", r.ReplaceAllString(m.Text, "${Commander}"))
|
log.Printf("parseSubTypeMessageGRolesAck : Commander : %s\n", r.ReplaceAllString(m.Text, "${Commander}"))
|
||||||
@ -146,6 +147,7 @@ func parseSubTypeMessageGRolesAck(m *ChatWarsMessage, r *regexp.Regexp) (*ChatWa
|
|||||||
log.Printf("cwm.CommanderID64 : %d\n", cwm.CommanderID64)
|
log.Printf("cwm.CommanderID64 : %d\n", cwm.CommanderID64)
|
||||||
log.Printf("cwm.SquireID64 : %d\n", cwm.SquireID64)
|
log.Printf("cwm.SquireID64 : %d\n", cwm.SquireID64)
|
||||||
log.Printf("cwm.TreasurerID64 : %d\n", cwm.TreasurerID64)
|
log.Printf("cwm.TreasurerID64 : %d\n", cwm.TreasurerID64)
|
||||||
|
*/
|
||||||
return &cwm, nil
|
return &cwm, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
6
sql.go
6
sql.go
@ -130,12 +130,12 @@ func initDB() {
|
|||||||
obj_id BIGINT UNSIGNED NOT NULL
|
obj_id BIGINT UNSIGNED NOT NULL
|
||||||
,msg_id BIGINT NOT NULL
|
,msg_id BIGINT NOT NULL
|
||||||
,chat_id BIGINT NOT NULL
|
,chat_id BIGINT NOT NULL
|
||||||
,user_id BIGINT NOT NULL
|
,user_id BIGINT NOT NULL CHECK (user_id > 0)
|
||||||
,sender_user_id BIGINT NOT NULL
|
,sender_user_id BIGINT NOT NULL CHECK (sender_user_id > 0)
|
||||||
,date DATETIME NOT NULL
|
,date DATETIME NOT NULL
|
||||||
,text VARCHAR(4096) NOT NULL
|
,text VARCHAR(4096) NOT NULL
|
||||||
,FOREIGN KEY (obj_id) REFERENCES obj(id) ON DELETE CASCADE
|
,FOREIGN KEY (obj_id) REFERENCES obj(id) ON DELETE CASCADE
|
||||||
,UNIQUE KEY (msg_id, chat_id, sender_user_id)
|
,UNIQUE KEY (msg_id, chat_id, user_id, sender_user_id)
|
||||||
) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_bin;`)
|
) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_bin;`)
|
||||||
failOnError(err, "initDB : create table obj_msg")
|
failOnError(err, "initDB : create table obj_msg")
|
||||||
log.Println("initDB : obj_msg created ...")
|
log.Println("initDB : obj_msg created ...")
|
||||||
|
Loading…
Reference in New Issue
Block a user