The default value is stored in the table's schema.
The default value is not stored in the table's schema.
Going back to 8.3.1 solves the issue.
Hmm, that's odd. This has been working for me (unless it was broken very recently). @rijkvanzanten — App or API?
I don't seem to have this problem on the live demo on v8.4.0.. @GMTA would you be able to share a sql dump so we can reproduce this?
I can not remember how I have been related to this issue?
oh my bad, GitHub put your name first on the list.. That's normally the poster of the issue. No idea what happened there!
Same problem for me after the 8.4.0 update
Hi @rijkvanzanten,
Please see the following database that exposes the issue:
example-db.sql.gz
I've created a table named test_table with a column name. I'm unable to set the default value for this column.
Please make sure to run this on PHP 7.3 and MySQL 8.0.15.
Please make sure to run this on PHP 7.3 and MySQL 8.0.15.
Ah, that's most likely what the problem is.. Directus doesn't support MySQL v8 yet..
Directus: 8.4.0
PHP: 7.4.1
MySQL: 5.7.28
I'm having troubles with this bug. When I edit "ID" primary key stops working
demo has the same bug
Please make sure to run this on PHP 7.3 and MySQL 8.0.15.
Ah, that's most likely what the problem is.. Directus doesn't support MySQL v8 yet..
@rijkvanzanten on version 8.3.1 worked fine with MySQL v8, the default value was saved
Please make sure to run this on PHP 7.3 and MySQL 8.0.15.
Ah, that's most likely what the problem is.. Directus doesn't support MySQL v8 yet..
Ah, based on "MySQL 5.7+" as stated on the page below, I thought it was supported.
https://docs.directus.io/installation/git.html
But it seems weird that the same database version worked in 8.3.1 but not in 8.4.0?
I've tested on MySQL 5.7 with Directus v8.4.0 and the same issue pops up. Might this be the same as #1676 ?
I took the tag 8.5.0 and tried this, I see the same issue. It is not persisting default value. This is the steps I followed.
git pull
git checkout v8.5.0
php bin/directus db:upgrade -N - Verified the migrations ran by checking the directus_migrations table.
Accessed the app via url,
modified a field and set the default value.
Opened the same field again, it didn't save the default value.
Am I missing anything? Please assist
@rijkvanzanten Could you please remove the alt-stack label? It's not working on the default supported stack as well.
After trying out v8.5.4, I noticed that not only the default value is broken, but also unsigned/signed for integers is completely ignored and always set to signed.
@rijkvanzanten I think it is related to this #1601.
If we will revert changes of #1601 It will work perfectly fine.
@GMTA
I fixed this issue with PR #1764.
Please check it and if issue is solved then close it.
Fixed in #1764
Most helpful comment
Ah, based on "MySQL 5.7+" as stated on the page below, I thought it was supported.
https://docs.directus.io/installation/git.html
But it seems weird that the same database version worked in 8.3.1 but not in 8.4.0?