d8ahazard / FlexTV

Other
215 stars 32 forks source link

webApp.php create_table for userdata fails on linux mysql 5.0 #6

Open douginoz opened 5 years ago

douginoz commented 5 years ago

When trying to enable mysql storage, webApp.php fails because you can't have default values for text. from webApp.php:

 $query = "CREATE TABLE `userdata` ( 
 `apiToken` varchar(42) NOT NULL,
 `plexUserName` tinytext NOT NULL,
 `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
 `plexEmail` tinytext NOT NULL,
[...etc]
 `quietStart` tinytext NOT NULL DEFAULT '20:00',

This last line, 'quietStart tinytext not null default 20:00' fails as it's invalid:

The sql error is ' (1101) blob/text column can't have a default value'

 Apache/2.4.29 (Unix) OpenSSL/1.0.2n PHP/7.1.12 mod_perl/2.0.8-dev Perl/v5.16.3
Database client version: libmysql - mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $
PHP extension: mysqliDocumentation curlDocumentation mbstringDocumentation
PHP version: 7.1.12

I can't find the source rules for why this can't be done but http://ftp.nchu.edu.tw/MySQL/doc/refman/5.5/en/blob.html shows an extract and apparently this is a known annoyance.

Bottom line is that you can't have default values for any sort of text type when creating a table, so webApp.php fails.