You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had the same problem when running migrate on a sqlite3 db for a testing database.
The original migration file had the folowing definitions:
.......
('date_of_birth', birthday.fields.BirthdayField(verbose_name='Geboren op')),
....
('date_of_birth_dayofyear_internal', models.PositiveSmallIntegerField(default=None, editable=False, null=True)),
......
When BirthdayField is 'loaded' it creates the "_dayofyear_internal" column. Then the
'internal' definition is loaded. BirthdayField checks the existance of the 'internal' column, PositiveSmallInteger does not.
Place the 'internal'/PositiveSmallInteger definition above the BirthdayField.
That did it for me. (at least I could run migrate again)
(first use with Django 1.x, python 2.7. 'fixed' like above with django 2, python 3)
models:
from birthday.fields import BirthdayField
from birthday.managers import BirthdayManager
birthday = BirthdayField()
objects = BirthdayManager()
when run migrate get error
error msg:
django.db.utils.OperationalError: duplicate column name: birthday_dayofyear_internal
may i ask how fix this problem?
thanks for your time
The text was updated successfully, but these errors were encountered: