# -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-01-20 22:28
from __future__ import unicode_literals

import config.current_user
from django.conf import settings
import django.contrib.gis.db.models.fields
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),
        ('annotation', '0001_initial'),
        ('habitat', '0001_initial'),
        ('trip', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Bait',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_datetime', models.DateTimeField(auto_now_add=True)),
                ('last_modified_datetime', models.DateTimeField(auto_now=True)),
                ('description', models.CharField(help_text='1kg', max_length=16)),
                ('type', models.CharField(choices=[('CHP', 'Chopped'), ('WHL', 'Whole'), ('CRS', 'Crushed')], max_length=3)),
                ('oiled', models.BooleanField(default=False, help_text='20ml menhaden oil')),
                ('user', models.ForeignKey(default=config.current_user.get_current_user, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='EnvironmentMeasure',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_datetime', models.DateTimeField(auto_now_add=True)),
                ('last_modified_datetime', models.DateTimeField(auto_now=True)),
                ('water_temperature', models.DecimalField(blank=True, decimal_places=1, help_text='C', max_digits=4, null=True)),
                ('salinity', models.DecimalField(blank=True, decimal_places=2, help_text='ppt', max_digits=4, null=True)),
                ('conductivity', models.DecimalField(blank=True, decimal_places=2, help_text='S/m', max_digits=4, null=True)),
                ('dissolved_oxygen', models.DecimalField(blank=True, decimal_places=1, help_text='%', max_digits=3, null=True)),
                ('current_flow', models.DecimalField(blank=True, decimal_places=2, help_text='m/s', max_digits=5, null=True)),
                ('current_direction', models.CharField(blank=True, choices=[('E', 'East'), ('NW', 'Northwest'), ('S', 'South'), ('SE', 'Southeast'), ('NE', 'Northeast'), ('W', 'West'), ('SW', 'Southwest'), ('N', 'North')], help_text='compass direction', max_length=2, null=True)),
                ('tide_state', models.CharField(blank=True, choices=[('S2E', 'Slack to Ebb'), ('F', 'Flood'), ('S2F', 'Slack to Flood'), ('E', 'Ebb'), ('S', 'Slack')], max_length=3, null=True)),
                ('estimated_wind_speed', models.IntegerField(blank=True, null=True)),
                ('wind_direction', models.CharField(blank=True, choices=[('E', 'East'), ('NW', 'Northwest'), ('S', 'South'), ('SE', 'Southeast'), ('NE', 'Northeast'), ('W', 'West'), ('SW', 'Southwest'), ('N', 'North')], help_text='compass direction', max_length=2, null=True)),
                ('cloud_cover', models.IntegerField(blank=True, help_text='%', null=True)),
                ('surface_chop', models.CharField(blank=True, choices=[('H', 'Heavy'), ('L', 'Light'), ('M', 'Medium')], max_length=1, null=True)),
                ('user', models.ForeignKey(default=config.current_user.get_current_user, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Equipment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_datetime', models.DateTimeField(auto_now_add=True)),
                ('last_modified_datetime', models.DateTimeField(auto_now=True)),
                ('camera', models.CharField(max_length=16)),
                ('stereo', models.BooleanField(default=False)),
                ('bait_container', models.CharField(choices=[('C', 'Cage'), ('B', 'Bag')], default='C', max_length=1)),
                ('arm_length', models.PositiveIntegerField(help_text='centimeters')),
                ('camera_height', models.PositiveIntegerField(help_text='centimeters')),
            ],
            options={
                'verbose_name_plural': 'Equipment',
            },
        ),
        migrations.CreateModel(
            name='FrameType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(max_length=16)),
                ('image', models.ImageField(null=True, upload_to='')),
            ],
        ),
        migrations.CreateModel(
            name='Set',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('create_datetime', models.DateTimeField(auto_now_add=True)),
                ('last_modified_datetime', models.DateTimeField(auto_now=True)),
                ('code', models.CharField(help_text='[site + reef code]_xxx', max_length=32)),
                ('set_date', models.DateField()),
                ('coordinates', django.contrib.gis.db.models.fields.PointField(null=True, srid=4326)),
                ('latitude', models.DecimalField(decimal_places=6, max_digits=10)),
                ('longitude', models.DecimalField(decimal_places=6, max_digits=10)),
                ('drop_time', models.TimeField()),
                ('haul_time', models.TimeField()),
                ('visibility', models.CharField(choices=[('3', '3'), ('2', '2'), ('12', '12'), ('14', '14'), ('9', '9'), ('5', '5'), ('4', '4'), ('13', '13'), ('8', '8'), ('7', '7'), ('>15', '>15'), ('1', '1'), ('6', '6'), ('11', '11'), ('15', '15'), ('10', '10')], max_length=3)),
                ('depth', models.FloatField(help_text='m', null=True)),
                ('comments', models.CharField(blank=True, max_length=255, null=True)),
                ('bait', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='bait_parent_set', to='bruv.Bait')),
                ('drop_measure', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='drop_parent_set', to='bruv.EnvironmentMeasure')),
                ('equipment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bruv.Equipment')),
                ('haul_measure', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='haul_parent_set', to='bruv.EnvironmentMeasure')),
                ('reef_habitat', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='habitat.ReefHabitat')),
                ('trip', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='trip.Trip')),
                ('user', models.ForeignKey(default=config.current_user.get_current_user, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('video', models.OneToOneField(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='set', to='annotation.Video')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='equipment',
            name='frame_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='bruv.FrameType'),
        ),
        migrations.AddField(
            model_name='equipment',
            name='user',
            field=models.ForeignKey(default=config.current_user.get_current_user, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
    ]
