forked from sr2/cloud-api
parent
82c2b13a7f
commit
33e78d4a9b
9 changed files with 37 additions and 50 deletions
|
|
@ -2,9 +2,16 @@
|
|||
Database models for organisation module
|
||||
|
||||
Models:
|
||||
- Organisation: id[pk], name, status, intake_questionnaire,
|
||||
billing_contact_id[fk], security_contact_id[fk], owner_contact_id[fk]
|
||||
- OrgUsers: org_id[fk][cpk], user_id[fk][cpk], is_admin
|
||||
- Organisation:
|
||||
- id[PK], name, status, intake_questionnaire, root_user_id[FK], billing_contact_id[FK], security_contact_id[FK], owner_contact_id[FK]
|
||||
- user_rel: ORM relationship to User via OrgUsers relationship table
|
||||
- group_rel: ORM relationship to Group, backprops Group.org_rel
|
||||
- root_user_rel: ORM relationship to User with root_user_id FK
|
||||
- root_user_email: Calc property root_user_rel.email
|
||||
- billing_contact_rel: ORM relationship to Contact with billing_contact FK
|
||||
- security_contact_rel: ORM relationship to Contact with security_contact FK
|
||||
- owner_contact_rel: ORM relationship to Contact with owner_contact FK
|
||||
- OrgUsers: org_id[FK][PK], user_id[FK][PK]
|
||||
"""
|
||||
from sqlalchemy import Column, Integer, String, ForeignKey, JSON
|
||||
from sqlalchemy.orm import relationship
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue