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

Field 'description' doesn't have default value #7

Closed
MasterGroosha opened this Issue Nov 11, 2018 · 17 comments

Comments

Projects
None yet
4 participants
@MasterGroosha

MasterGroosha commented Nov 11, 2018

ERROR: 2018/11/11 11:57:33 log.go:26: Rolling back collections INSERT: Error 1364: Field 'description' doesn't have a default value
ERROR: 2018/11/11 11:57:33 log.go:26: Unable to create user: Error 1364: Field 'description' doesn't have a default value

I had to manually change
description varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL
to
description varchar(160) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT ''

however after that it shows the same problem with privacy field. Either something wrong with my mySQL or with your schema.sql.
Server version: 5.7.18-0ubuntu0.16.10.1 (Ubuntu)

@thebaer thebaer added the bug label Nov 11, 2018

@thebaer thebaer self-assigned this Nov 11, 2018

@thebaer thebaer added this to the 0.2 milestone Nov 11, 2018

@thebaer

This comment has been minimized.

Member

thebaer commented Nov 11, 2018

Thanks for reporting this. I'm not sure how different MySQL version handle these things, so we'll provide default values in the application, instead, to fix this.

@kaniini

This comment has been minimized.

kaniini commented Nov 11, 2018

This seems to be a problem with MariaDB.

@thebaer thebaer closed this in a0ac7bb Nov 11, 2018

@MasterGroosha

This comment has been minimized.

MasterGroosha commented Nov 11, 2018

@kaniini I had MariaDB beforehand, but I removed MariaDB and clean installed Mysql-Server-5.7 before installing WriteFreely. I hope no tails of MariaDB left behind.

@thebaer

This comment has been minimized.

Member

thebaer commented Nov 11, 2018

Could you pull in the latest changes on master to see if this is fixed for you?

@kaniini

This comment has been minimized.

kaniini commented Nov 11, 2018

That fixed it, thanks for the quick fix.

@MasterGroosha

This comment has been minimized.

MasterGroosha commented Nov 12, 2018

I'm afraid this issue isn't fixed in 0.2 :(

ERROR: 2018/11/13 00:40:27 log.go:26: Couldn't insert into posts: Error 1364: Field 'privacy' doesn't have a default value
While trying to post.

This might be because I'm running writefreely on Yakkety (16.10) and the latest MySQL is 5.7.18 for this version of Ubuntu.

@thebaer

This comment has been minimized.

Member

thebaer commented Nov 13, 2018

Hmm, yeah not sure what's up with it, but again I'm fixing it in the application.

thebaer added a commit that referenced this issue Nov 13, 2018

@MasterGroosha

This comment has been minimized.

MasterGroosha commented Nov 13, 2018

@thebaer there's also an error while importing schema "field updated does not have default value". Had to add " DEFAULT '1970-01-01 12:00:00' " to make schema import work.

As for "privacy" field above, using 0.2 (clean install) still producing an error while trying to post :(

@thebaer

This comment has been minimized.

Member

thebaer commented Nov 13, 2018

@MasterGroosha Could you try importing the lastest schema.sql to see if that fixed the updated error?

For the privacy field, that'll be fixed in 0.2.1 -- if you build from source you'll be able to try it out already.

@Fastidious

This comment has been minimized.

Fastidious commented Nov 13, 2018

@thebaer OK, so this error is a show stopper, as I can't post. Waiting for 0.2.1 now. :-)

@thebaer

This comment has been minimized.

Member

thebaer commented Nov 13, 2018

Okay, v0.2.1 is out now -- let me know if that fixes things!

@MasterGroosha

This comment has been minimized.

MasterGroosha commented Nov 13, 2018

@thebaer works like a charm now, thank you!
I'm seeing "scheduled" mark near every published message, is that okay?

@thebaer

This comment has been minimized.

Member

thebaer commented Nov 13, 2018

Great!

Is your database on a different timezone? Or is the date set correctly on your machine?

@MasterGroosha

This comment has been minimized.

MasterGroosha commented Nov 13, 2018

@thebaer Both server and my PC are set to UTC+3 (Moscow time)

UPD: Oh, you mean MySQL timezone... I guess it was UTC+0. I changed it to SET GLOBAL time_zone = '+03:00', should I do anything on WriteFreely side?

UPD 2: Okay, I've set UTC+3 globally on MySQL and re-created the whole blog. However it still shows "Scheduled" on my posts :(

@thebaer

This comment has been minimized.

Member

thebaer commented Nov 13, 2018

So are you running both the app and MySQL on the same machine? And to be sure, when your PC and MySQL are both on the same timezone, does publishing new posts still show them as Scheduled?

@MasterGroosha

This comment has been minimized.

MasterGroosha commented Nov 13, 2018

I'm running WriteFreely and MySQL on the same dedicated server which has UTC+3 as its timezone. My PC from which I'm making posts is also on UTC+3.

I even performed a clean install of WriteFreely. Downloaded source code, edited schema.sql by adding DROP TABLE IF EXISTS {table_name} before any CREATE TABLE commands.

After going through initial setup, I open my instance and make post. It shows as "Scheduled", though it is visible for everyone. You can check it yourself by visiting https://duck.cf/

I even tried re-creating instance once more and added SET time_zone = '+03:00' in schema.sql, with no luck

@thebaer

This comment has been minimized.

Member

thebaer commented Nov 13, 2018

Oh yeah, I see. Can you open a new issue about this? Definitely seems like a bug we need to fix.

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