SQLite bug?

I have a simple table in a sqlite database called Unit with three fields: id, name and description.

When I try to execute any writable operation within the classess generated by the CRUD option in shell - like UPDATE or INSERT (DELETE works like a charm) - it gives me an internal server error with message:


SQL: SQLSTATE[23000]: Integrity constraint violation: 19 unit.name may not be NULL

sql log from profiler:

system.db.CDbCommand.execute(INSERT INTO 'unit' ("id") VALUES (NULL))

system.db.CDbCommand.query(PRAGMA table_info('unit'))

system.db.CDbCommand.query(PRAGMA foreign_key_list('unit'))

You probably try to insert a null value in a column that doesn’t accept null.


This tries to insert a row with null name and null description

No, I didn’t do anything. Just used webapp’s create form:

	public function actionCreate()


		$model=new Unit;









Check if the attributes you use in the form are in the safe attributes in the model class

my bad :blink:

that did the trick, thank you so much