# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2016-08-16 06:37
from __future__ import unicode_literals

from django.db import migrations


def forwards(apps, schema_editor):
    Invoice = apps.get_model('pretixbase', 'Invoice')
    for invoice in Invoice.objects.all():
        invoice.invoice_no_charfield = '{:05d}'.format(invoice.invoice_no)
        invoice.save()


class Migration(migrations.Migration):

    dependencies = [
        ('pretixbase', '0028_invoice_invoice_no_charfield'),
    ]

    operations = [
        migrations.RunPython(forwards, migrations.RunPython.noop),
    ]
