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

Installation failed on ubuntu 16 #173

Closed
crirocha opened this issue Jan 16, 2017 · 1 comment · Fixed by #177
Closed

Installation failed on ubuntu 16 #173

crirocha opened this issue Jan 16, 2017 · 1 comment · Fixed by #177

Comments

@crirocha
Copy link

Error during install while running query.
I ran:

CREATE TABLE lovd_announcements (
id SMALLINT(5) UNSIGNED ZEROFILL NOT NULL AUTO_INCREMENT,
type VARCHAR(15) NOT NULL DEFAULT "information",
announcement TEXT NOT NULL,
start_date DATETIME NOT NULL DEFAULT "0000-00-00 00:00:00",
end_date DATETIME NOT NULL DEFAULT "9999-12-31 23:59:59",
lovd_read_only BOOLEAN NOT NULL DEFAULT 0,
created_by SMALLINT(5) UNSIGNED ZEROFILL,
created_date DATETIME NOT NULL,
edited_by SMALLINT(5) UNSIGNED ZEROFILL,
edited_date DATETIME,
PRIMARY KEY (id),
INDEX (created_by),
INDEX (edited_by),
CONSTRAINT lovd_announcements_fk_created_by FOREIGN KEY (created_by) REFERENCES lovd_users (id) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT lovd_announcements_fk_edited_by FOREIGN KEY (edited_by) REFERENCES lovd_users (id) ON DELETE SET NULL ON UPDATE CASCADE)
ENGINE=InnoDB,
DEFAULT CHARACTER SET utf8

I got:
[42000] [1067] [Invalid default value for 'start_date']

Fixed replacing
start_date DATETIME NOT NULL DEFAULT "0000-00-00 00:00:00"
with
start_date DATETIME NOT NULL DEFAULT "1000-01-01 00:00:00"

@ifokkema
Copy link
Member

Duplicate of #143.
Thank you for your report! This error message indeed occurs on newer MySQL versions. We will look at it and come up with a fix.

@ifokkema ifokkema added this to the 3.0 Build 19 milestone Jan 19, 2017
@ifokkema ifokkema self-assigned this Jan 25, 2017
ifokkema added a commit that referenced this issue Jan 25, 2017
…allation.

- This occurs on newer MySQL versions that have STRICT_MODE enabled by default as well as NO_ZERO_DATE, which disallows a zero date and returns a fatal error.
- This fix works by removing the NO_ZERO_DATE SQL mode for the session that LOVD runs in.
- Closes #143.
- Closes #173.
@ifokkema ifokkema moved this from To Be Reviewed to Done in Milestone 3.0-19 Jan 31, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants