To create an INDEX
on a TEXT
field, you need to specify the index length, like the error is hinting at. This is will only index part of your text field, so you may want to consider using a different field as part of the index, like maybe a DATE
field - article names are unique by day then, or something like that.
INDEX UniqueArticle (article_id, user_id, text(100));
For MyISAM tables
The maximum key length is 1000 bytes. This can also be changed by changing the source and recompiling. For the case of a key longer than 250 bytes, a larger key block size than the default of 1024 bytes is used.
For InnODB tables
Index key prefixes can be up to 767 bytes. See [Section 12.1.8, “CREATE INDEX Syntax”][1].
See: http://dev.mysql.com/doc/refman/5.6/en/create-table.html
Also see: Problem in using TEXT field in mysql Table