PurpleTurtleCreative / completionist

Asana integration plugin for WordPress.
https://purpleturtlecreative.com/completionist/
GNU General Public License v3.0
1 stars 0 forks source link

Request Tokens primary key exceeds 1000 bytes limit #159

Closed MichelleBlanchette closed 1 year ago

MichelleBlanchette commented 1 year ago

A client reached out with an issue and gave me access to their staging site.

Using Query Monitor, I could see that the Request Tokens database table was failing to be installed:

Specified key was too long; max key length is 1000 bytes

Screenshot 2023-07-28 at 4 58 59 PM

MD5 always produces a string of length 32, so varchar(255) is quite excessive anyways (which is indexed as 1020 bytes).

Update the table schema to use char(32) since a token should always exist and is always MD5-hashed. (link)

MichelleBlanchette commented 1 year ago

Also, please trigger a PHP error every time the database tables fail to be installed. The user had debug log display enabled which only showed an error that the database table was missing.

It'd be good to report the actual SQL error when the database tables fail to be installed or upgraded so I don't need to install Query Monitor to debug issues.

Screenshot 2023-07-27 at 3 12 32 PM