SQLite NOT NULL failed 🗃️ SQL

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

  1. Provide the value or a default
  2. Make the column nullable if appropriate

Detailed fix by platform

SQL

  1. ALTER TABLE users ADD COLUMN status TEXT NOT NULL DEFAULT 'active';

How to diagnose

  1. Column — Which one?
  2. 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.