sqlite3.IntegrityError: NOT NULL constraint failed: table.column
A NULL went into a NOT NULL column in SQLite.
Seen on:
SQL
Meaning
Often an ORM model field not set, or a new NOT NULL column without a default in a Django/Rails migration.
Common causes
- Required field missing
- Migration added NOT NULL without default
- Explicit None/null
⚡ Quick fix
- Provide the value or a default
- Make the column nullable if appropriate
Detailed fix by platform
SQL
ALTER TABLE users ADD COLUMN status TEXT NOT NULL DEFAULT 'active';
How to diagnose
- Column — Which one?
- Input — Why null?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026