# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-15 11:06
from __future__ import unicode_literals

import backoffice.UserManager
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 = [
        ('auth', '0008_alter_user_username_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('email', models.EmailField(db_index=True, max_length=254, unique=True, verbose_name='email address')),
                ('firstName', models.CharField(blank=True, max_length=100, null=True)),
                ('lastName', models.CharField(blank=True, max_length=100, null=True)),
                ('facebookId', models.CharField(blank=True, db_index=True, max_length=100, null=True)),
                ('pushToken', models.CharField(blank=True, max_length=100, null=True)),
                ('mainPhoto', models.ImageField(blank=True, default='media/avatar.jpg', null=True, upload_to='media/%Y/%m/%d')),
                ('street', models.CharField(blank=True, max_length=100, null=True)),
                ('city', models.CharField(blank=True, max_length=100, null=True)),
                ('zipcode', models.CharField(blank=True, max_length=20, null=True)),
                ('country', models.CharField(blank=True, max_length=100, null=True)),
                ('location', django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326)),
                ('is_active', models.BooleanField(default=True, verbose_name='active')),
                ('valid', models.BooleanField(default=1)),
                ('removeAd', models.BooleanField(default=0)),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
            ],
            options={
                'verbose_name': 'User',
                'verbose_name_plural': 'Users',
            },
            managers=[
                ('objects', backoffice.UserManager.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=100)),
                ('icons', models.ImageField(blank=True, null=True, upload_to='media/%Y/%m/%d')),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='CheckInEvent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('street', models.CharField(blank=True, max_length=100, null=True)),
                ('zipCode', models.CharField(blank=True, max_length=100, null=True)),
                ('picture', models.ImageField(blank=True, null=True, upload_to='media/%Y/%m/%d')),
                ('location', django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326)),
                ('email', models.EmailField(blank=True, max_length=100, null=True, unique=True)),
                ('phone', models.CharField(blank=True, max_length=30, null=True)),
                ('webSite', models.CharField(blank=True, max_length=200, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('facebookId', models.CharField(blank=True, max_length=100, null=True)),
                ('openingTime', models.CharField(blank=True, max_length=100, null=True)),
                ('isWeekly', models.BooleanField(default=0)),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
                ('valid', models.BooleanField(default=1)),
            ],
        ),
        migrations.CreateModel(
            name='GoToEvent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
                ('refEvent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.Event')),
                ('refUser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Photo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('picture', models.ImageField(blank=True, null=True, upload_to='media/%Y/%m/%d')),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='PhotoEvents',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
                ('valid', models.BooleanField(default=0)),
                ('waitingValidation', models.BooleanField(default=1)),
                ('refEvent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.Event')),
                ('refPhoto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.Photo')),
                ('refUser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='PhotoPlaces',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
                ('valid', models.BooleanField(default=0)),
                ('waitingValidation', models.BooleanField(default=1)),
                ('refPhoto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.Photo')),
            ],
        ),
        migrations.CreateModel(
            name='PhotoProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
                ('valid', models.BooleanField(default=0)),
                ('waitingValidation', models.BooleanField(default=1)),
                ('refPhoto', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.Photo')),
                ('refUser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Place',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('street', models.CharField(max_length=100)),
                ('zipCode', models.CharField(max_length=100)),
                ('mainPhoto', models.ImageField(blank=True, null=True, upload_to='media/%Y/%m/%d')),
                ('location', django.contrib.gis.db.models.fields.PointField(blank=True, null=True, srid=4326)),
                ('email', models.EmailField(blank=True, max_length=100, null=True, unique=True)),
                ('phone', models.CharField(blank=True, max_length=30, null=True)),
                ('webSite', models.CharField(blank=True, max_length=200, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('facebookId', models.CharField(blank=True, max_length=100, null=True)),
                ('openingTime', models.CharField(blank=True, max_length=100, null=True)),
                ('freeAccess', models.BooleanField(default=0)),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
                ('valid', models.BooleanField(default=1)),
                ('photos', models.ManyToManyField(through='backoffice.PhotoPlaces', to='backoffice.Photo')),
                ('refCategory', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.Category')),
            ],
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('photo', models.ImageField(blank=True, null=True, upload_to='media/%Y/%m/%d')),
                ('webSite', models.CharField(blank=True, max_length=200, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('valid', models.BooleanField(default=0)),
                ('waitingValidation', models.BooleanField(default=1)),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='PostCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=100)),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Subscribtion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subscription', models.IntegerField(blank=True, choices=[(0, 'one_month'), (1, 'three_months'), (2, 'six_months'), (3, 'one_year')], null=True)),
                ('startDate', models.DateTimeField()),
                ('endDate', models.DateTimeField()),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
                ('refUser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Town',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(db_index=True, max_length=100)),
                ('city', models.CharField(max_length=100)),
                ('country', models.CharField(max_length=100)),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='UserGuide',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('unlock', models.BooleanField(default=0)),
                ('createdAt', models.DateTimeField(auto_now=True)),
                ('updatedAt', models.DateTimeField(auto_now=True)),
                ('refTown', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.Town')),
                ('refUser', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='post',
            name='refPostCategory',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.PostCategory'),
        ),
        migrations.AddField(
            model_name='post',
            name='refTown',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.Town'),
        ),
        migrations.AddField(
            model_name='post',
            name='refUser',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='place',
            name='refTown',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.Town'),
        ),
        migrations.AddField(
            model_name='photoplaces',
            name='refPlace',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.Place'),
        ),
        migrations.AddField(
            model_name='event',
            name='photos',
            field=models.ManyToManyField(through='backoffice.PhotoEvents', to='backoffice.Photo'),
        ),
        migrations.AddField(
            model_name='event',
            name='refPlace',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.Place'),
        ),
        migrations.AddField(
            model_name='event',
            name='refTown',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.Town'),
        ),
        migrations.AddField(
            model_name='checkinevent',
            name='refEvent',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='backoffice.Event'),
        ),
        migrations.AddField(
            model_name='checkinevent',
            name='refUser',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='user',
            name='photos',
            field=models.ManyToManyField(through='backoffice.PhotoProfile', to='backoffice.Photo'),
        ),
        migrations.AddField(
            model_name='user',
            name='refTown',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='backoffice.Town'),
        ),
        migrations.AddField(
            model_name='user',
            name='user_permissions',
            field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
        ),
    ]
