← Back to team overview

maas-devel team mailing list archive

Re: HALP Migrations backporting

 

On 15/08/14 10:30, Gavin Panella wrote:
> On 15 August 2014 01:23, Julian Edwards <julian.edwards@xxxxxxxxxxxxx> wrote:
>> Dear all
>>
>> I need to backport a data migration 0099 to 1.6 from trunk, however 1.6
>> is currently only on 0088.  All of these would need to get backported as
>> well:
>>
>> 0089_create_nodegroupinterface_name.py
>> 0090_initialise_nodegroupinterface_name.py
>> 0091_add_boot_type_to_node.py
>> 0092_populate_node_boot_type.py
>> 0093_add_eventtype_and_event.py
>> 0094_add_error_description.py
>> 0095_add_event_description.py
>> 0096_add_power_state_to_node.py
>> 0097_add_largefile_model.py
>> 0098_add_bootresource_models.py
>>
>> However, a quick look at these shows that 0090 needs a code change
>> that's not in 1.6 (make_name_from_interface) so I can't just backport
>> these en-masse.
> 
> Do you really need all of those? The only change the migration makes is:
> 
>         interfaces = orm['maasserver.NodeGroupInterface'].objects.all()
>         for interface in interfaces:
>             create_Network_from_NodeGroupInterface(interface)
> 
> Try creating a new data migration then plonking this code in, and see
> what happens.

You can't do that I thought.  All migrations depend on the previous one,
it's how South works.  (hence all the junk below the actual migration
code you write)

Although having said that, if I make a new one, it might just work
provided the sequence numbers can overlap, as the actual migration is
idempotent.

> 
>>
>> Does anyone know if we can just backport the single data migration
>> without South breaking?
>>
>> Failing that, I will have to do something in the packaging to do this
>> migration manually :(
>>
>> Thanks
>> J



Follow ups

References