Add a default value for source in Report model
This commit is contained in:
parent
947039658b
commit
9ce1e4c6a4
@ -29,7 +29,7 @@ def run_migration():
|
|||||||
migrate(
|
migrate(
|
||||||
migrator.add_column(
|
migrator.add_column(
|
||||||
'report', 'source',
|
'report', 'source',
|
||||||
peewee.CharField(max_length=255)
|
peewee.CharField(max_length=255, default='')
|
||||||
),
|
),
|
||||||
migrator.add_column(
|
migrator.add_column(
|
||||||
'report', 'shape_geojson',
|
'report', 'shape_geojson',
|
||||||
|
@ -50,7 +50,7 @@ class Report(BaseModel):
|
|||||||
expiration_datetime = peewee.DateTimeField(null=True)
|
expiration_datetime = peewee.DateTimeField(null=True)
|
||||||
upvotes = peewee.IntegerField(default=0)
|
upvotes = peewee.IntegerField(default=0)
|
||||||
downvotes = 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)
|
shape_geojson = peewee.TextField(default=None, null=True)
|
||||||
|
|
||||||
def to_json(self):
|
def to_json(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user