# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-04-05 07:25
from __future__ import unicode_literals

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 = [
    ]

    operations = [
        migrations.CreateModel(
            name='Port',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('position', django.contrib.gis.db.models.fields.PointField(srid=4326)),
                ('country', models.CharField(max_length=16)),
                ('shipyard', models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='Ship',
            fields=[
                ('name', models.CharField(max_length=32)),
                ('imo', models.CharField(max_length=7, primary_key=True, serialize=False, unique=True)),
                ('mmsi', models.CharField(max_length=9, unique=True)),
                ('call_sign', models.CharField(max_length=5, unique=True)),
                ('flag', models.CharField(max_length=16)),
                ('type', models.IntegerField(choices=[(1, 'Fishing'), (2, 'Container'), (3, 'Tanker'), (4, 'Passnger')])),
                ('gross_tonnage', models.FloatField()),
                ('deadweight', models.FloatField()),
                ('length_overall', models.FloatField()),
                ('breadth', models.FloatField()),
                ('year_of_built', models.IntegerField()),
                ('active', models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='Voyage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('distance', models.FloatField()),
                ('begining_time', models.DateTimeField()),
                ('end_time', models.DateTimeField()),
                ('arrival_port', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='arrival_port', to='voyage.Port')),
                ('departure_port', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='departure_port', to='voyage.Port')),
            ],
        ),
        migrations.CreateModel(
            name='Waypoint',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64)),
                ('position', django.contrib.gis.db.models.fields.PointField(srid=4326)),
                ('time', models.DateTimeField()),
                ('leg_distance', models.FloatField()),
                ('leg_course', models.FloatField()),
                ('voyage', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='voyage.Voyage')),
            ],
        ),
    ]
