-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Working with default values #155
Labels
Comments
@7even Thanks for reporting this. Which version are you using? |
The latest one, |
@7even Can you please also paste here the mapping for that entity? |
Yep, here it is: collection :deployments do
entity Deployment
repository DeploymentRepository
attribute :id, Integer
attribute :project_id, Integer
attribute :environment, String
attribute :branch, String
attribute :deployed_at, Time
end |
Although there is something to fix regarding the NOT NULL issue, indicating that a given attribute is required and it has a default value should also be clearly defined in the application level and not rely in the database. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently
lotus-model
doesn't respect default values in the database:Seems like the empty
deployed_at
value is being written to the database. I see 2 possible ways to solve this issue: to read the default value into the entity upon it's creation (but I believe it breaks incapsulation and is not very helpful with a default value ofNOW()
), or to save only attributes that were changed.The text was updated successfully, but these errors were encountered: