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

[Data objects] Set default value for database column #6344

Conversation

BlackbitDevs
Copy link
Contributor

@BlackbitDevs BlackbitDevs commented May 6, 2020

Currently data object tables get NULL as default value (or more exactly, no default value is specified while the columns allow NULL values).
This leads to the problem that when you add a new field with a default value this field is set to NULL for all existing objects. #5594 changed this behaviour for newly created objects but for already existing ones the problem still exists.
Quoted from #4600:

By not saving default values to the database a lot of problems arise, e.g. the value does not appear in exports. When you then open the object to check if the value really has not been set, it gets even more confusing because there the default value gets displayed.

This PR is far from being finished, I only want to check other opinions to determine if it is worth to continue.

@BlackbitDevs
Copy link
Contributor Author

Any opinions on that @brusch, @weisswurstkanone, @dvesh3 ?

@fashxp
Copy link
Member

fashxp commented May 14, 2020

see also #6376

@brusch
Copy link
Member

brusch commented Sep 3, 2020

Don't think this is a good idea at all, as @fashxp referenced already above this will cause some major issues in combination with inheritance and probably some other places such as default value generators ...
I'll close this PR for now, but please feel free to continue the discussion. Thanks!

@brusch brusch closed this Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants