lablup / lablup/backend.ai

Make semantically required nullable DB columns NOT NULL

Open
#13,505 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
15h 13m
Merged PRs (30d)
368

Description

Several DB columns are semantically required but are declared nullable in the current schema (e.g. users.created_at, users.modified_at). This epic tracks auditing the schema for such columns and migrating them to NOT NULL.

Scope:

- Audit all tables for columns that must always have a value but are declared nullable (audit timestamps such as created_at / modified_at are the primary examples).
- For each column: clean up or backfill existing NULL rows, add a server-side default where appropriate, and add an Alembic migration setting NOT NULL.
- Update the corresponding ORM models and type annotations.

Child issues will be created per table/column group.

JIRA Issue: BA-7215

Contributor guide

Open the contributing guide

Research direction

Start by auditing the schema, ORM models, and Alembic migrations for semantically required nullable columns, beginning with users.created_at and users.modified_at. Check for existing NULL rows and determine appropriate server-side defaults. Done means affected rows are handled, models and type annotations are updated, and each column has a migration enforcing NOT NULL.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, sql
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.