# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-03 09:05
from __future__ import unicode_literals

import core.modelfields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import mptt.fields


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('address', models.GenericIPAddressField()),
            ],
            options={
                'verbose_name_plural': 'IP-Addresses',
                'verbose_name': 'IP-Address',
            },
        ),
        migrations.CreateModel(
            name='AddressActivity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('activity', models.SmallIntegerField(choices=[(0, 'Registration'), (1, 'Reset password'), (2, 'Set password'), (3, 'Set email')])),
                ('note', models.CharField(blank=True, default='', max_length=255)),
                ('address', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Address')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name_plural': 'IP-Address Activities',
                'verbose_name': 'IP-Address Activity',
            },
        ),
        migrations.CreateModel(
            name='BlogPost',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('title_de', models.CharField(help_text='Page title', max_length=64)),
                ('title_en', models.CharField(help_text='Page title', max_length=64)),
                ('slug_de', models.CharField(help_text='Slug (used in URLs)', max_length=64, unique=True)),
                ('slug_en', models.CharField(help_text='Slug (used in URLs)', max_length=64, unique=True)),
                ('text_de', models.TextField()),
                ('text_en', models.TextField()),
                ('published', models.BooleanField(default=True, help_text='Wether or not the page is public.')),
                ('sticky', models.BooleanField(default=False, help_text='Pinned at the top of any list of blog posts.')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CachedMessage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('level', models.IntegerField()),
                ('message', models.TextField()),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MenuItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('title_de', models.CharField(help_text='Page title', max_length=16)),
                ('title_en', models.CharField(help_text='Page title', max_length=16)),
                ('target', core.modelfields.LinkTarget(default=dict)),
                ('lft', models.PositiveIntegerField(db_index=True, editable=False)),
                ('rght', models.PositiveIntegerField(db_index=True, editable=False)),
                ('tree_id', models.PositiveIntegerField(db_index=True, editable=False)),
                ('level', models.PositiveIntegerField(db_index=True, editable=False)),
                ('parent', mptt.fields.TreeForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='children', to='core.MenuItem')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Page',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('updated', models.DateTimeField(auto_now=True)),
                ('title_de', models.CharField(help_text='Page title', max_length=64)),
                ('title_en', models.CharField(help_text='Page title', max_length=64)),
                ('slug_de', models.CharField(help_text='Slug (used in URLs)', max_length=64, unique=True)),
                ('slug_en', models.CharField(help_text='Slug (used in URLs)', max_length=64, unique=True)),
                ('text_de', models.TextField()),
                ('text_en', models.TextField()),
                ('published', models.BooleanField(default=True, help_text='Wether or not the page is public.')),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='address',
            name='activities',
            field=models.ManyToManyField(through='core.AddressActivity', to=settings.AUTH_USER_MODEL),
        ),
    ]
