# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-09-30 20:04
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='Areas',
            fields=[
                ('short_n', models.CharField(max_length=10, primary_key=True, serialize=False)),
                ('full_n', models.CharField(max_length=255)),
            ],
            options={
                'managed': True,
                'db_table': 'areas',
            },
        ),
        migrations.CreateModel(
            name='Measurments',
            fields=[
                ('id', models.AutoField(primary_key=True)),
                ('date', models.DateField(primary_key=True, serialize=False)),
                ('time', models.TimeField()),
                ('p1', models.FloatField()),
                ('p2', models.SmallIntegerField()),
                ('p3', models.SmallIntegerField()),
                ('p4', models.FloatField()),
                ('area', models.ForeignKey(db_column='area', on_delete=django.db.models.deletion.CASCADE, to='db_lab.Areas')),
            ],
            options={
                'managed': True,
                'db_table': 'measurments',
            },
        ),
        migrations.CreateModel(
            name='Stations',
            fields=[
                ('station', models.SmallIntegerField(primary_key=True, serialize=False)),
                ('point_x', models.FloatField()),
                ('point_y', models.FloatField()),
                ('point_z', models.FloatField()),
                ('area', models.ForeignKey(db_column='area', on_delete=django.db.models.deletion.CASCADE, to='db_lab.Areas')),
            ],
            options={
                'managed': True,
                'db_table': 'stations',
            },
        ),
        migrations.AddField(
            model_name='measurments',
            name='station',
            field=models.ForeignKey(db_column='station', on_delete=django.db.models.deletion.CASCADE, to='db_lab.Stations'),
        ),
        migrations.AlterUniqueTogether(
            name='stations',
            unique_together=set([('station', 'area')]),
        ),
        migrations.AlterUniqueTogether(
            name='measurments',
            unique_together=set([('date', 'time', 'area', 'station', 'id')]),
        ),
    ]
