Add region count to database and use for motion activity (#10480)

* Add region count to database and use for motion activity

* Fix test
This commit is contained in:
Nicolas Mowen
2024-03-15 09:29:22 -06:00
committed by GitHub
parent c93b186eda
commit 93260f6cfd
6 changed files with 75 additions and 10 deletions

View File

@@ -34,6 +34,9 @@ def migrate(migrator, database, fake=False, **kwargs):
objects=pw.IntegerField(null=True),
motion=pw.IntegerField(null=True),
)
migrator.sql(
'CREATE INDEX "recordings_activity" ON "recordings" ("camera", "start_time" DESC, "regions")'
)
def rollback(migrator, database, fake=False, **kwargs):