# -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-04-10 09:48
from __future__ import unicode_literals

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import saliapp.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Alarms',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('checked', models.BooleanField(default=False)),
                ('max_or_min', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='AlarmsSettings',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('max', models.FloatField(default=0.0)),
                ('min', models.FloatField(default=0.0)),
                ('msgMax', models.CharField(max_length=228)),
                ('msgMin', models.CharField(max_length=228)),
            ],
        ),
        migrations.CreateModel(
            name='CMPerUsers',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='CommunicationType',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=128)),
                ('path_or_number', models.CharField(max_length=128)),
                ('image_path', models.CharField(blank=True, max_length=128)),
            ],
        ),
        migrations.CreateModel(
            name='CommunicationTypePerSM',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('id_communication_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='saliapp.CommunicationType')),
            ],
        ),
        migrations.CreateModel(
            name='ControllerModule',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=128)),
                ('status_cm', models.BooleanField(default=True)),
                ('date_create', models.DateTimeField(blank=True, default=datetime.datetime.now)),
                ('memory', models.IntegerField()),
                ('localization_cm', models.CharField(max_length=128)),
                ('baterry_cm', models.IntegerField()),
                ('id_by_create', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('id_communication', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='saliapp.CommunicationType')),
            ],
        ),
        migrations.CreateModel(
            name='Reading',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('value', models.FloatField(default=0.0)),
                ('date_time', models.DateTimeField(blank=True, default=datetime.datetime.now)),
            ],
        ),
        migrations.CreateModel(
            name='SecretKey',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('key_dev', models.CharField(default=saliapp.models.my_random_key, max_length=16, unique=True)),
                ('id_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Sensor',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('status_actuator', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='SensorModule',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=128)),
                ('seding_time', models.IntegerField()),
                ('status_sm', models.BooleanField(default=True)),
                ('baterry_sm', models.IntegerField()),
                ('localization_sm', models.CharField(max_length=128)),
            ],
        ),
        migrations.CreateModel(
            name='SensorType',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=128)),
                ('scale_value', models.CharField(max_length=10)),
                ('image_path', models.CharField(blank=True, max_length=128)),
                ('color', models.CharField(blank=True, max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='SMPerCM',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('id_cm', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='saliapp.ControllerModule')),
                ('id_sm', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='saliapp.SensorModule')),
            ],
        ),
        migrations.CreateModel(
            name='UserPerCompany',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('id_company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='company', to=settings.AUTH_USER_MODEL)),
                ('id_general_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='general', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='sensor',
            name='id_sensor_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='saliapp.SensorType'),
        ),
        migrations.AddField(
            model_name='sensor',
            name='id_sm',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='saliapp.SensorModule'),
        ),
        migrations.AddField(
            model_name='reading',
            name='id_sensor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='saliapp.Sensor'),
        ),
        migrations.AddField(
            model_name='communicationtypepersm',
            name='id_sm',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='saliapp.SensorModule'),
        ),
        migrations.AddField(
            model_name='cmperusers',
            name='id_cm',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='saliapp.ControllerModule'),
        ),
        migrations.AddField(
            model_name='cmperusers',
            name='id_user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='alarmssettings',
            name='id_sensor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='saliapp.Sensor'),
        ),
        migrations.AddField(
            model_name='alarms',
            name='id_reading',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='saliapp.Reading'),
        ),
    ]
