From 9ce1e4c6a4074dd827fc023dcf57795029d011eb Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Thu, 29 Nov 2018 11:07:22 +0100 Subject: [PATCH] Add a default value for source in Report model --- scripts/migrations/0.4.py | 2 +- server/models.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/migrations/0.4.py b/scripts/migrations/0.4.py index 2902e03..3ea317d 100644 --- a/scripts/migrations/0.4.py +++ b/scripts/migrations/0.4.py @@ -29,7 +29,7 @@ def run_migration(): migrate( migrator.add_column( 'report', 'source', - peewee.CharField(max_length=255) + peewee.CharField(max_length=255, default='') ), migrator.add_column( 'report', 'shape_geojson', diff --git a/server/models.py b/server/models.py index d6386b8..6d6b10c 100644 --- a/server/models.py +++ b/server/models.py @@ -50,7 +50,7 @@ class Report(BaseModel): expiration_datetime = peewee.DateTimeField(null=True) upvotes = peewee.IntegerField(default=0) downvotes = peewee.IntegerField(default=0) - source = peewee.CharField(max_length=255) + source = peewee.CharField(max_length=255, default='') shape_geojson = peewee.TextField(default=None, null=True) def to_json(self):