Martin C Posted April 20 Share Posted April 20 (edited) Update prestashop from 8.1.2 to 8.1.5 with 1-Click Upgrade module version 5.0.1. Updating database schema fails: Mariadb version 10.6.17. How can i manually execute the queries to update the database schema? Where can i find the queries? Updating database schema... Executing: ALTER TABLE ps_feature_flag CHANGE state state TINYINT(1) DEFAULT '0' Executing: AtTER TABLE ps_tab DROP hide_host_mode Executing: ALTER TABLE ps_translation CHANGE `key` `key` TEXT NOT NULL COLLATE `utf8_bin` Executing: ALTER TABLE ps_bk_payment_methods CHANGE created_at created_at DATETIME NOT NULL DEFAULT 'current_timestamp()' , CHANGE updated_at updated_at DATETIME NOT NULL 19:32:17 CRITICAL [console] Error thrown while running command "prestashop:schema:update-without-foreign --env=prod". Message: "An exception occurred while executing 'ALTER TABLE ps_C CHANGE created_at created_at DATETIME NOT NULL DEFAULT 'current_timestamp()' , CHANGE updated_at updated_at DATETIME NOT NULL': SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created_at'" ["exception" => Doctrine\DBAL\Exception\DriverException { …},"command" => "prestashop:schema:update-without-foreign --env=prod","message" => """ An exception occurred while executing 'ALTER TABLE ps_bk_payment_methods CHANGE created_at created_at DATETIME NOT NULL DEFAULT 'current_timestamp()' , CHANGE updated_at updated_at DATETIME NOT NULL':\n \n SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created_at' """] In AbstractMySQLDriver.php line 128: An exception occurred while executing 'ALTER TABLE ps_bk_payment_methods CH ANGE created_at created_at DATETIME NOT NULL DEFAULT 'current_timestamp()' , CHANGE updated_at updated_at DATETIME NOT NULL': SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default val ue for 'created_at' In Exception.php line 18: SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default val ue for 'created_at' In PDOConnection.php line 141: SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default val ue for 'created_at' prestashop:schema:update-without-foreign [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-e|--env ENV] [--no-debug] [--id_shop [ID_SHOP]] [--id_shop_group [ID_SHOP_GROUP]] [--] Edited April 21 by Martin C solved the issue (see edit history) Link to comment Share on other sites More sharing options...
Martin C Posted April 20 Author Share Posted April 20 Why does the update fail? Link to comment Share on other sites More sharing options...
Nickz Posted April 20 Share Posted April 20 14 minutes ago, Martin C said: How can i manually execute the queries to update the database schema? Where can i find the queries? Make a back up first, you can edit the database over BO and over PhPmyadmin. Link to comment Share on other sites More sharing options...
Martin C Posted April 20 Author Share Posted April 20 Yes i know that but i want to know which changes you have to make to fully update the database schema. I found out that the queries are made on the fly by the UpdateSchemaCommand.php file. Is it only the table ALTER TABLE ps_bk_payment_methods which fails or is the update script stepping out of the function because of the error and there are more tables which must be altered? Martin Link to comment Share on other sites More sharing options...
Nickz Posted April 20 Share Posted April 20 This might fit: https://stackoverflow.com/questions/61262556/symfony-base-table-or-view-already-exists-1050-table-migration-versions-alre Link to comment Share on other sites More sharing options...
Martin C Posted April 20 Author Share Posted April 20 Thanks but not not the same issue. Link to comment Share on other sites More sharing options...
Martin C Posted April 21 Author Share Posted April 21 Probably the query is wrong: ALTER TABLE ps_bk_payment_methods CHANGE created_at created_at DATETIME NOT NULL DEFAULT 'current_timestamp()' This must be without quotes to be accepted by MariaDB: ALTER TABLE ps_bk_payment_methods CHANGE created_at created_at DATETIME NOT NULL DEFAULT current_timestamp() IS MySQL configured wrong or is it a prestashop upgrade bug? Link to comment Share on other sites More sharing options...
Martin C Posted April 21 Author Share Posted April 21 Solved removed the buckaroo tables update Prestashop and added the Buckaroo tables again. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now