Ticket #700 (closed defect: fixed)
All NOT NULL constraints dropped for a table during migration (sqlite)
|Reported by:||kenj@…||Owned by:||andrew|
I have a model that contains a field that was created with null=False. I later decided it needed to be null=True.
During the migration from one version 0001 to 0002, all of the NOT NULL constraints on all columns are dropped instead of just the single NOT NULL constraint that was supposed to be dropped. This is with a sqlite backend.
In the 0002 migration py file, the following alter command is the culprit
db.alter_column('commands', 'uuid', self.gf('django.db.models.fields.CharField?')(max_length=64, unique=True, null=True))
The DB is still usable but I much appreciate the safety of having backend constraint guarantees. I've already introduced one bug into the system which would have otherwise been caught by these missing NOT NULL constraints.