Commit 5ca6a6b3 authored by Romain Courteaud's avatar Romain Courteaud

fix db migration

parent 25f6d7d5
......@@ -115,7 +115,7 @@ class LogDB:
ip = peewee.TextField()
url = peewee.TextField()
status_code = peewee.IntegerField()
total_seconds = peewee.FloatField()
total_seconds = peewee.FloatField(default=0)
class Meta:
primary_key = peewee.CompositeKey("status", "ip", "url")
......@@ -156,7 +156,11 @@ class LogDB:
# version 2 without the http total_seconds column
migrator = SqliteMigrator(self._db)
migrate(
migrator.add_column("HttpCodeChange", "total_seconds")
migrator.add_column(
"HttpCodeChange",
"total_seconds",
self.HttpCodeChange.total_seconds,
)
)
if db_version >= expected_version:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment