﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
2108	Empty models result in invalid SQL for Sqlite	andy@…	Malcolm Tredinnick	"A model with no fields, e.g.

  class EmptyModel(models.Model):
      pass

will cause an OperationalError to be raised when an instance is saved:

  m = EmptyModel()
  m.save()

if the database is sqlite3.
In this case the SQL executed is:

  INSERT INTO ""testapp_emptymodel"" () VALUES ()

It should instead be generating the following SQL:

  INSERT INTO ""testapp_emptymodel"" (id) VALUES (NULL)
"	defect	closed	Database layer (models, ORM)		normal	fixed	sqlite		Unreviewed	0	0	0	0	0	0
