# Generated by Django 3.2.12 on 2023-06-30 02:28

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('mtm', '0002_auto_20230626_1559'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('wpm', '0003_auto_20230628_0859'),
        ('system', '0002_myschedule'),
        ('em', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Mpoint',
            fields=[
                ('id', models.CharField(editable=False, help_text='主键ID', max_length=20, primary_key=True, serialize=False, verbose_name='主键ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('name', models.CharField(max_length=50, verbose_name='测点名称')),
                ('code', models.CharField(max_length=50, unique=True, verbose_name='测点编号')),
                ('unit', models.CharField(max_length=50, verbose_name='单位')),
                ('cate', models.CharField(default='elec', max_length=50, verbose_name='分类')),
                ('belong_dept', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='mpoint_belong_dept', to='system.dept', verbose_name='所属部门')),
                ('create_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='mpoint_create_by', to=settings.AUTH_USER_MODEL, verbose_name='创建人')),
                ('ep_belong', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='mp_ep_belong', to='em.equipment', verbose_name='属于哪个设备')),
                ('ep_monitored', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='mp_ep_monitored', to='em.equipment', verbose_name='监测哪个设备')),
                ('mgroup', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='mtm.mgroup', verbose_name='所在集合')),
                ('update_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='mpoint_update_by', to=settings.AUTH_USER_MODEL, verbose_name='最后编辑人')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MpointStat',
            fields=[
                ('id', models.CharField(editable=False, help_text='主键ID', max_length=20, primary_key=True, serialize=False, verbose_name='主键ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('type', models.CharField(default='hour', help_text='year/month/day/year_s/month_s/day_s/sflog/hour', max_length=50, verbose_name='统计维度')),
                ('year', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='年')),
                ('month', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='月')),
                ('day', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='日')),
                ('year_s', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='班年')),
                ('month_s', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='班月')),
                ('day_s', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='班日')),
                ('hour', models.PositiveSmallIntegerField(blank=True, null=True, verbose_name='时')),
                ('val', models.FloatField(default=0, verbose_name='统计值')),
                ('mpoint', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='enm.mpoint', verbose_name='关联测点')),
                ('sflog', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='wpm.sflog', verbose_name='关联值班记录')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MpLog',
            fields=[
                ('id', models.CharField(editable=False, help_text='主键ID', max_length=20, primary_key=True, serialize=False, verbose_name='主键ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('tag_id', models.BigIntegerField(db_index=True, verbose_name='记录ID')),
                ('tag_code', models.CharField(max_length=50, verbose_name='测点编号')),
                ('tag_update', models.DateTimeField(verbose_name='更新时间')),
                ('tag_val', models.FloatField(verbose_name='当前值')),
                ('mpoint', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='enm.mpoint', verbose_name='关联测点')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
