So, in a bit more detail I have a model with a field like: permalink = models.IntegerField(default=0)
I've not actually been using this field - but would now like to.
However, it seems all models on this table, permalink
is now 57295730
- on all 2000 models!
In an attempt to debug, I tried completly wiping the DB, running migrate
(~100 migrations) - but then creating a instance of the model, I am told permalink violates the not-null constraint
though I am definitely passing it a value! I also get a list of the values I am passing it, but am not sure how to know which value/column relates to which field?
I've even tried removing DB, removing migrations, running a new makemigrations
- and still get the null violation...
even stranger, it looks like this field has not been touched since the initial migration!
migrations$ egrep permalink *
0001_initial.py: ('permalink', models.IntegerField(default=0)),
migrations$
I'm running (k)ubuntu 14.04
, postgres 9.3
, python 3.4
, django 1.9.4
Though I'd love to know how to fix this - my question is really "What can I do to debug this kind of situation?"