# Generated by Django 2.2.6 on 2019-10-25 19:17

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Agency',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name_plural': 'agencies',
            },
        ),
        migrations.CreateModel(
            name='Journey',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('date', models.DateField()),
                ('journey_id', models.CharField(max_length=255)),
                ('agency', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Agency')),
            ],
        ),
        migrations.CreateModel(
            name='Source',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Stop',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='StopIDKind',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='StopName',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('priority', models.IntegerField(default=0)),
                ('source', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Source')),
                ('stop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Stop')),
            ],
            options={
                'ordering': ['-priority'],
            },
        ),
        migrations.CreateModel(
            name='StopLocation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('country', models.CharField(blank=True, max_length=255, null=True)),
                ('latitude', models.DecimalField(decimal_places=6, max_digits=9)),
                ('longitude', models.DecimalField(decimal_places=6, max_digits=9)),
                ('priority', models.IntegerField(default=0)),
                ('source', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Source')),
                ('stop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Stop')),
            ],
            options={
                'ordering': ['-priority'],
            },
        ),
        migrations.CreateModel(
            name='StopID',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('kind', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.StopIDKind')),
                ('source', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.Source')),
                ('stop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Stop')),
            ],
        ),
        migrations.CreateModel(
            name='JourneyStop',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('planned_arrival_time', models.DateTimeField(null=True)),
                ('planned_departure_time', models.DateTimeField(null=True)),
                ('actual_arrival_time', models.DateTimeField(null=True)),
                ('actual_departure_time', models.DateTimeField(null=True)),
                ('journey', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Journey')),
                ('stop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Stop')),
            ],
            options={
                'ordering': ['planned_arrival_time'],
            },
        ),
        migrations.AddField(
            model_name='journey',
            name='source',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Source'),
        ),
        migrations.AddField(
            model_name='journey',
            name='stop',
            field=models.ManyToManyField(through='core.JourneyStop', to='core.Stop'),
        ),
        migrations.AddField(
            model_name='agency',
            name='used_id_kind',
            field=models.ManyToManyField(blank=True, to='core.StopIDKind'),
        ),
    ]

# Generated by Django 2.2.6 on 2019-10-25 19:17

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Agency',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
            ],
            options={
                'verbose_name_plural': 'agencies',
            },
        ),
        migrations.CreateModel(
            name='Journey',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('date', models.DateField()),
                ('journey_id', models.CharField(max_length=255)),
                ('agency', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Agency')),
            ],
        ),
        migrations.CreateModel(
            name='Source',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Stop',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='StopIDKind',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='StopName',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('priority', models.IntegerField(default=0)),
                ('source', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Source')),
                ('stop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Stop')),
            ],
            options={
                'ordering': ['-priority'],
            },
        ),
        migrations.CreateModel(
            name='StopLocation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('country', models.CharField(blank=True, max_length=255, null=True)),
                ('latitude', models.DecimalField(decimal_places=6, max_digits=9)),
                ('longitude', models.DecimalField(decimal_places=6, max_digits=9)),
                ('priority', models.IntegerField(default=0)),
                ('source', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Source')),
                ('stop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Stop')),
            ],
            options={
                'ordering': ['-priority'],
            },
        ),
        migrations.CreateModel(
            name='StopID',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('kind', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.StopIDKind')),
                ('source', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.Source')),
                ('stop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Stop')),
            ],
        ),
        migrations.CreateModel(
            name='JourneyStop',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('planned_arrival_time', models.DateTimeField(null=True)),
                ('planned_departure_time', models.DateTimeField(null=True)),
                ('actual_arrival_time', models.DateTimeField(null=True)),
                ('actual_departure_time', models.DateTimeField(null=True)),
                ('journey', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Journey')),
                ('stop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Stop')),
            ],
            options={
                'ordering': ['planned_arrival_time'],
            },
        ),
        migrations.AddField(
            model_name='journey',
            name='source',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Source'),
        ),
        migrations.AddField(
            model_name='journey',
            name='stop',
            field=models.ManyToManyField(through='core.JourneyStop', to='core.Stop'),
        ),
        migrations.AddField(
            model_name='agency',
            name='used_id_kind',
            field=models.ManyToManyField(blank=True, to='core.StopIDKind'),
        ),
    ]

# Generated by Django 2.2.6 on 2019-10-25 19:17