Changes between Version 5 and Version 6 of Ticket #31416, comment 18


Ignore:
Timestamp:
Apr 18, 2020, 8:53:26 PM (4 years ago)
Author:
Nan Liu

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31416, comment 18

    v5 v6  
    1414Hi Adam,
    1515
    16 So, my code should be correct by using `self.get_changes([Readable], [Readable with no fields, Book, Magazine])` (I will use predefined model states later!). but my code meant to fix this issue wasn't executed when I use `self.get_changes` while doing two separate migrations will execute my added code correctly, which is confusing. Also I suspect that the first migration will construct a `loader.graph` that will reorder the action operations.
     16So, my code should be correct by using `self.get_changes([Readable], [Readable with no fields, Book])` (I will use predefined model states later!). but my code meant to fix this issue wasn't executed when I use `self.get_changes` while doing two separate migrations will execute my added code correctly, which is confusing. Also I suspect that the first migration will construct a `loader.graph` that will reorder the action operations.
    1717
    18 Sorry about the confusion! So basically using `self.get_changes([Readable], [Readable with no fields, Book, Magazine])` doesn't give me the action operations with the correct order. When I do the first migration for only `Readable` class, and then the second migration for `Readable` with no fields, `Book` and `Magazine` on local machine, it gives me the correct order. So i don't think simply doing `self.get_changes` will do the same thing as my mentioned two-step migrations testing. So I just can't find out what is the causation...
     18Sorry about the confusion! So basically using `self.get_changes([Readable], [Readable with no fields, Book])` doesn't give me the action operations with the correct order. When I do the first migration for only `Readable` class, and then the second migration for `Readable` with no fields, `Book` and `Magazine` on local machine, it gives me the correct order. So i don't think simply doing `self.get_changes` will do the same thing as my mentioned two-step migrations testing. So I just can't find out what is the causation...
     19
     20Here is the error message I have:
     21
     22
     23{{{
     24  app:
     25    auto_1
     26      <CreateModel  name='Book', fields=[('title', <django.db.models.fields.CharField>), ('name', <django.db.models.fields.CharField>)], options={}, bases=('app.Readable',), managers=[]>
     27      <RemoveField  model_name='readable', name='name'>
     28      <RemoveField  model_name='readable', name='title'>
     29}}}
     30
Back to Top