Fix migration

- Ensure that defaults match between Event and migration script
- Deconflict migration script number (from rebase)

Issue: #2948
This commit is contained in:
Nick 2022-03-12 14:11:55 -05:00
parent 2f4169dbff
commit fd6db32b38
2 changed files with 2 additions and 4 deletions

View File

@ -19,7 +19,7 @@ class Event(Model):
box = JSONField() box = JSONField()
area = IntegerField() area = IntegerField()
retain_indefinitely = BooleanField(default=False) retain_indefinitely = BooleanField(default=False)
ratio = FloatField() ratio = FloatField(default=1.0)
class Recordings(Model): class Recordings(Model):

View File

@ -30,9 +30,7 @@ SQL = pw.SQL
def migrate(migrator, database, fake=False, **kwargs): def migrate(migrator, database, fake=False, **kwargs):
migrator.add_fields( migrator.add_fields(
Event, Event,
ratio=pw.FloatField( ratio=pw.FloatField(default=1.0), # Assume that existing detections are square
default=1.0
), # There is no way to get the true ratio from an existing recording, so simply assume they are square.
) )