# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-16 15:45
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('member', '0001_initial'),
        ('assets', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='EventLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='事件名称')),
                ('event_type', models.SmallIntegerField(choices=[(1, '硬件变更'), (2, '新增配件'), (3, '设备下线'), (4, '设备上线'), (5, '定期维护'), (6, '业务上线\\更新\\变更'), (7, '其它')], verbose_name='事件类型')),
                ('component', models.CharField(blank=True, max_length=255, null=True, verbose_name='事件子项')),
                ('detail', models.TextField(verbose_name='事件详情')),
                ('date', models.DateTimeField(auto_now_add=True, verbose_name='事件时间')),
                ('memo', models.TextField(blank=True, null=True, verbose_name='备注')),
                ('asset', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='assets.Asset')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='member.UserProfile', verbose_name='事件源')),
            ],
            options={
                'verbose_name': '资产事件纪录',
                'verbose_name_plural': '资产事件纪录',
            },
        ),
        migrations.CreateModel(
            name='OperationLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='操作名称')),
                ('event_type', models.SmallIntegerField(choices=[(1, '远程管理'), (2, '执行命令'), (3, '分发文件')], verbose_name='操作类型')),
                ('detail', models.TextField(verbose_name='事件详情')),
                ('date', models.DateTimeField(auto_now_add=True, verbose_name='事件时间')),
                ('memo', models.TextField(blank=True, null=True, verbose_name='备注')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='member.UserProfile', verbose_name='操作人')),
            ],
            options={
                'verbose_name': '用户操作纪录',
                'verbose_name_plural': '用户操作纪录',
            },
        ),
        migrations.CreateModel(
            name='UserLoginLog',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('login', models.DateField(auto_now=True, verbose_name='上次登录时间')),
                ('name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='member.UserProfile', verbose_name='用户')),
            ],
            options={
                'verbose_name': '用户登录纪录',
                'verbose_name_plural': '用户登录纪录',
            },
        ),
    ]
