Skip to content

Conversation

@wasabigeek
Copy link

Fixes #33

@wasabigeek
Copy link
Author

@dflourusso appreciate your comments!

@dflourusso
Copy link
Owner

Thanks for your contribution. I will review your code ASAP.
I don't know if the proposed solution is the best.
For example, should i apply the default values to update too?

@wasabigeek
Copy link
Author

That's a good question, maybe we can think of it similarly to how column defaults are handled in sql databases? If I understood correctly, it will set defaults on update too, if the fields are empty.

@dflourusso
Copy link
Owner

Another question, in the update method, i don't need to pass all model properties, then make sense not apply the defaultsvalues , what do you think?

@wasabigeek
Copy link
Author

wasabigeek commented Oct 25, 2020

To clarify, if we are updating a column A, it shouldn't set column B to it's default value, even if it's empty? I agree, it seems like that's the default SQLite behaviour is, which I think we should follow.

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.

Defaults only work with new then save, not create

2 participants