Verify and enforce NOT NULL on keypairs identity columns
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
keypairs.user_id, keypairs.secret_key, and keypairs.rate_limit are semantically required for every keypair but are declared nullable without defaults. Verify whether NULL rows exist in real deployments, decide the backfill strategy, then migrate to NOT NULL.
For each column: backfill existing NULL rows, ensure an appropriate default/server default, add an Alembic migration setting NOT NULL, and update the ORM model type annotations.
JIRA Issue: BA-7219
Contributor guide
Research direction
Start by locating the keypairs ORM model and reviewing existing Alembic migrations for these columns. Check whether NULL rows exist and determine suitable backfill values before adding the migration; done means existing rows are backfilled, defaults are appropriate, the columns are NOT NULL, and the ORM annotations reflect that.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100