First migrate without the foreign key to create the tables, then add the
foreign key in a second migration.
Also removed unneeded imports that caused dependency cycles.
Minor "style" edits with the ambiguous use of super and unnecessary
db.Model inheritance.
The groups-privileges page takes care of removing privileges
before deleting groups and users; this is to be moved soon to a
proper group/user deletion API.