Add contacts, rework comms schema
This in a pretty huge change. At a high level we're adding the concept of a 'contact' which is a person or organization that has zero or more contact methods (email, phone). This ended up cascading a number of changes, including critically to the publicreprt schema. In the end it seemed safer to get to the point where I'm confident we aren't using any of the old fields for storing reporter information (though I haven't deleted the columns yet) so I removed the code for defining those columns. At this point I think it's not possible for me to regenerate the bob schema due to the interdependencies between my various schemas, so the migration is well-and-truly happening.
This commit is contained in:
parent
085935fa66
commit
f1fe8b4d2b
46 changed files with 1127 additions and 633 deletions
|
|
@ -10,7 +10,7 @@ type Contact struct {
|
|||
Email *string `db:"email" json:"email"`
|
||||
HasEmail bool `json:"has_email"`
|
||||
HasPhone bool `json:"has_phone"`
|
||||
Name *string `db:"name" json:"name"`
|
||||
Name string `db:"name" json:"name"`
|
||||
Phone *string `db:"phone" json:"phone"`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ func SiteFromModel(s *models.Site) Site {
|
|||
Notes: s.Notes,
|
||||
OrganizationID: s.OrganizationID,
|
||||
Owner: Contact{
|
||||
Name: &s.OwnerName,
|
||||
Name: s.OwnerName,
|
||||
Phone: &owner_phone,
|
||||
},
|
||||
ResidentOwned: resident_owned,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue