-
-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #278 - Refactor Database #281
Conversation
First step of the refactor is to separate the Officer table from the version that is a child of the incident table. We'll set up a standalone officer and agency table where we'll store records related to known officers and law enforcement agencies. The old officer table, now called Suspects will store information about those officers suspected of committing a crime against the public. The suspect table will be connected to officers via the accusation table.
- Remove source from other models - Remove SourceMixin
Tags and Agencies linked to Incidents Suspects and Agencies linked to officers Style changes.
db.Column('earliest_employment', db.Text), | ||
db.Column('latest_employment', db.Text), | ||
db.Column('badge_number', db.Text), | ||
db.Column('unit', db.Text), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thinking about this - should units be a separate table which relates to an agency? This would help ensure that the unit names would be consistent across relationships which would make identifying problematic units more consistent.
- Updated Snapshots - Update models
id = db.Column(db.Integer, primary_key=True) # officer id | ||
incident_id = db.Column(db.Integer, db.ForeignKey("incident.id")) | ||
first_name = db.Column(db.Text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like first_name
, last_name
, race
, ethnicity
, gender
, and date_of_birth
could be pulled into a table called individual
which officer
and victim
can both reference. This would allow for mapping of situations where an officer later became a victim.
perpetrator
probably shouldn't have a reference to the individual
table since it's providing information that would be used to identify suspected officers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we need that. The goal of the victim table is just to get demographic data, not to identify the victim as an individual. I want to avoid having any sort of database of victims identities.
Gonna wave this through with the front end fails. The visualization snapshot is a little flakey and it looks like prettier needs an update. |
Makes a number of adjustments to the Index database in order to bring it into alignment with the NPDC Incident Model.
Some things that are not part of this PR that need to be taken care of:
DB Seeds update will be a fast follow.