# Generated by Django 2.0.7 on 2018-10-08 04:50

import django.contrib.gis.db.models.fields
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Device',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('point', django.contrib.gis.db.models.fields.PointField(editable=False, null=True, srid=4326)),
                ('heading', models.PositiveIntegerField(default=0, editable=False, help_text='Heading in degrees')),
                ('velocity', models.PositiveIntegerField(default=0, editable=False, help_text='Speed in metres/hr')),
                ('altitude', models.IntegerField(default=0, editable=False, help_text='Altitude above sea level in metres')),
                ('seen', models.DateTimeField(editable=False, null=True)),
                ('message', models.PositiveIntegerField(choices=[(1, 'Accessories Turned ON Message'), (2, 'Accessories Turned OFF Message'), (3, 'Tracking Message'), (5, 'Remote Polling Message'), (18, 'Emergency Message'), (19, 'Remote Command Acknowledge for Emergency Turn Off'), (25, 'Start Moving'), (26, 'Stop Moving')], default=3)),
                ('source_device_type', models.CharField(choices=[('tracplus', 'TracPlus'), ('iriditrak', 'Iriditrak'), ('dplus', 'DPlus'), ('spot', 'Spot'), ('dfes', 'DFES'), ('other', 'Other')], default='other', max_length=32)),
                ('deviceid', models.CharField(max_length=32, unique=True)),
                ('registration', models.CharField(default='No Rego', help_text='e.g. 1QBB157', max_length=32)),
                ('rin_number', models.PositiveIntegerField(blank=True, help_text='Heavy Duty, Gang Truck or Plant only (HD/GT/P automatically prefixed).', null=True, validators=[django.core.validators.MaxValueValidator(999)], verbose_name='Resource Identification Number (RIN)')),
                ('rin_display', models.CharField(blank=True, max_length=5, null=True, verbose_name='RIN')),
                ('symbol', models.CharField(choices=[('2 wheel drive', '2-Wheel Drive'), ('4 wheel drive passenger', '4-Wheel Drive Passenger'), ('4 wheel drive ute', '4-Wheel Drive (Ute)'), ('light unit', 'Light Unit'), ('heavy duty', 'Heavy Duty'), ('gang truck', 'Gang Truck'), ('snorkel', 'Snorkel'), (None, ''), ('dozer', 'Dozer'), ('grader', 'Grader'), ('loader', 'Loader'), ('tender', 'Tender'), ('float', 'Float'), (None, ''), ('fixed wing aircraft', 'Waterbomber'), ('rotary aircraft', 'Rotary'), ('spotter aircraft', 'Spotter'), ('helitac', 'Helitac'), ('rescue helicopter', 'Rescue Helicopter'), ('aviation fuel truck', 'Aviation Fuel Truck'), (None, ''), ('comms bus', 'Communications Bus'), ('boat', 'Boat'), ('person', 'Person'), ('other', 'Other')], default='other', max_length=32)),
                ('district', models.CharField(choices=[('SWAN', 'Swan Region'), ('PHD', 'Perth Hills'), ('SCD', 'Swan Coastal'), ('SWR', 'South West Region'), ('BWD', 'Blackwood'), ('WTN', 'Wellington'), ('WR', 'Warren Region'), ('DON', 'Donnelly'), ('FRK', 'Frankland'), ('SCR', 'South Coast Region'), ('ALB', 'Albany'), ('ESP', 'Esperance'), ('KIMB', 'Kimberley Region'), ('EKD', 'East Kimberley'), ('WKD', 'West Kimberley'), ('PIL', 'Pilbara Region'), ('EXM', 'Exmouth'), ('GLD', 'Goldfields Region'), ('MWR', 'Midwest Region'), ('GER', 'Geraldton'), ('MOR', 'Moora'), ('SHB', 'Shark Bay'), ('WBR', 'Wheatbelt Region'), ('CWB', 'Central Wheatbelt'), ('SWB', 'Southern Wheatbelt'), ('AV', 'Aviation'), ('OTH', 'Other')], default='OTH', max_length=32, verbose_name='Region/District')),
                ('district_display', models.CharField(default='Other', max_length=100, verbose_name='District')),
                ('usual_driver', models.CharField(blank=True, help_text='e.g. John Jones', max_length=50, null=True)),
                ('usual_location', models.CharField(blank=True, help_text='e.g. Karijini National Park', max_length=50, null=True)),
                ('current_driver', models.CharField(blank=True, help_text='e.g. Jodie Jones', max_length=50, null=True)),
                ('callsign', models.CharField(blank=True, help_text='e.g. 99 for Heavy Duty, Gang Truck or Plant, or free text for other devices', max_length=50, null=True)),
                ('callsign_display', models.CharField(blank=True, max_length=50, null=True, verbose_name='Callsign')),
                ('contractor_details', models.CharField(blank=True, help_text='Person engaging contractor is responsible for maintaining contractor resource details', max_length=50, null=True)),
                ('other_details', models.TextField(blank=True, null=True)),
                ('internal_only', models.BooleanField(default=False, verbose_name='Internal to DBCA only')),
            ],
            options={
                'ordering': ['-seen'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='LoggedPoint',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('point', django.contrib.gis.db.models.fields.PointField(editable=False, null=True, srid=4326)),
                ('heading', models.PositiveIntegerField(default=0, editable=False, help_text='Heading in degrees')),
                ('velocity', models.PositiveIntegerField(default=0, editable=False, help_text='Speed in metres/hr')),
                ('altitude', models.IntegerField(default=0, editable=False, help_text='Altitude above sea level in metres')),
                ('seen', models.DateTimeField(editable=False, null=True)),
                ('message', models.PositiveIntegerField(choices=[(1, 'Accessories Turned ON Message'), (2, 'Accessories Turned OFF Message'), (3, 'Tracking Message'), (5, 'Remote Polling Message'), (18, 'Emergency Message'), (19, 'Remote Command Acknowledge for Emergency Turn Off'), (25, 'Start Moving'), (26, 'Stop Moving')], default=3)),
                ('source_device_type', models.CharField(choices=[('tracplus', 'TracPlus'), ('iriditrak', 'Iriditrak'), ('dplus', 'DPlus'), ('spot', 'Spot'), ('dfes', 'DFES'), ('other', 'Other')], default='other', max_length=32)),
                ('raw', models.TextField(editable=False)),
                ('device', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='tracking.Device')),
            ],
        ),
        migrations.AlterUniqueTogether(
            name='loggedpoint',
            unique_together={('device', 'seen')},
        ),
    ]
