yTakkar / React-Instagram-Clone-2.0

A reactive Single-Page Instagram-Clone with some new features!! πŸ’ͺπŸ“ΈπŸ‘“ - No longer maintained.
MIT License
986 stars 454 forks source link

Not null specified as column types who recieve null value on initial account creation #61

Open aaronduchateau opened 5 years ago

aaronduchateau commented 5 years ago

Hey Guys, first of all, nice project. I'm excited to start messing around with it.

in your db.sql dump i'm noticing not null constraints on almost (if not all) of the tables. The app fired up fine but columns like user.instagram are crapping out on account creation.

My workaround for now was just to make those columns nullable and re-import the db.

account_type enum('public','private') COLLATE utf8mb4_bin NOT NULL DEFAULT 'public', instagram varchar(500) COLLATE utf8mb4_bin NULL, twitter varchar(500) COLLATE utf8mb4_bin NULL, facebook varchar(500) COLLATE utf8mb4_bin NULL,

etc...

Just wondering what you are doing on your side to deal with this, as I assume something is converting those missing columns into empty strings to avoid those errors when an account is created (on your side).

Also getting a bunch of Expression #1 of ORDER BY clause is not in SELECT list, references column 'gitmenu.hashtags.hashtag_time' which is not in SELECT list; this is incompatible with DISTINCT errors.... My understanding is that these errors can be dependent on the version of SQL you are running, so might be good to include that in the #readme...

Circumnavigating that for now by adding hashtag_time to the selection...

Also noticing i'm needing to add backticks to many of the table names for the queries not to fail. I'm running mySQL 8.0.11

Cheers, Aaron

dev1Blayzer commented 5 years ago

yes, I had the same problem

TheRadRabbit commented 5 years ago

This is because MySQL is in 'strict' mode - by default. You'll need to turn off strict mode to effectively ignore these issues. See here: https://stackoverflow.com/questions/40881773/how-to-turn-on-off-mysql-strict-mode-in-localhost-xampp

Note to make it permanent (every time MySQL is started) you'll need to make the change in the .ini file or .cnf (win/linux)