Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid default value for 'created_at' #924

Closed
ghost opened this issue Mar 25, 2019 · 3 comments
Closed

Invalid default value for 'created_at' #924

ghost opened this issue Mar 25, 2019 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 25, 2019

`Error in file: "html/app/code/community/Ebizmarts/MailChimp/sql/mailchimp_setup/mysql4-upgrade-1.1.14-1.1.15.php" - SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created_at'

Trace:
#0 html/app/code/core/Mage/Core/Model/Resource/Setup.php(644): Mage::exception('Mage_Core', 'Error in file: ...')
#1 html/app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.1.13', '1.1.15')
#2 html/app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.1.13', '1.1.15')
#3 html/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 html/app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 html/app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#6 html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 html/index.php(91): Mage::run('', 'store')`

https://github.com/mailchimp/mc-magento/blob/develop/app/code/community/Ebizmarts/MailChimp/sql/mailchimp_setup/mysql4-upgrade-1.1.14-1.1.15.php
mysql4-upgrade-1.1.14-1.1.15.php

I've updated type of field to TIMESTAMP, but not sure that all will work fine.

https://dev.mysql.com/doc/refman/5.6/en/timestamp-initialization.html

@Santiagoebizmarts
Copy link
Contributor

Hello @andik85

Please add the missing information required in the issue template.
Don't forget to include your mysql version.

Kind Regards.

@jan-lukowiak
Copy link
Contributor

Hello,

I just had the same issue with a client website running with MySQL 5.5. As you can read in this answer on stackexchange MySQL is not abled to have the CURRENT_TIMESTAMP as a default value for a DATETIME field. MySQL 5.6 changed that.
So you have to either update your MySQL database to at least MySQL 5.6 or change the default value in the file /app/code/community/Ebizmarts/MailChimp/sql/mailchimp_setup/mysql4-upgrade-1.1.14-1.1.15.php to something like '0000-00-00 00:00:00'.

Kind Regards, Jan

@aeu
Copy link

aeu commented Jan 20, 2020

@Santiagoebizmarts - is setting the default to be '0000-00-00 00:00:00' as recommended by @jan-lukowiak safe ? I'm in a similar boat, where I am trying to install this extension on a store that is running on a MySQL 5.5 database. I cannot upgrade MySQL just yet, but I'd like to not be stuck at 1.1.14.

Thanks,

Alfonso.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants