This commit is contained in:
shoopea 2019-05-08 21:39:04 +08:00
parent 8114cc21a1
commit c21f11d928

15
sql.go
View File

@ -139,6 +139,21 @@ func initDB() {
) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;`) ) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;`)
failOnError(err, "initDB : create table obj_msg_report") failOnError(err, "initDB : create table obj_msg_report")
_, err = db.Exec(`CREATE TABLE obj_auction_announce (
obj_id BIGINT UNSIGNED NOT NULL
,lot_id BIGINT UNSIGNED NOT NULL
,item VARCHAR(80) NOT NULL
,condition VARCHAR(32) NOT NULL
,quality VARCHAR(32) NOT NULL
,seller VARCHAR(32) NOT NULL
,buyer VARCHAR(32) NOT NULL
,status VARCHAR(32) NOT NULL
,end TIMESTAMP NOT NULL
,FOREIGN KEY (obj_id) REFERENCES obj(id) ON DELETE CASCADE
,UNIQUE KEY (lot_id)
) ENGINE = InnoDB CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;`)
failOnError(err, "initDB : create table obj_auction_announce")
_, err = db.Exec(`CREATE TABLE msg_rules ( _, err = db.Exec(`CREATE TABLE msg_rules (
id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT
,prio SMALLINT NOT NULL ,prio SMALLINT NOT NULL