# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2017-06-28 08:51
from __future__ import unicode_literals

from decimal import Decimal
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('last_update', models.DateTimeField(auto_now=True)),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('slug', models.SlugField(blank=True, unique=True)),
                ('object_id', models.PositiveIntegerField()),
                ('location_name', models.CharField(blank=True, max_length=256, null=True)),
                ('latitude', models.DecimalField(decimal_places=6, default=Decimal('0.0'), max_digits=8)),
                ('longitude', models.DecimalField(decimal_places=6, default=Decimal('0.0'), max_digits=9)),
                ('elevation', models.FloatField(blank=True, null=True)),
                ('site_type', models.CharField(blank=True, choices=[('On-Farm', 'On-Farm'), ('On-Station', 'On-Station'), ('Survey', 'Survey'), ('Greenhouse', 'Greenhouse')], max_length=30, null=True)),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='contenttypes.ContentType')),
                ('modified_by', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='locations_location', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-time_created', '-last_update'],
                'verbose_name_plural': 'Locations',
            },
        ),
        migrations.CreateModel(
            name='LocationRelation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('last_update', models.DateTimeField(auto_now=True)),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('object_id', models.PositiveIntegerField()),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='contenttypes.ContentType')),
                ('location', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='locations.Location')),
                ('modified_by', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='locations_locationrelation', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-time_created', '-last_update'],
            },
        ),
        migrations.CreateModel(
            name='Precipitation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('last_update', models.DateTimeField(auto_now=True)),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('precipitation', models.DecimalField(decimal_places=2, default=Decimal('0.0'), max_digits=7, unique=True)),
                ('precipitation_uom', models.CharField(default='mm', max_length=5, verbose_name='Precipitation UOM')),
                ('precipitation_desc', models.CharField(blank=True, choices=[('Mean Annual', 'Mean Annual'), ('Mean Seasonal', 'Mean Seasonal'), ('Total Annual', 'Total Annual'), ('Total Seasonal', 'Total Seasonal')], max_length=65, null=True)),
                ('modified_by', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='locations_precipitation', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-time_created', '-last_update'],
                'verbose_name_plural': 'Precipitation',
            },
        ),
        migrations.CreateModel(
            name='Temperature',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('last_update', models.DateTimeField(auto_now=True)),
                ('time_created', models.DateTimeField(auto_now_add=True)),
                ('temperature', models.DecimalField(decimal_places=2, default=Decimal('0.0'), max_digits=5, unique=True)),
                ('temperature_uom', models.CharField(default='\xb0C', max_length=5, verbose_name='Temperature UOM')),
                ('modified_by', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='locations_temperature', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-time_created', '-last_update'],
                'verbose_name_plural': 'Temperature',
            },
        ),
    ]
