Skip to content

Suggestion: Unique should allow empty values #542

Closed Answered by ganigeorgiev
benallfree asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure I follow. I thought this was already resolved with the recent Indexes UI.
Note that PocketBase doesn't store null values (with exception of the json type field). If you want the unique constraint to ignore empty values use a partial index as shown above, aka. specifying a WHERE clause that will skip the empty values from the unique check. The index can be specified from the Admin UI > Edit collections > "Unique constraints and indexes" section.

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@benallfree
Comment options

@benallfree
Comment options

@ganigeorgiev
Comment options

Answer selected by benallfree
@benallfree
Comment options

@aleBranching
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants