# Generated by Django 2.1.7 on 2019-03-23 09:35

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Devices',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='Название')),
                ('driverPath', models.CharField(max_length=300, verbose_name='Путь к драйверу')),
                ('iconPath', models.CharField(max_length=300, verbose_name='Иконка')),
                ('template', models.CharField(max_length=300, verbose_name='Шаблон интерфейса')),
            ],
            options={
                'verbose_name': 'Устройства',
                'db_table': 'Devices',
            },
        ),
        migrations.CreateModel(
            name='Macro',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.CharField(max_length=1000, verbose_name='Текст макроса')),
                ('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RemoteApp.Devices', verbose_name='Устройство')),
            ],
            options={
                'verbose_name': 'Пользовательские макросы',
                'db_table': 'Macro',
            },
        ),
        migrations.CreateModel(
            name='Premissions',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('Description', models.CharField(max_length=500, verbose_name='Описание')),
                ('device', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RemoteApp.Devices', verbose_name='Устройство')),
            ],
            options={
                'verbose_name': 'Права',
                'db_table': 'Permissions',
            },
        ),
        migrations.CreateModel(
            name='Rooms',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('RoomName', models.CharField(max_length=50, verbose_name='Название')),
                ('Description', models.CharField(max_length=500, verbose_name='Описание')),
            ],
            options={
                'verbose_name': 'Помещения',
                'db_table': 'Rooms',
            },
        ),
        migrations.CreateModel(
            name='UserPemissions',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('permission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RemoteApp.Premissions')),
            ],
            options={
                'verbose_name': 'Права пользователей',
                'db_table': 'UserPermissions',
            },
        ),
        migrations.CreateModel(
            name='Users',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('username', models.CharField(max_length=50, unique=True, verbose_name='Пользователь')),
                ('login', models.CharField(max_length=45, unique=True, verbose_name='Логин')),
                ('password', models.CharField(max_length=50, verbose_name='Пароль')),
                ('email', models.EmailField(max_length=254, verbose_name='Эелектронная почта')),
                ('phone', models.CharField(max_length=20, null=True, verbose_name='Телефон')),
            ],
            options={
                'verbose_name': 'Пользователи',
                'db_table': 'Users',
            },
        ),
        migrations.AddField(
            model_name='userpemissions',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RemoteApp.Users'),
        ),
        migrations.AddField(
            model_name='macro',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RemoteApp.Users', verbose_name='Пользователь'),
        ),
        migrations.AddField(
            model_name='devices',
            name='room',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='RemoteApp.Rooms', verbose_name='Помещенгие'),
        ),
    ]
