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

Sets the unique flag for primKey to true #1852

Merged
merged 4 commits into from
Jan 18, 2024
Merged

Conversation

Stretsh
Copy link
Contributor

@Stretsh Stretsh commented Dec 15, 2023

Although uniqueness is implied for the primary key, having this flag set to false can cause confusion. As discussed in #1842.

Although uniqueness is implied for the primary key, having this flag set to false can cause confusion.
@dfahlander
Copy link
Collaborator

We just need a unit test for it before merging it - somewhere in tests-open.js. We should verify as discussed in #1842 that if we create a database (providing a schema) and then close it and reopen it dynamically, the primary key is marked as unique.

@Stretsh
Copy link
Contributor Author

Stretsh commented Dec 22, 2023

Good that I needed to add the tests, cause I discovered somewhere else that needed to be changed. If one didn't include an & for the primKey, when defining the schema, it would still set the unique flag to false when creating the table.

Hope it's good now. I know it's simple stuff for you fellas with strong PR-fu, but I'm kinda excited about my first PR in a very long time!

@dfahlander dfahlander merged commit cc6e262 into dexie:master Jan 18, 2024
5 checks passed
@dfahlander
Copy link
Collaborator

Very nice test! This PR was really well done.

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