robske110 / IDDataLogger

A DataLogger for Volkwagen ID vehicles. Includes an iOS Widget. Works with VW ID.3 and ID.4 vehicles.
GNU General Public License v3.0
93 stars 13 forks source link

MySql scheme incorrect. #24

Open CrazyHenk44 opened 3 years ago

CrazyHenk44 commented 3 years ago

Hi,

You can't make a text field Unique (= key) without giving the key length. (authKey)

12:18:32.443773 [CRITICAL] PDOException: "SQLSTATE[42000]: Syntax error or access violation: 1170 BLOB/TEXT column 'authKey' used in key specification without a key length" (42000) in "[snip]Main.php" at line 82

And the service file could possible not only sheck for postgress but alternatively for mysql.

robske110 commented 3 years ago

What version of MySQL are you using? In my (limited) testing with 10.6.4-MariaDB using text on UNIQUE fields seem to work fine. I am open to using a more-compatible alternative though, if it is really necessary for a recent version of MySQL. Does varchar(64) work correctly in your setup?

For the service file: Do you refer to the one created by the installation script? (https://github.com/robske110/IDDataLogger/blob/master/docs/install.sh#L30-L46) That script is really only intended for PostgreSQL installation, which is also the recommended database for IDDataLogger. I will not provide any scripts for mysql installation, since using mysql with IDDataLogger, although not deprecated, is definitely discouraged. I simply don't have the time to do regular testing with MySQL nor am I familiar with MySQL.

CrazyHenk44 commented 3 years ago

varchar 64 should work fine yes. I can probably try on a fresh database if you update the code.

Maybe just make a remark "(change pgsql to mysql if needed)". I would expect the service file to be able to depend on or the other in the same file, but I would not know how.

robske110 commented 3 years ago

Ok thanks and can you check what your MySQL server version is?

CrazyHenk44 commented 3 years ago

ii mariadb-client-10.3 1:10.3.29-0+deb10u1 amd64 MariaDB database client binaries ii mariadb-client-core-10.3 1:10.3.29-0+deb10u1 amd64 MariaDB database core client binaries ii mariadb-common 1:10.3.29-0+deb10u1 all MariaDB common metapackage ii mariadb-server 1:10.3.29-0+deb10u1 all MariaDB database server (metapackage depending on the latest version) ii mariadb-server-10.3 1:10.3.29-0+deb10u1 amd64 MariaDB database server binaries ii mariadb-server-core-10.3 1:10.3.29-0+deb10u1 amd64 MariaDB database core server files