# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2018-01-18 09:36
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='Guard',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, default='', max_length=40)),
                ('phone', models.CharField(blank=True, default='', max_length=40)),
                ('uniform_id', models.CharField(blank=True, default='', max_length=40)),
            ],
            options={
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='Plan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=40)),
                ('remark', models.CharField(blank=True, max_length=40)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('mode', models.IntegerField(choices=[(0, 'everyday'), (1, 'single'), (2, 'double')], default=0)),
                ('start_time', models.TimeField()),
                ('end_time', models.TimeField()),
                ('intervals', models.IntegerField(default=30, verbose_name='每次巡检之间的时间间隔（分钟）')),
                ('rounds', models.IntegerField(default=1, verbose_name='巡逻轮次')),
                ('executive_group', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='indoor_patrol.Guard')),
            ],
            options={
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='Record',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.IntegerField(choices=[(0, 'patrol record'), (1, 'warning msg')], default=0)),
                ('dvice_id', models.IntegerField(max_length=10)),
                ('spot', models.CharField(max_length=10)),
                ('time', models.DateTimeField()),
                ('events', models.CharField(max_length=20)),
            ],
            options={
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='Route',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=40, unique=True)),
                ('spots', models.CharField(blank=True, max_length=800)),
            ],
            options={
                'verbose_name': 'indoor_patrol_route',
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='Terminal',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, max_length=40)),
                ('serial_number', models.IntegerField(max_length=10, unique=True)),
                ('type', models.CharField(blank=True, max_length=40, null=True)),
            ],
            options={
                'ordering': ['id'],
            },
        ),
        migrations.AddField(
            model_name='plan',
            name='route',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='indoor_patrol.Route'),
        ),
        migrations.AddField(
            model_name='guard',
            name='terminal',
            field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='guard', to='indoor_patrol.Terminal'),
        ),
    ]
