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

Add ability to set schema to a single UID schema. #2895

Merged
merged 8 commits into from
Jan 15, 2019

Conversation

martinmr
Copy link
Contributor

@martinmr martinmr commented Jan 14, 2019

This PR addresses #2511.

  • New uid schemas can be defined using "uid" or "[uid]". The first option will ensure a 1-to-1 association. The second schema will behave like previous versions of Dgraph behaved.

  • Trying to add another predicate to a 1-to-1 uid predicate will return an error. The options are either to delete the existing predicate first or to change the schema to "[uid]". This behavior is different than what happens for the reset of the types (the existing predicate is overwritten). Since this is a breaking change, we don't want to cause existing users to overwrite their data inadvertedly. Eventually, the behavior will be changed to match the behavior of the other types.

  • Breaking change. It will be included as part of the 1.1 release.


This change is Reviewable

@martinmr martinmr self-assigned this Jan 14, 2019
Copy link
Contributor

@manishrjain manishrjain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm: Reviewed the PR, and did a func rename. Good to be merged.

Reviewed 8 of 14 files at r1, 1 of 3 files at r2, 5 of 6 files at r3.
Reviewable status: 12 of 14 files reviewed, all discussions resolved (waiting on @manishrjain)

@martinmr martinmr merged commit 1043389 into master Jan 15, 2019
@martinmr martinmr deleted the martinmr/single-uid-schema branch January 15, 2019 21:55
MichelDiz added a commit to dgraph-io/tutorial that referenced this pull request Feb 15, 2019
Rectifying changes of uid syntax in favor of dgraph-io/dgraph#2895
danielmai pushed a commit that referenced this pull request Mar 1, 2019
…or in the docs. (#3002)

* Fixed a writing error in docs

* Preparing changes of uid syntax * association. And fixed a writing error in the docs.

Rectifying changes of uid syntax in favor of #2895

Some predicates need to be revised if they even need the change. According to its purpose (like "rated" is it a list or a single 1 to 1?). As far as I can analyze, it is okay.
@MichelDiz MichelDiz mentioned this pull request Mar 11, 2019
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
…or in the docs. (dgraph-io#3002)

* Fixed a writing error in docs

* Preparing changes of uid syntax * association. And fixed a writing error in the docs.

Rectifying changes of uid syntax in favor of dgraph-io#2895

Some predicates need to be revised if they even need the change. According to its purpose (like "rated" is it a list or a single 1 to 1?). As far as I can analyze, it is okay.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants