<gh_stars>0
# -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-10-12 20:26
from __future__ import unicode_literals

from django.db import migrations, models
import django.db.models.deletion


def add_first_zone(apps, schema_editor):
    # version than this migration expects. We use the historical version.
    Zone = apps.get_model("jobs", "Zone")
    zone = Zone(name='Central')
    zone.save()

class Migration(migrations.Migration):
    dependencies = [
        ('jobs', '0005_auto_20161012_1613'),
    ]

    operations = [
        migrations.CreateModel(
            name='Zone',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False,
                                        verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name=b'Nombre de Zona')),
            ],
            options={
                'ordering': ['id'],
                'verbose_name': 'Zona',
                'verbose_name_plural': 'Zonas',
                'permissions': (('show_zone', 'Can Details Zone'), ('index_zone', 'Can List Zone')),
            },
        ),
        migrations.RunPython(add_first_zone),
        migrations.AddField(
            model_name='job',
            name='zone',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='jobs.Zone',
                                    verbose_name=b'Zona'),
        ),
    ]
