Add specific size to bookmark_url key

MySQL can't index an entire TEXT field; the key must be truncated
https://stackoverflow.com/a/1827099
This commit is contained in:
Dean Jackson 2019-09-22 18:49:11 +02:00
parent fbd4e37643
commit 76a7856f80

View file

@ -60,7 +60,7 @@ func OpenMySQLDatabase(connString string) (mysqlDB *MySQLDatabase, err error) {
html MEDIUMTEXT NOT NULL DEFAULT "",
modified TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY(id),
UNIQUE KEY bookmark_url_UNIQUE (url),
UNIQUE KEY bookmark_url_UNIQUE (url(255)),
FULLTEXT (title, excerpt, content))`)
tx.MustExec(`CREATE TABLE IF NOT EXISTS tag(