Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
New columns to track how location fields were populated, refs #650
Browse files Browse the repository at this point in the history
  • Loading branch information
simonw committed Jun 16, 2021
1 parent 676396e commit 2a9792f
Show file tree
Hide file tree
Showing 2 changed files with 124 additions and 0 deletions.
80 changes: 80 additions & 0 deletions vaccinate/core/migrations/0147_location_provenance_columns.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Generated by Django 3.2.4 on 2021-06-16 02:56

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("core", "0146_remove_ct_from_source_locations_issue_655"),
]

operations = [
migrations.AddField(
model_name="location",
name="appointments_walkins_last_updated_at",
field=models.DateTimeField(
blank=True,
help_text="When accepts_walkins and accepts_appointments were last updated",
null=True,
),
),
migrations.AddField(
model_name="location",
name="appointments_walkins_provenance_report",
field=models.ForeignKey(
blank=True,
help_text="The report that last populated accepts_walkins and accepts_appointments",
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="+",
to="core.report",
),
),
migrations.AddField(
model_name="location",
name="appointments_walkins_provenance_source_location",
field=models.ForeignKey(
blank=True,
help_text="The source location that last populated accepts_walkins and accepts_appointments",
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="+",
to="core.sourcelocation",
),
),
migrations.AddField(
model_name="location",
name="vaccines_offered_last_updated_at",
field=models.DateTimeField(
blank=True,
help_text="When vaccines_offered was last updated",
null=True,
),
),
migrations.AddField(
model_name="location",
name="vaccines_offered_provenance_report",
field=models.ForeignKey(
blank=True,
help_text="The report that last populated vaccines_offered",
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="+",
to="core.report",
),
),
migrations.AddField(
model_name="location",
name="vaccines_offered_provenance_source_location",
field=models.ForeignKey(
blank=True,
help_text="The source location that last populated vaccines_offered",
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="+",
to="core.sourcelocation",
),
),
]
44 changes: 44 additions & 0 deletions vaccinate/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,56 @@ class Location(gis_models.Model):
blank=True,
help_text="JSON array of strings representing vaccines on offer here - enter 'null' if we do not know",
)
vaccines_offered_provenance_report = models.ForeignKey(
"Report",
null=True,
blank=True,
related_name="+",
help_text="The report that last populated vaccines_offered",
on_delete=models.PROTECT,
)
vaccines_offered_provenance_source_location = models.ForeignKey(
"SourceLocation",
null=True,
blank=True,
related_name="+",
help_text="The source location that last populated vaccines_offered",
on_delete=models.PROTECT,
)
vaccines_offered_last_updated_at = models.DateTimeField(
help_text="When vaccines_offered was last updated",
blank=True,
null=True,
)

accepts_appointments = models.BooleanField(
null=True, blank=True, help_text="Does this location accept appointments"
)
accepts_walkins = models.BooleanField(
null=True, blank=True, help_text="Does this location accept walkins"
)
appointments_walkins_provenance_report = models.ForeignKey(
"Report",
null=True,
blank=True,
related_name="+",
help_text="The report that last populated accepts_walkins and accepts_appointments",
on_delete=models.PROTECT,
)
appointments_walkins_provenance_source_location = models.ForeignKey(
"SourceLocation",
null=True,
blank=True,
related_name="+",
help_text="The source location that last populated accepts_walkins and accepts_appointments",
on_delete=models.PROTECT,
)
appointments_walkins_last_updated_at = models.DateTimeField(
help_text="When accepts_walkins and accepts_appointments were last updated",
blank=True,
null=True,
)

public_notes = models.TextField(blank=True, null=True)

google_places_id = CharTextField(
Expand Down

0 comments on commit 2a9792f

Please sign in to comment.