I do not know what Django is trying to say. I have a model, However, when I try to migrate my database using I tried to declare In addition to this, the South is now saying that I have a Be aware before going forward, make sure that if the South has already migrated It has been unsuccessful, it is better to redo it, was working on the last You have two options, you can do first. In other ways, you can Then the south can generate migration by you If everything is okay now, You can now get back and and However, when your field will be detected in the South I think that if you do not work on the other side, then you have to go with data migrations , or give it a shot and for the second time this time it is But keep in mind that data migration will definitely be smart and standard here The way. week two , which is received from Week , which comes from the model model I have another model , UserProfile . I want to use WeekTwo as a OneToOne key in UserProfile , so I inserted the following line of code:
weekTwo = models .OneToOneField (Week Two) python manage.py schemamigration my_app --auto I get the following error:
There is no default specified in the field 'UserProfile.weekTwo', yet it is not zero. default = 0 as my week two , but now I am getting this error when I go to schema migration I try to:
IntegrityAir: Column succession two_ID is not unique The interim state between the migration and I might be able to recover I do not really know that its Or means. migration . week two field null and empty before
Python manage.py schemamigration my_app --auto < P> I'm sure the South will not complain about it now, then
Manage Python \ migrate week2 field
weekTwo = models.OneToOne Fields can change ( generate migration then migrate . NULL and does not have the default value, but the schemamigration From the step you would suggest providing a value for it, then here is the field OneToOneField , because the south gives you the chance to provide a default VA again to record its existence on the model weeks Specification of two fields will increase an error. Instead of creating null , blank , try changing the entire field type. Try it with;
weekTwo = models.ForeignKey (WeekTwo)
No comments:
Post a Comment