Migrate-Problem with models.DurationField()

Ok, so the root cause was you adding a default value of 0 when asked for a default value for the migration:

default = 0 isn’t valid here.

Since this migration did not apply, you’ve got at least two options:

  • Delete these two migrations (0002 and 0003) and recreate them. (Since you’ve added the default to the field definition, you shouldn’t be asked that question again.)

  • Edit 0002 and replace the default with the default from 0003.

2 Likes