question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

We need a way to mark fields as unique across their content type.

See original GitHub issue

When creating content type developers should be able to designate field as unique. Uniqueness should be defined within organization. Because information for a field could be aggregated from multiple data sources we cannot enforce strict uniqueness. However, we can soft enforce it, meaning if an entry already exists we will not allow user to create another one with same unique attribute. But we will not enforce uniqueness on already existing data.

E.g.: User is a member of both cardstack and dotBC organizations. Both have content type tag with name field defined and that field is marked as unique. User should not be permitted to create a tag in cardstack with a names that already exist in it. But if a tag with this name exists in dotBC but not in cardstack user should be allowed to do that.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
dnaidionovcommented, Nov 26, 2018

No, this is something that still needs to be designed. To enable this we would also need some kind of cardstack-SSO solution. The simplest case is that each organization is deployed completely separately. But it’s not exactly clear what happens if 2 “organizations” are deployed on the same hub, or even if that can be done given that we might require complete data separation for whatever reasons - e.g. legal. As Ed mentioned above:

the concept of indices with clear boundaries does not exist and I’m not completely sure we’d want it to. We should plan to discuss in more detail.

So currently we proceed with the assumption that “organization” is deployed on its own instance of hub and doesn’t share its indices with others.

0reactions
mansonacommented, Nov 21, 2018

So that second case is the one that I understand and I’m confident I understand the use case 👍

That first one is new to me 🤔 I don’t know the mechanism by which the data in an “organisation” is shared. Do we have an example of this kind of setup yet?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Marking Required Fields in Forms - Nielsen Norman Group
Using an asterisk to mark required fields is an easy way to improve the usability of your forms. Only marking optional fields makes...
Read more >
Require unique values for a field
Require unique values for a field ; Right-click the field label in the form and select Configure Dictionary. ; Configure the form to...
Read more >
Making Name field unique - Salesforce Developer Community
Few questions: I have a class with 'State' and 'Number'. The combination should be unique, and should be the Name field for the...
Read more >
About Unique property - Contentstack
The Unique property prevents the duplication of current content across entries in a content type. Note: The Unique property works only for content...
Read more >
How to define two fields "unique" as couple - django
There is a simple solution for you called unique_together which does exactly what you want. For example: class MyModel(models.Model): field1 = models.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found