# -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-19 15:37
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import oxdjango.fields
import text.models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Position',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('section', models.CharField(max_length=255)),
                ('position', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Text',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('modified', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=255)),
                ('status', models.CharField(default=b'private', max_length=20)),
                ('type', models.CharField(default=b'html', max_length=255)),
                ('description', models.TextField(default=b'')),
                ('rightslevel', models.IntegerField(db_index=True, default=0)),
                ('icon', models.ImageField(blank=True, default=None, upload_to=text.models.get_icon_path)),
                ('text', models.TextField(default=b'')),
                ('embeds', oxdjango.fields.TupleField(default=[])),
                ('poster_frames', oxdjango.fields.TupleField(default=[], editable=False)),
                ('uploading', models.BooleanField(default=False)),
                ('file', models.FileField(blank=True, default=None, null=True, upload_to=text.models.get_path)),
                ('subscribed_users', models.ManyToManyField(related_name='subscribed_texts', to=settings.AUTH_USER_MODEL)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='texts', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='position',
            name='text',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='position', to='text.Text'),
        ),
        migrations.AddField(
            model_name='position',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='text_position', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='text',
            unique_together=set([('user', 'name')]),
        ),
        migrations.AlterUniqueTogether(
            name='position',
            unique_together=set([('user', 'text', 'section')]),
        ),
    ]
