Make nullable boolean flag columns NOT NULL
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
Nullable boolean flags create a third state that silently drops rows from 'is True' / 'is False' comparisons. Convert them to NOT NULL with explicit server defaults.
Target columns:
- keypairs.is_active (no default — needs backfill and a new default), keypairs.is_admin
- users.need_password_change (no default), users.totp_activated
- groups.is_active, scaling_groups.is_active, session_templates.is_active (Python-side default only)
- container_registries.ssl_verify, container_registries.is_global
- error_logs.is_read, error_logs.is_cleared
- endpoints.open_to_public
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-7217
Contributor guide
Research direction
Locate the ORM model definitions and Alembic migration entry points for the listed columns; first inspect their current nullability, defaults, and existing NULL data handling. Backfill every existing NULL, enforce NOT NULL with explicit server defaults, and update the ORM type annotations. Done means all listed columns are non-nullable and the migration applies successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- database
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100