# -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-08 16:55
from __future__ import unicode_literals

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Airport',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250)),
                ('code', models.CharField(max_length=250)),
            ],
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=250)),
            ],
        ),
        migrations.CreateModel(
            name='Flight',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('publish', models.DateTimeField(default=django.utils.timezone.now)),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('record', django.contrib.postgres.fields.jsonb.JSONField()),
                ('amount', models.DecimalField(decimal_places=2, max_digits=2)),
                ('flight_number', models.CharField(max_length=250)),
                ('departure', models.DateField()),
                ('arrival', models.DateField()),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='flights', to='flights.Company')),
                ('destination', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='flight_destination', to='flights.Airport')),
                ('origin', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='flight_origin', to='flights.Airport')),
            ],
            options={
                'ordering': ('-departure',),
            },
        ),
    ]
