Add a default value for source in Report model

This commit is contained in:
Lucas Verney 2018-11-29 11:07:22 +01:00
parent 947039658b
commit 9ce1e4c6a4
2 changed files with 2 additions and 2 deletions

View File

@ -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',

View File

@ -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):