# -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-03-28 12:00
from __future__ import unicode_literals

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to='place_images')),
                ('uploaded_at', models.DateTimeField(blank=True, default=datetime.datetime.now)),
            ],
        ),
        migrations.CreateModel(
            name='Place',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(default='', max_length=128, unique=True)),
                ('postcode', models.CharField(default='', max_length=7)),
                ('address', models.CharField(default='', max_length=128)),
                ('website', models.URLField(default='')),
                ('likes', models.IntegerField(default=0)),
                ('type', models.IntegerField(choices=[(0, 'Pub'), (1, 'Restaurant'), (2, 'Nightclub'), (3, 'Other')], default=0)),
                ('slug', models.SlugField(default='', unique=True)),
            ],
            options={
                'verbose_name_plural': 'places',
            },
        ),
        migrations.CreateModel(
            name='Station',
            fields=[
                ('name', models.CharField(max_length=128, primary_key=True, serialize=False, unique=True)),
                ('firstTrainMonSat', models.TimeField(blank=True, null=True)),
                ('lastTrainMonSat', models.TimeField(blank=True, null=True)),
                ('firstTrainSun', models.TimeField(blank=True, null=True)),
                ('lastTrainSun', models.TimeField(blank=True, null=True)),
                ('latitude', models.DecimalField(blank=True, decimal_places=6, max_digits=8, null=True)),
                ('longitude', models.DecimalField(blank=True, decimal_places=6, max_digits=8, null=True)),
                ('mapCoords', models.CharField(default='0,0,0,0', max_length=32)),
                ('slug', models.SlugField(default='', unique=True)),
            ],
            options={
                'verbose_name_plural': 'stations',
            },
        ),
        migrations.CreateModel(
            name='Subcrawl',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sub_slug', models.SlugField(default='', unique=True)),
                ('sub_name', models.CharField(max_length=128, unique=True)),
                ('sub_date', models.DateField(default='2000-01-01')),
                ('sub_time', models.TimeField(default='18:00')),
                ('is_public', models.BooleanField(default=False)),
                ('first_st', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='pubway.Station')),
                ('sub_organiser', models.ForeignKey(default=None, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('sub_places', models.ManyToManyField(to='pubway.Place')),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('no_reviews', models.IntegerField(default=0)),
                ('no_likes', models.IntegerField(default=0)),
                ('subcrawls', models.ManyToManyField(to='pubway.Subcrawl')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='userprofile', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='place',
            name='closeStation',
            field=models.ForeignKey(default='', null=True, on_delete=django.db.models.deletion.SET_NULL, to='pubway.Station'),
        ),
        migrations.AddField(
            model_name='image',
            name='place',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='pubway.Place'),
        ),
    ]
