Code review comment for ~mpontillo/maas:default-domain-selection

Revision history for this message
Mike Pontillo (mpontillo) wrote :

We discussed this at standup (well, mainly Blake and myself) and agreed on this option for a few reasons:

(1) We didn't like how changing one row in the domain table would require changing multiple rows (to set the default) to ensure referential integrity. We don't have a good existing pattern to do this with maas-obj-form or similar, so there's little benefit in adding an extraneous (and somewhat strangely modeled) row to the domain table.

(2) We wanted "can't delete the default record" to be able to be enforced by database constraints. The foreign key approach is a natural way to do this, and a clean way to model it.

(3) In the future we think it would be useful if different "groups" in MAAS (such as tenants - if we ever do multitenancy, or multitenancy "light", LDAP groups, etc) can specify their own default domain (or other default objects). Modeling global defaults in their own table allows us to, in the future, specify different defaults for different situations.

« Back to merge proposal