# -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-30 18:12
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
                ('active', models.BooleanField(default=True)),
                ('deleted', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'countries',
                'verbose_name': 'Country',
                'verbose_name_plural': 'Countries',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('firstname', models.CharField(max_length=80)),
                ('lastname', models.CharField(max_length=80)),
                ('email', models.EmailField(max_length=254)),
                ('telephone', models.CharField(max_length=20)),
                ('fax', models.CharField(max_length=20)),
                ('mobile', models.CharField(max_length=20)),
                ('address1', models.CharField(max_length=80)),
                ('address2', models.CharField(max_length=80)),
                ('postal_code', models.CharField(max_length=12)),
                ('city', models.CharField(max_length=50)),
                ('region', models.CharField(max_length=50)),
                ('notes', models.TextField()),
                ('maxdebt', models.FloatField(default=0.0)),
                ('current_debt', models.FloatField(default=0.0)),
                ('image', models.BinaryField()),
                ('coutry', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='country', to='crm.Country')),
            ],
            options={
                'db_table': 'customers',
                'verbose_name': 'Customer',
                'verbose_name_plural': 'Customers',
            },
        ),
        migrations.CreateModel(
            name='LoyaltyCard',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.CharField(max_length=20, unique=True)),
                ('active', models.BooleanField(default=True)),
                ('issue_date', models.DateField()),
                ('valid_to', models.DateField()),
                ('deleted', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'db_table': 'loyalty_cards',
                'verbose_name': 'LoyaltyCard',
                'verbose_name_plural': 'LoyaltyCards',
            },
        ),
        migrations.AddField(
            model_name='customer',
            name='loyalty_card',
            field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='loyalty_card', to='crm.LoyaltyCard'),
        ),
    ]
