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

Projects
None yet
2 participants
@martinmr
Copy link
Contributor

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 and others added some commits Jan 12, 2019

@martinmr martinmr self-assigned this Jan 14, 2019

@martinmr martinmr requested a review from manishrjain Jan 14, 2019

@manishrjain
Copy link
Member

manishrjain left a comment

: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

1 of 4 checks passed

GolangCI GolangCI is reviewing your Pull Request...
code-review/reviewable 2 files left (manishrjain, martinmr)
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
license/cla Contributor License Agreement is signed.
Details

@martinmr martinmr deleted the martinmr/single-uid-schema branch Jan 15, 2019

MichelDiz added a commit to MichelDiz/dgraph that referenced this pull request Feb 11, 2019

Preparing changes of uid syntax * association. And fixed a writing er…
…ror 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.

Awaiting* for review.

MichelDiz added a commit to dgraph-io/tutorial that referenced this pull request Feb 15, 2019

Preparing changes in favor of Dgraph's PR #2895
Rectifying changes of uid syntax in favor of dgraph-io/dgraph#2895
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment