Grimthorr / laravel-user-settings

Simple user settings facade for Laravel 5.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change SETTINGS type from STRING to TEXT

johannesschobel opened this issue · comments

Currently, the SETTINGSfield in the database (or rather within the migration file) is declared as STRING. This, however, only allows for storing max. 255 chars (at least for MySQL databases). Keep in mind, that the settings are stored as JSON object (i.e., one need additional chars for braces, commas, ...).

It would be good to change the type of the settings field in the migration file to TEXT to store at least 65k chars!

Additional Information:

Type Maximum length
TINYTEXT 255 (2^8−1) bytes
TEXT 65,535 (2^16−1) bytes = 64 KiB
MEDIUMTEXT 16,777,215 (2^24−1) bytes = 16 MiB
LONGTEXT 4,294,967,295 (2^32−1) bytes = 4 GiB

However, the "maximum length" may differ, depending on the actual encoding of the database!

For more information see the offical MySQL Documentation: http://dev.mysql.com/doc/refman/5.7/en/string-type-overview.html

Issue is resolved.. Thanks a lot!

Merged #14 to fix this.