Description
Steps to produce:
1 - Create a model and run autoupdate/automigrate
2 - Add a new required property with a default value to the model for example:
"newProperty": {
"type": "Number",
"required": true,
"default": 0
}
3 - Run autoupdate again
What's expected: New column should be added with the default value.
What actually happens: Autoupdate fails here and throws this:
error: column "newProperty" contains null values
It happens because it tries to add column with NOT NULL
constraint, but this is only possible, if we give a default value, but loopback-connector-postgresql
ignores the given default value in the model configuration.
I would like to contribute this myself, but I'm not sure if I'm getting the test configuration to work. I'm getting error: password authentication failed for user "user"
for the first test, but the credentials in the configuration are correct and also a lot of other tests are failing.