8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 15:33:45 +00:00
re2o/cotisations/migrations/0048_auto_20201017_0018.py

27 lines
1,003 B
Python
Raw Normal View History

# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-10-16 22:18
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cotisations', '0047_article_need_membership_init'),
]
def set_value_to_zero(apps, schema_editor):
db_alias = schema_editor.connection.alias
Vente = apps.get_model("cotisations", "Vente")
Vente.objects.using(db_alias).filter(duration_connection__isnull=True).update(duration_connection=0)
Vente.objects.using(db_alias).filter(duration_days_connection__isnull=True).update(duration_days_connection=0)
Vente.objects.using(db_alias).filter(duration_membership__isnull=True).update(duration_membership=0)
Vente.objects.using(db_alias).filter(duration_days_membership__isnull=True).update(duration_days_membership=0)
operations = [
migrations.RunPython(set_value_to_zero),
]