Skip to content

Conversation

@syabiku
Copy link
Contributor

@syabiku syabiku commented Sep 11, 2021

Although "name" is specified as a unique index in the example, it's possible to add multiple records with the same value for "name." This is because Dexie schema syntax requires that the symbol & be pre-pended to a unique index (see https://dexie.org/docs/Version/Version.stores()), otherwise the index is a regular index.

This PR properly specifies the unique indexes, and it add another property for regular indexes. It also updates the example to show that the unique index is working (it will fail to add a record if it duplicates a value that should be unique).

@nwestfall nwestfall merged commit 9ebc3e7 into nwestfall:master Sep 15, 2021
@syabiku syabiku deleted the unique-indexes-fix branch September 16, 2021 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants