Skip to content

chore: allow uniqueness constraints on root or parent - #328

Merged
lebalz merged 17 commits into
mainfrom
chore/unique-docs
Oct 11, 2026
Merged

lebalz merged 17 commits into
mainfrom
chore/unique-docs

Conversation

@lebalz

@lebalz lebalz commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Adds explicit document uniqueness constraints, replacing uniqueMain and selection by the first document of a type.

  • uniqOnRoot identifies a document within its root; uniqOnParent identifies a child within its parent. Both are scoped by author and document type.
  • uniqOnRoot: 'main' explicitly marks main documents. Selection distinguishes the viewed user’s main document from shared main documents.
  • Quiz answers belong to their quiz and use the question ID as uniqOnParent; file contents use 'file'. Repeated creation reuses the existing document without overwriting its data.
  • Constraints can be updated or cleared on existing documents.
  • Missing quiz answers initialize when write access becomes available. Dummy quiz answers are visibly marked as unsaved.

OfflineApi supports the same constraints and uniqueness-error behavior, with database indexes, legacy migrations, and atomic imports.

Make sure to merge this changes only in combination with the api changes GBSL-Informatik/teaching-api#66

@lebalz
lebalz requested a review from a team October 9, 2026 11:08
@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@netlify

netlify Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for teaching-dev ready!

Name Link
🔨 Latest commit f48096b
🔍 Latest deploy log https://app.netlify.com/projects/teaching-dev/deploys/6acba4e9d3655400084b4efa
😎 Deploy Preview https://deploy-preview-328--teaching-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@lebalz
lebalz merged commit 0f897e6 into main Oct 11, 2026
5 checks passed
@lebalz
lebalz deleted the chore/unique-docs branch October 11, 2026 15:32
bh0fer pushed a commit to GBSL-Informatik/ef-2028 that referenced this pull request Oct 11, 2026
bh0fer pushed a commit to lebalz/teaching-inf that referenced this pull request Oct 11, 2026
lebalz added a commit to GBSL-Informatik/inf-trb that referenced this pull request Oct 11, 2026
lebalz added a commit to GBSL-Informatik/inf-gls that referenced this pull request Oct 11, 2026
lebalz added a commit to GBSL-Informatik/inf-shu that referenced this pull request Oct 11, 2026
lebalz added a commit to GBSL-Informatik/inf-metz-26 that referenced this pull request Oct 11, 2026
bh0fer pushed a commit to GBSL-Informatik/ict that referenced this pull request Oct 11, 2026
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.

1 participant