launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #10380
[Merge] lp:~jtv/maas/nodegroup-name-is-natural-key into lp:maas
The proposal to merge lp:~jtv/maas/nodegroup-name-is-natural-key into lp:maas has been updated.
Description changed to:
This is as discussed with Raphaël. Well okay, he pointed the whole thing out to me when we were discussing the wider problem of making Node.nodegroup NOT NULL. While Django wants to have an “id” column as a surrogate key for any model table in the database, it does have a facility for other keys in the data as well. It calls this natural keys.
In this branch I make NodeGroup.name a natural key so that the dev fixture will be able to define nodes with “nodegroup: [master],” rather than having to refer to the master nodegroup by id. We'll need some kind of reference once we slap the NOT NULL constraint onto Node.nodegroup: we wouldn't be able to load the dev sample data otherwise!
The reference by natural key works just fine when the master nodegroup exists, except right now we don't ensure creation of the master nodegroup yet. That's coming in a separate branch.
(The master nodegroup will not be in a fixture, because it requires dynamically-generated data. But we'll make sure that it's been created by the time the fixture gets loaded, using a database migration.)
Jeroen
For more details, see:
https://code.launchpad.net/~jtv/maas/nodegroup-name-is-natural-key/+merge/117244
--
https://code.launchpad.net/~jtv/maas/nodegroup-name-is-natural-key/+merge/117244
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~jtv/maas/nodegroup-name-is-natural-key into lp:maas.
References