# Generated by Django 2.1.7 on 2019-05-30 18:02

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('maps', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='ManageImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('images_url', models.CharField(db_index=True, max_length=300, verbose_name='图片地址')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '城管图片管理',
                'verbose_name_plural': '城管图片管理',
            },
        ),
        migrations.CreateModel(
            name='NewWarn',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='设备名称')),
                ('event_id', models.CharField(default='', max_length=100, verbose_name='预警编号')),
                ('image_url', models.CharField(db_index=True, max_length=300, verbose_name='图片地址')),
                ('image_sign', models.CharField(default='', max_length=100, verbose_name='标注信息')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '首页预警数据',
                'verbose_name_plural': '首页预警数据',
                'ordering': ('-add_time',),
            },
        ),
        migrations.CreateModel(
            name='StreamId',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('stream_id', models.CharField(max_length=100, verbose_name='创建的视频流id')),
                ('resource_id', models.CharField(default='', max_length=100, verbose_name='设备视频流id')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '视频流id模型',
                'verbose_name_plural': '视频流id模型',
            },
        ),
        migrations.CreateModel(
            name='WarnImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(default='预警图片', max_length=50, verbose_name='图片名称')),
                ('image_url', models.CharField(db_index=True, max_length=300, verbose_name='图片地址')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '预警图片管理',
                'verbose_name_plural': '预警图片管理',
            },
        ),
        migrations.CreateModel(
            name='WarnManage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('process_id', models.CharField(default='', max_length=50, verbose_name='任务编号')),
                ('type_name', models.CharField(max_length=100, verbose_name='检测类型名')),
                ('desc', models.CharField(default='', max_length=100, verbose_name='描述')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
                ('map', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='maps.Map', verbose_name='所属设备')),
                ('stream', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='warnlist.StreamId', verbose_name='所属视频流id')),
            ],
            options={
                'verbose_name': '设备预警分析任务',
                'verbose_name_plural': '设备预警分析任务',
                'ordering': ['-add_time'],
            },
        ),
        migrations.CreateModel(
            name='WarnModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('event_id', models.CharField(default='', max_length=100, verbose_name='预警编号')),
                ('user', models.CharField(default='', max_length=50, verbose_name='平台处理人员')),
                ('manage_user', models.CharField(default='', max_length=50, verbose_name='城管处理人员')),
                ('warn_type', models.IntegerField(choices=[(1, '智能预警'), (2, '手动预警')], default=1, verbose_name='预警类型')),
                ('is_day', models.IntegerField(choices=[(0, '夜晚'), (1, '白天'), (2, '手动')], default=1, verbose_name='白天黑夜')),
                ('start_time', models.BigIntegerField(default=1, verbose_name='预警开始时间')),
                ('end_time', models.BigIntegerField(default=1, verbose_name='预警结束时间')),
                ('video_url', models.CharField(db_index=True, default='', max_length=300, verbose_name='违法视频')),
                ('warn_url', models.CharField(db_index=True, default='', max_length=300, verbose_name='标注图片')),
                ('image_sign', models.CharField(db_index=True, default='', max_length=50, verbose_name='标注参数')),
                ('is_make', models.IntegerField(choices=[(1, '待处理'), (2, '已发送'), (3, '已完成'), (4, '城管已丢弃'), (5, '平台已丢弃')], db_index=True, default=1, verbose_name='预警状态')),
                ('result', models.CharField(db_index=True, default='处理中', max_length=300, verbose_name='处理进度')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
                ('map', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='maps.Map', verbose_name='所属监控点')),
            ],
            options={
                'verbose_name': '预警数据管理',
                'verbose_name_plural': '预警数据管理',
                'ordering': ('-add_time',),
            },
        ),
        migrations.CreateModel(
            name='WarnType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type_id', models.CharField(max_length=100, verbose_name='检测类型id')),
                ('type_name', models.CharField(choices=[('other', '其他检测'), ('splashing', '泼水检测'), ('throwing', '抛物检测')], max_length=100, verbose_name='检测类型名')),
                ('desc', models.CharField(default='', max_length=100, verbose_name='描述')),
                ('add_time', models.DateTimeField(default=datetime.datetime.now, verbose_name='添加时间')),
            ],
            options={
                'verbose_name': '预警分析类型',
                'verbose_name_plural': '预警分析类型',
            },
        ),
        migrations.AddField(
            model_name='warnmodel',
            name='warn_manage',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='warnlist.WarnType', verbose_name='所属任务类型'),
        ),
        migrations.AddField(
            model_name='warnmanage',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='warnlist.WarnType', verbose_name='所属预警分析类型'),
        ),
        migrations.AddField(
            model_name='warnimage',
            name='warn_image',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='warnlist.WarnModel', verbose_name='所属预警'),
        ),
        migrations.AddField(
            model_name='manageimage',
            name='manage_image',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='manage_images', to='warnlist.WarnModel', verbose_name='所属预警'),
        ),
    ]
