It is impossible to add a non-nullable field 'name' to table without specifying a default
class Track(gisModels.Model):
track = gisModels.PolygonField()
class GeoFence(gisModels.Model):
track = models.ForeignKey(Track, on_delete=models.CASCADE)
fence = gisModels.PolygonField(geography=True)
The above code is my models.
It is impossible to add a non-nullable field 'track' to geofence without specifying a default. This is because the database needs something to populate existing rows.
Please select a fix:
1) Provide a one-off default now (will be set on all existing rows with a null value for this column)
2) Quit and manually define a default value in models.py.
Select an option:
I have no idea to solve it out.