Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

rorm: composite unique constraints

Open
#186 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
rust, sql
Domain
database

Research direction

Read the rorm model and migration documentation, then inspect services/mtg/src/models/deck/db.rs, the root Cargo.toml, and services/mtg/src/tests/collaborators.rs. First determine how rorm represents model constraints and generated migrations; the issue also depends on a rorm release that supports composite uniqueness. Done means generated migrations enforce unique (deck, account), the collaborator tests pass, and the uuid v3 feature is removed if unused.

Written by the indexing model from the issue text.

Description

needs-triage

rorm has no way to declare a unique constraint over more than one field, and adding one through RawSQL in a migration trips the warning in check-migrations.yaml.

Workaround in use: deck Collaborators (#155) derive their primary key from the pair, collaborator_key(deck, account) = Uuid::new_v3(&deck, account.as_bytes()) in services/mtg/src/models/deck/db.rs, so naming an Account twice on a deck collides on the primary key. This enabled uuid's v3 feature, which pulls md-5 0.10.6 into Cargo.lock next to the existing md-5 0.11.0.

What to build

  • In rorm: a composite unique constraint on a model (e.g. a model-level attribute naming the fields), carried through the migration generator.
  • Here, once a rorm release has it: give DeckCollaboratorModel a unique (deck, account) constraint, switch its primary key back to a random uuid (or keep the derived one, decide then), and drop the v3 feature from the root Cargo.toml if nothing else uses it.

Acceptance criteria

  • rorm supports composite unique constraints, including generated migrations
  • DeckCollaboratorModel uses one; uniqueness per deck and Account is unchanged (tests in services/mtg/src/tests/collaborators.rs stay green)
  • uuid v3 feature removed if unused
Dominant language
TypeScript
Stars
0
Forks
1
Avg merge
10h 20m
Merged PRs (30d)
36

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from myOmikron/code

All issues in myOmikron/code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.