# Generated by Django 2.0.3 on 2018-04-03 14:08

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='OpenRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time', models.DateTimeField(auto_now=True)),
                ('action', models.IntegerField(choices=[(0, 'open success'), (1, 'permisson denied'), (2, 'open failed'), (3, 'authorization user')])),
                ('point', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='pi_manager.Point')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=40)),
                ('mail', models.EmailField(max_length=254, unique=True)),
                ('password', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='UserPermisson',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('permisson', models.IntegerField()),
                ('time_out', models.DateTimeField()),
                ('point', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pi_manager.Point')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user_interface.User')),
            ],
        ),
        migrations.AddField(
            model_name='user',
            name='permisson',
            field=models.ManyToManyField(through='user_interface.UserPermisson', to='pi_manager.Point'),
        ),
        migrations.AddField(
            model_name='openrecord',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='user_interface.User'),
        ),
    ]
