# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2018-01-25 07:07
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    # dependencies = [
    #     ('datalive_cust_veh', '0056_auto_20180125_0707'),
    # ]

    operations = [
        migrations.CreateModel(
            name='Geofence',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('creation_datetime', models.DateTimeField(auto_now_add=True)),
                ('name', models.CharField(db_index=True, max_length=200)),
                ('type', models.CharField(choices=[('circle', 'Circle Geofence'), ('rectangle', 'Rectangle Geofence'), ('polygon', 'Polygon Geofence')], default='circle', max_length=10)),
                ('coordinates', django_mysql.models.JSONField(default=dict)),
                ('archived', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='GeofenceBoundingBox',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('min_long', models.DecimalField(decimal_places=2, max_digits=6)),
                ('min_lat', models.DecimalField(decimal_places=2, max_digits=6)),
                ('max_long', models.DecimalField(decimal_places=2, max_digits=6)),
                ('max_lat', models.DecimalField(decimal_places=2, max_digits=6)),
            ],
        ),
        migrations.CreateModel(
            name='GeofenceCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category_name', models.CharField(max_length=200)),
                ('category_colour', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='GeofenceGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=200)),
                ('archived', models.BooleanField(default=False)),
                ('geofences', models.ManyToManyField(to='datalive_cust_veh.Vehicle')),
                ('notifications_emails', models.ManyToManyField(blank=True, to='datalive_cust_veh.NotificationEmail')),
            ],
        ),
        migrations.AddField(
            model_name='geofence',
            name='bbox',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='datalive_geofence.GeofenceBoundingBox'),
        ),
        migrations.AddField(
            model_name='geofence',
            name='category',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='datalive_geofence.GeofenceCategory'),
        ),
    ]
