# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-04 17:31
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('name', models.CharField(max_length=45, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Outlet',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('description', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Pdu',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('name', models.CharField(max_length=45)),
                ('ip', models.CharField(max_length=45, unique=True)),
                ('description', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Type_pdu',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('type', models.CharField(max_length=45, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Type_user_action',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('type', models.CharField(max_length=45, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('user_name', models.CharField(max_length=45, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='User_action',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, unique=True)),
                ('time', models.DateTimeField()),
                ('outlet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Outlet')),
                ('pdu', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Pdu')),
                ('type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Type_user_action')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.User')),
            ],
        ),
        migrations.AddField(
            model_name='pdu',
            name='type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Type_pdu'),
        ),
        migrations.AddField(
            model_name='outlet',
            name='pdu',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='main.Pdu'),
        ),
        migrations.AddField(
            model_name='group',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='owner', to='main.User'),
        ),
        migrations.AddField(
            model_name='group',
            name='pdus',
            field=models.ManyToManyField(to='main.Pdu'),
        ),
        migrations.AddField(
            model_name='group',
            name='users',
            field=models.ManyToManyField(related_name='users', to='main.User'),
        ),
    ]
