~allenap/maas/rpc-use-os-stuff-for-forms

Viewing all changes in revision 2594.

  • Committer: MaaS Lander
  • Author(s): Jeroen Vermeulen
  • Date: 2014-07-24 12:55:32 UTC
  • mfrom: (2592.2.2 bug-1347579)
  • Revision ID: maas_lander-20140724125532-25pjcht0p3n5mw13
[r=julian-edwards][bug=1347579][author=jtv] Fix crashes in maasserver migration 0091, which adds and populates Node.boot_type: (1) attempt to adapt type ‘dict’ (apparently because the ORM isn't aware of the field yet when the migration tries to populate it); (2) updating a column that's being added in the same transaction, which the database won't accept; and (3) passing the wrong type in the reverse migration.  Also, update the nodes in bulk, so we don't query the Tag table for every individual node.

This still uses Tag.node_set, which looks as if it may access the model — normally a no-no in migrations.  But that property is implicitly generated, so hopefully it's not dependent on details of the model that might change in the future.  As far as I can see, this is the only way to access a ManyToManyField in the South ORM.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: