felixkat
Senior Member
There are a number of places, when creating tables or modifying primary keys, where we specify "INT Type"
Since mysql 8 the 'int' type isn't relevant so
CREATE TABLE mytable (id INT(11) AUTO_INCREMENT PRIMARY KEY
should simply be
CREATE TABLE mytable (id INT AUTO_INCREMENT PRIMARY KEY
Further docs:-
https://stackoverflow.com/questions...s-ignored-in-your-mysql-version-unless-defini
https://stackoverflow.com/questions/3135804/types-in-mysql-bigint20-vs-int20/3135854#3135854
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-19.html
This causes confusing looping messages when adding or saving the "id" field in Fabrik. In this case I imported a CSV and manually tried to create an ID field. At times I was losing the AUTO_INCREMENT, which maybe due to the "ALTER" statement failing due to the INT issues.
Hope that makes sense
This will happen every time you save because it can't alter the field to a INT(11)
Code:
'CREATE TABLE IF NOT EXISTS ' . $db->qn($tableName) . ' ( id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, parent_id INT(11), '
Code:
protected function updatePrimaryKey($fieldName, $autoIncrement, $type = 'int(11)')
Since mysql 8 the 'int' type isn't relevant so
CREATE TABLE mytable (id INT(11) AUTO_INCREMENT PRIMARY KEY
should simply be
CREATE TABLE mytable (id INT AUTO_INCREMENT PRIMARY KEY
Further docs:-
https://stackoverflow.com/questions...s-ignored-in-your-mysql-version-unless-defini
https://stackoverflow.com/questions/3135804/types-in-mysql-bigint20-vs-int20/3135854#3135854
https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-19.html
This causes confusing looping messages when adding or saving the "id" field in Fabrik. In this case I imported a CSV and manually tried to create an ID field. At times I was losing the AUTO_INCREMENT, which maybe due to the "ALTER" statement failing due to the INT issues.
Hope that makes sense
This will happen every time you save because it can't alter the field to a INT(11)