# Generated by Django 3.1.1 on 2020-09-07 19:57

from django.db import migrations
from status.models import Status


def load_data(apps, schema_editor):
    status_add = Status.objects.create(status_id=1, status='activo')
    status_add.save()
    status_add = Status.objects.create(status_id=2, status='inactivo')
    status_add.save()
    status_add = Status.objects.create(status_id=3, status='eliminado')
    status_add.save()
    status_add = Status.objects.create(status_id=4, status='anulado')
    status_add.save()
    # cajas
    status_add = Status.objects.create(status_id=5, status='apertura')
    status_add.save()
    status_add = Status.objects.create(status_id=6, status='apertura_recibe')
    status_add.save()
    status_add = Status.objects.create(status_id=7, status='cierre')
    status_add.save()
    status_add = Status.objects.create(status_id=8, status='cierre_recibe')
    status_add.save()
    status_add = Status.objects.create(status_id=9, status='no_aperturado')
    status_add.save()
    # movimientos de caja
    status_add = Status.objects.create(status_id=10, status='movimiento_caja')
    status_add.save()
    status_add = Status.objects.create(status_id=11, status='movimiento_caja_recibe')
    status_add.save()
    # cobranza
    status_add = Status.objects.create(status_id=12, status='cobrado')
    status_add.save()
    status_add = Status.objects.create(status_id=13, status='pasivo')
    status_add.save()


def delete_data(apps, schema_editor):
    status = apps.get_model('status', 'Status')
    status.objects.all().delete


class Migration(migrations.Migration):

    dependencies = [
        ('status', '0001_initial'),
    ]

    operations = [
        migrations.RunPython(load_data, delete_data),
    ]
