3

I already have model topic and have data in it, when I tried to use MPTTMODEL insted of the regular model

class Topic(MPTTModel):
    parent = TreeForeignKey('self', null=True, blank=True, related_name='children')
    ....

so I run the following command to migrate the parent column in the topic table

./manage.py evolve --hint --execute

but I get this error

Error: Cannot use hinted evolution: AddField or ChangeField mutation for 'Topic.rght' in 'core' requires user-specified initial value.

it works fine with new model, but with existing Model that has data it raise this error

Kareem Hashem
  • 1,057
  • 1
  • 9
  • 25
  • I know it's not much help but I had this issue before and you basically need to generate the tree based on the existing foreignkey link that should exist on the table. – whoisearth Nov 17 '15 at 01:56

0 Answers0