alexbilbie/CodeIgniter-OAuth-2.0-Server — Issue #14: Access_token field data type
Author: aphofstede
Created: 2012-01-05 12:00:25+00:00
State: open

Hi Alex,

Do you see any problems with changing the data type of `access_token` from text to varchar(64) in the database?
The only thing I can think of is that it includes a timestamp now, so if time() ever returns more than 31 characters it will fail... I think we can safely assume this won't be the case so we can make the length even shorter. (10+1+32=43?)

The advantage is that we can then index on that field, which averts table-searches being done when making selects/joins based on the token.

On a side note: Shouldn't there be a foreign key relation between oauth_sessions and oauth_session_scopes on access_token?

Cheers,
Alex