nextcloud / nextcloud/tables

Allow Unique Optional fields

Open
#2,244 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage enhancement
Dominant language
JavaScript
Stars
214
Forks
52
Avg merge
1d 10h
Merged PRs (30d)
82

Description

Is your feature request related to a problem? Please describe.

I have defined a field which is Unique but also Optional. When a row with this field unset already exists, inserting a second row with the same unset field results in the Unique validation failing.

Describe the solution you'd like

The Unique validation should not affect unset fields on Optional fields.

Describe alternatives you've considered

No response

Additional context
Image Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the unique-field validation and reproduce the issue with two rows whose optional unique field is unset. The change is done when multiple unset values are accepted while duplicate set values still fail validation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
database
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.