-
Notifications
You must be signed in to change notification settings - Fork 344
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
Error PDOStatement: Invalid default value for 'updatetime' #723
Comments
What is your version of mysql? The syntax used in selfoss works only with mysql >=5.6. Simple workaround, as default value use useless because of the trigger declared later in the same file: --- a/daos/mysql/Database.php
+++ b/daos/mysql/Database.php
@@ -56,7 +56,7 @@ class Database {
source INT NOT NULL ,
uid VARCHAR(255) NOT NULL,
link TEXT NOT NULL,
- updatetime DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ updatetime DATETIME NOT NULL,
author VARCHAR(255),
INDEX (source)
) ENGINE = InnoDB DEFAULT CHARSET=utf8; |
Ahhh this worked perfectly thank you! I am within the correct version of mysql though |
Hi, first thanks for creating a self-hosted & opensource RSS solution - I was using tt-rss for years - anyway as their support is really rude and actually offensive, I decided to look for an alternative and found selfoss. I had the same issue (running mySQL 5.5) as described above when trying to install selfoss - after changing the file Database.php as proposed, I could run selfoss & the following mySQL-tables are created:
Anyway if I try to e.g. access the settings, I see the following error on frontend:
If I have a look into the PHP error log, I see the following entries:
It seems that somehow the prefix I set with db_prefix=selfoss_ in config.ini is not considered anymore after installation. After reloading the frontend with F5, the interface is even not visible anymore - instead "an error occured" is shown and PHP logs shows again
Is this a known bug? |
@robertharm Sometimes we forget to add the prefix when we change the code and as not many people use the |
@jtojnar thanks - using the development version fixed the issue. Anyway it would be great if the different SQL create statement for mySQL<5.6 would be used automatically, so that the change above does not need to be applied on each update (I talked to my hoster, but upgrading to mySQL 5.6 is not on the nearer roadmap yet unfortunately). |
Is this still relevant? LTS Debian does not support MySQL < 5.6. |
CentOS7 uses MariaDB 5.5. |
Fixed in #863 |
Hey there!
On a fresh install I seem to be receiving the following error from the log file.
Error PDOStatement: Invalid default value for 'updatetime'
Here's a copy of my config (I'm using mysql)
Is there something wrong with all of this?
The text was updated successfully, but these errors were encountered: