2020-10-16 22:34:56 +00:00
|
|
|
# -*- 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'),
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2020-11-02 22:06:47 +00:00
|
|
|
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)
|
2020-10-16 22:34:56 +00:00
|
|
|
|
|
|
|
operations = [
|
2020-11-02 22:06:47 +00:00
|
|
|
migrations.RunPython(set_value_to_zero),
|
2020-10-16 22:34:56 +00:00
|
|
|
]
|