bennylope / django-organizations

:couple: Multi-user accounts for Django projects
http://django-organizations.readthedocs.org/
BSD 2-Clause "Simplified" License
1.31k stars 212 forks source link

Necessity of OrganizationOwner? #226

Closed dwasyl closed 2 years ago

dwasyl commented 2 years ago

Hi all,

Just had a question for regular maintainers/users of django-organization regarding OrganizationOwners. If the relationship is onl ya single owner per Organization, is it necessary to have a separate object for the owner relationship? Would an owner field (as a FK to a OrganizationUser) on Organization not accomplish roughly the same thing?

Just getting my head around the structure so appreciate any thoughts!

Cheers

bennylope commented 2 years ago

One motivator for using a separate model is that this is a separate relationship to model and not just an "attribute" of the organization.

A more urgent reason, if memory serves correctly, is the cyclic relationship in the database between the organization and organization users table. This does work! But I think Django's migrations didn't handle this before (???).