upd
This commit is contained in:
parent
528e95fde9
commit
ddfbdc4cdf
12
sql.go
12
sql.go
@ -65,12 +65,12 @@ func initDB() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_, err = db.Exec(`CREATE TABLE msg (
|
_, err = db.Exec(`CREATE TABLE msg (
|
||||||
id BIGINT UNSIGNED NOT NULL,
|
id BIGINT UNSIGNED NOT NULL
|
||||||
user_id BIGINT UNSIGNED NOT NULL,
|
,user_id BIGINT UNSIGNED NOT NULL
|
||||||
direction ENUM('incoming', 'outgoing'),
|
,direction ENUM('incoming', 'outgoing')
|
||||||
date TIMESTAMP NOT NULL,
|
,date TIMESTAMP NOT NULL
|
||||||
text VARCHAR(4096) NOT NULL,
|
,text VARCHAR(4096) NOT NULL
|
||||||
FOREIGN KEY (user_id) REFERENCES user(id) ON DELETE CASCADE
|
-- ,FOREIGN KEY (user_id) REFERENCES user(id) ON DELETE CASCADE
|
||||||
) ENGINE = InnoDB CHARSET=utf8 COLLATE utf8_unicode_ci;`)
|
) ENGINE = InnoDB CHARSET=utf8 COLLATE utf8_unicode_ci;`)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
|
Loading…
Reference in New Issue
Block a user