diff --git a/sql.go b/sql.go index 80f2422..f528225 100644 --- a/sql.go +++ b/sql.go @@ -65,12 +65,12 @@ func initDB() { } _, err = db.Exec(`CREATE TABLE msg ( - id BIGINT UNSIGNED NOT NULL, - user_id BIGINT UNSIGNED NOT NULL, - direction ENUM('incoming', 'outgoing'), - date TIMESTAMP NOT NULL, - text VARCHAR(4096) NOT NULL, - FOREIGN KEY (user_id) REFERENCES user(id) ON DELETE CASCADE + id BIGINT UNSIGNED NOT NULL + ,user_id BIGINT UNSIGNED NOT NULL + ,direction ENUM('incoming', 'outgoing') + ,date TIMESTAMP NOT NULL + ,text VARCHAR(4096) NOT NULL +-- ,FOREIGN KEY (user_id) REFERENCES user(id) ON DELETE CASCADE ) ENGINE = InnoDB CHARSET=utf8 COLLATE utf8_unicode_ci;`) if err != nil { log.Fatal(err)