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

[@loopback/sequelize] The Model “defaultFn” property decorator is not working #9597

Closed
KalleV opened this issue Jun 1, 2023 · 0 comments · Fixed by #9710
Closed

[@loopback/sequelize] The Model “defaultFn” property decorator is not working #9597

KalleV opened this issue Jun 1, 2023 · 0 comments · Fixed by #9710
Labels

Comments

@KalleV
Copy link
Contributor

KalleV commented Jun 1, 2023

Describe the bug

I have been testing the new “loopback/sequelize” library and noticed that the “defaultFn” options on the Loopback model property decorators are not used: https://loopback.io/doc/en/lb4/Model.html#property-decorator

This is a fairly minor regression that can be worked around but it would be great if the existing default value function handling was ported over:
https://github.com/loopbackio/loopback-datasource-juggler/blob/0b9cee7f3b53ca22e716b63db2ed1840d61ef0b2/lib/model.js#L281

Logs

No response

Additional information

I experimented with using some of the built-in Sequelize data types mapping to default values and it seemed to provide an equivalent result: https://sequelize.org/docs/v6/core-concepts/model-basics/#default-values.

Reproduction

N/A

@KalleV KalleV added the bug label Jun 1, 2023
@KalleV KalleV changed the title [@loopback/sequelize] The “defaultFn” property decorator is not working [@loopback/sequelize] The Model “defaultFn” property decorator is not working Jun 1, 2023
shubhamp-sf added a commit to shubhamp-sf/loopback-next that referenced this issue Jun 30, 2023
With overridable registry of aliases.
The default registry includes existing ones that juggler
provides such as uuid, now, shortid etc.

Fixes: loopbackio#9597

Signed-off-by: Shubham P <shubham.prajapat@sourcefuse.com>
shubhamp-sf added a commit to shubhamp-sf/loopback-next that referenced this issue Jun 30, 2023
With overridable registry of aliases.
The default registry includes existing ones that juggler
provides such as uuid, now, shortid etc.

Fixes: loopbackio#9597

Signed-off-by: Shubham P <shubham.prajapat@sourcefuse.com>
shubhamp-sf added a commit to shubhamp-sf/loopback-next that referenced this issue Jul 2, 2023
With overridable registry of aliases.
The default registry includes existing ones that juggler
provides such as uuid, now, shortid etc.

Fixes: loopbackio#9597

Signed-off-by: Shubham P <shubham.prajapat@sourcefuse.com>
shubhamp-sf added a commit to shubhamp-sf/loopback-next that referenced this issue Jul 2, 2023
With overridable registry of aliases.
The default registry includes existing ones that juggler
provides such as uuid, now, shortid etc.

Fixes: loopbackio#9597

Signed-off-by: Shubham P <shubham.prajapat@sourcefuse.com>
samarpanB pushed a commit that referenced this issue Jul 2, 2023
With overridable registry of aliases.
The default registry includes existing ones that juggler
provides such as uuid, now, shortid etc.

Fixes: #9597

Signed-off-by: Shubham P <shubham.prajapat@sourcefuse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant