# -*- 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 item.models
import oxdjango.fields


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Access',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('access', models.DateTimeField(auto_now=True)),
                ('accessed', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='AnnotationSequence',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.BigIntegerField(default=1)),
            ],
        ),
        migrations.CreateModel(
            name='Description',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(db_index=True, max_length=200)),
                ('value', models.CharField(db_index=True, max_length=1000)),
                ('description', models.TextField()),
            ],
        ),
        migrations.CreateModel(
            name='Facet',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(db_index=True, max_length=200)),
                ('value', models.CharField(db_index=True, max_length=1000)),
                ('sortvalue', models.CharField(db_index=True, max_length=1000)),
            ],
        ),
        migrations.CreateModel(
            name='Item',
            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)),
                ('rendered', models.BooleanField(db_index=True, default=False)),
                ('level', models.IntegerField(db_index=True)),
                ('public_id', models.CharField(blank=True, max_length=128, unique=True)),
                ('oxdbId', models.CharField(blank=True, max_length=42, null=True, unique=True)),
                ('external_data', oxdjango.fields.DictField(default={}, editable=False)),
                ('data', oxdjango.fields.DictField(default={}, editable=False)),
                ('json', oxdjango.fields.DictField(default={}, editable=False)),
                ('poster', models.ImageField(blank=True, default=None, upload_to=item.models.get_poster_path)),
                ('poster_source', models.TextField(blank=True)),
                ('poster_height', models.IntegerField(default=0)),
                ('poster_width', models.IntegerField(default=0)),
                ('poster_frame', models.FloatField(default=-1)),
                ('icon', models.ImageField(blank=True, default=None, upload_to=item.models.get_icon_path)),
                ('torrent', models.FileField(blank=True, default=None, max_length=1000, upload_to=item.models.get_torrent_path)),
                ('stream_info', oxdjango.fields.DictField(default={}, editable=False)),
                ('stream_aspect', models.FloatField(default=1.3333333333333333)),
            ],
        ),
        migrations.CreateModel(
            name='ItemFind',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.CharField(db_index=True, max_length=200)),
                ('value', models.TextField(blank=True, db_index=True)),
            ],
        ),
        migrations.CreateModel(
            name='ItemSort',
            fields=[
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='sort', serialize=False, to='item.Item')),
                ('duration', models.FloatField(blank=True, db_index=True, null=True)),
                ('width', models.BigIntegerField(blank=True, db_index=True, null=True)),
                ('height', models.BigIntegerField(blank=True, db_index=True, null=True)),
                ('created', models.DateTimeField(blank=True, db_index=True, null=True)),
                ('title', models.CharField(db_index=True, max_length=1000, null=True)),
                ('source', models.CharField(db_index=True, max_length=1000, null=True)),
                ('project', models.CharField(db_index=True, max_length=1000, null=True)),
                ('topic', models.CharField(db_index=True, max_length=1000, null=True)),
                ('director', models.CharField(db_index=True, max_length=1000, null=True)),
                ('cinematographer', models.CharField(db_index=True, max_length=1000, null=True)),
                ('featuring', models.CharField(db_index=True, max_length=1000, null=True)),
                ('language', models.CharField(db_index=True, max_length=1000, null=True)),
                ('location', models.CharField(db_index=True, max_length=1000, null=True)),
                ('date', models.CharField(db_index=True, max_length=1000, null=True)),
                ('public_id', models.CharField(db_index=True, max_length=1000, null=True)),
                ('numberofannotations', models.BigIntegerField(blank=True, db_index=True, null=True)),
                ('resolution', models.BigIntegerField(blank=True, db_index=True, null=True)),
                ('aspectratio', models.FloatField(blank=True, db_index=True, null=True)),
                ('pixels', models.BigIntegerField(blank=True, db_index=True, null=True)),
                ('hue', models.FloatField(blank=True, db_index=True, null=True)),
                ('saturation', models.FloatField(blank=True, db_index=True, null=True)),
                ('lightness', models.FloatField(blank=True, db_index=True, null=True)),
                ('volume', models.FloatField(blank=True, db_index=True, null=True)),
                ('numberofcuts', models.BigIntegerField(blank=True, db_index=True, null=True)),
                ('cutsperminute', models.FloatField(blank=True, db_index=True, null=True)),
                ('words', models.BigIntegerField(blank=True, db_index=True, null=True)),
                ('wordsperminute', models.FloatField(blank=True, db_index=True, null=True)),
                ('size', models.BigIntegerField(blank=True, db_index=True, null=True)),
                ('bitrate', models.BigIntegerField(blank=True, db_index=True, null=True)),
                ('numberoffiles', models.BigIntegerField(blank=True, db_index=True, null=True)),
                ('modified', models.DateTimeField(blank=True, db_index=True, null=True)),
                ('accessed', models.DateTimeField(blank=True, db_index=True, null=True)),
                ('timesaccessed', models.BigIntegerField(blank=True, db_index=True, null=True)),
                ('license', models.CharField(db_index=True, max_length=1000, null=True)),
                ('rightslevel', models.BigIntegerField(blank=True, db_index=True, null=True)),
                ('random', models.BigIntegerField(blank=True, db_index=True, null=True)),
            ],
        ),
        migrations.AddField(
            model_name='itemfind',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='find', to='item.Item'),
        ),
        migrations.AddField(
            model_name='item',
            name='groups',
            field=models.ManyToManyField(blank=True, related_name='items', to='auth.Group'),
        ),
        migrations.AddField(
            model_name='item',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='items', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='facet',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='facets', to='item.Item'),
        ),
        migrations.AlterUniqueTogether(
            name='description',
            unique_together=set([('key', 'value')]),
        ),
        migrations.AddField(
            model_name='annotationsequence',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='_annotation_sequence', to='item.Item', unique=True),
        ),
        migrations.AddField(
            model_name='access',
            name='item',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='accessed', to='item.Item'),
        ),
        migrations.AddField(
            model_name='access',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='accessed_items', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AlterUniqueTogether(
            name='itemfind',
            unique_together=set([('item', 'key')]),
        ),
        migrations.AlterUniqueTogether(
            name='facet',
            unique_together=set([('item', 'key', 'value')]),
        ),
        migrations.AlterUniqueTogether(
            name='access',
            unique_together=set([('item', 'user')]),
        ),
    ]
