-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Guids for replicated models #1140
Conversation
deprecated('The model ' + this.modelName + ' is tracking changes, ' + | ||
'which requries a string id with GUID/UUID default value.'); | ||
} | ||
|
||
Change.attachTo(this.dataSource); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That regex is a bit silly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall I rewrite it as !(id.Prop.defaultFn === 'uuid' || id.Prop.defaultFn === 'guid')
?
Ouch, |
Fixed, the patch depends on loopbackio/loopback-datasource-juggler#473 now. @ritch LGTY now? |
LGTM |
4f7d6b0
to
f2c5af4
Compare
Print a deprecation warning when a persisted model is tracking changes but does not have a client-generated unique string id property (GUID).
Fix all test models that are tracking changes so that they have a generated unique string id. Make model names unique where possible to prevent tests reusing the same model which causes unintented side effects.
f2c5af4
to
f21b29e
Compare
…-models Guids for replicated models
Closes #981
/to @ritch please review. I decided to use soft deprecation warning instead of throwing an exception. This way we are not breaking backwards compatibility and make the upgrade process easier (IMO).