From 3b440733acc249100bd1b7d5c2d22e9e66612732 Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Tue, 4 Apr 2017 15:23:40 +0200 Subject: [PATCH] db migration including color change for flying team --- .../0028_location_color_of_flying_team.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 smash/web/migrations/0028_location_color_of_flying_team.py diff --git a/smash/web/migrations/0028_location_color_of_flying_team.py b/smash/web/migrations/0028_location_color_of_flying_team.py new file mode 100644 index 00000000..45227206 --- /dev/null +++ b/smash/web/migrations/0028_location_color_of_flying_team.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.3 on 2017-04-04 09:43 +from __future__ import unicode_literals + +from django.db import migrations + + +def configuration_item_color_fields(apps, schema_editor): + # We can't import the Location model directly as it may be a newer + # version than this migration expects. We use the historical version. + Location = apps.get_model("web", "Location") + locations = Location.objects.filter(name="Flying Team") + for location in locations: + location.color = "#FF8000" + + +class Migration(migrations.Migration): + dependencies = [ + ('web', '0027_auto_20170404_1505'), + ] + + operations = [ + migrations.RunPython(configuration_item_color_fields), + ] -- GitLab