# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-11-02 14:15
from __future__ import unicode_literals

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Acceleration',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('x_value', models.DecimalField(decimal_places=2, max_digits=4)),
                ('y_value', models.DecimalField(decimal_places=2, max_digits=4)),
                ('z_value', models.DecimalField(decimal_places=2, max_digits=4)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Amplitude',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('x_value', models.DecimalField(decimal_places=2, max_digits=4)),
                ('y_value', models.DecimalField(decimal_places=2, max_digits=4)),
                ('z_value', models.DecimalField(decimal_places=2, max_digits=4)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Experiment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.PositiveSmallIntegerField()),
                ('date', models.DateField(auto_now_add=True)),
                ('active', models.BooleanField()),
                ('initial_time', models.TimeField(auto_now_add=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Frequency',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('x_value', models.DecimalField(decimal_places=2, max_digits=4)),
                ('y_value', models.DecimalField(decimal_places=2, max_digits=4)),
                ('z_value', models.DecimalField(decimal_places=2, max_digits=4)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Job',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('choose_frequency', models.PositiveSmallIntegerField(validators=[django.core.validators.MaxValueValidator(100)])),
                ('job_time', models.PositiveSmallIntegerField()),
                ('experiment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bevim.Experiment')),
            ],
        ),
        migrations.CreateModel(
            name='Sensor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=3, unique=True, validators=[django.core.validators.RegexValidator('^[a-zA-Z0-9_\\s+]+$', 'Use alphanumeric characters and underscore only')], verbose_name='Sensor name')),
                ('active', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='Speed',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('x_value', models.DecimalField(decimal_places=2, max_digits=4)),
                ('y_value', models.DecimalField(decimal_places=2, max_digits=4)),
                ('z_value', models.DecimalField(decimal_places=2, max_digits=4)),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bevim.Job')),
                ('sensor', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bevim.Sensor', verbose_name='Sensor')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='frequency',
            name='job',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bevim.Job'),
        ),
        migrations.AddField(
            model_name='frequency',
            name='sensor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bevim.Sensor', verbose_name='Sensor'),
        ),
        migrations.AddField(
            model_name='amplitude',
            name='job',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bevim.Job'),
        ),
        migrations.AddField(
            model_name='amplitude',
            name='sensor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bevim.Sensor', verbose_name='Sensor'),
        ),
        migrations.AddField(
            model_name='acceleration',
            name='job',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bevim.Job'),
        ),
        migrations.AddField(
            model_name='acceleration',
            name='sensor',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bevim.Sensor', verbose_name='Sensor'),
        ),
    ]
