# Generated by Django 2.1.2 on 2018-10-11 15:32

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),
    ]

    operations = [
        migrations.CreateModel(
            name='Car',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('display_name', models.CharField(default='Unknown', max_length=200, null=True)),
                ('car_position', django.contrib.gis.db.models.fields.PointField(srid=4326)),
                ('car_account', models.OneToOneField(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='GeoPath',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('display_name', models.CharField(default='Unknown', max_length=200, null=True)),
                ('points', django.contrib.gis.db.models.fields.LineStringField(null=True, srid=4326)),
            ],
        ),
        migrations.CreateModel(
            name='GeoPOI',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('location', django.contrib.gis.db.models.fields.PointField(srid=4326)),
                ('display_name', models.CharField(default='POI', max_length=200, null=True)),
                ('path', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='flintstone.GeoPath')),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('wait_time', models.PositiveIntegerField(default=0)),
                ('user_state', models.CharField(blank=True, choices=[('r', 'Ride Request (Not active)'), ('w', 'Waiting for ride'), ('a', 'Car has arrived'), ('p', 'User is passenger')], default='r', max_length=1)),
                ('current_car', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='flintstone.Car')),
                ('path', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='flintstone.GeoPath')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='car',
            name='destination',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='poi_destination', to='flintstone.GeoPOI'),
        ),
        migrations.AddField(
            model_name='car',
            name='path',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='flintstone.GeoPath'),
        ),
        migrations.AddField(
            model_name='car',
            name='start',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='poi_start', to='flintstone.GeoPOI'),
        ),
    ]
