set color='' to color=None
This commit is contained in:
parent
d80c17c842
commit
5d3453abe5
1 changed files with 22 additions and 0 deletions
22
src/c3nav/mapdata/migrations/0015_auto_20170706_1334.py
Normal file
22
src/c3nav/mapdata/migrations/0015_auto_20170706_1334.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.2 on 2017-07-06 11:34
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def set_blank_to_null(apps, schema_editor):
|
||||
for model_name in ('Area', 'Point', 'Level', 'Space', 'LocationGroup'):
|
||||
model = apps.get_model('mapdata', model_name)
|
||||
model.objects.filter(color='').update(color=None)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('mapdata', '0014_mapupdate'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(set_blank_to_null),
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue