# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-04-22 06:47
from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import fineuploader.models
import positions.fields


class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('fineuploader', '0003_auto_20180419_1106'),
    ]

    operations = [
        migrations.CreateModel(
            name='Attachment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('object_id', models.CharField(max_length=128)),
                ('field_name', models.CharField(blank=True, max_length=256, null=True)),
                ('file_obj', models.FileField(upload_to=fineuploader.models.upload_path, verbose_name='file')),
                ('original_filename', models.CharField(blank=True, max_length=255, null=True, verbose_name='original filename')),
                ('uuid', models.UUIDField()),
                ('position', positions.fields.PositionField(default=-1, verbose_name='order')),
                ('timestamp', models.DateTimeField(default=django.utils.timezone.now)),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
                ('owner', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='owned_attachments', to=settings.AUTH_USER_MODEL, verbose_name='owner')),
            ],
            options={
                'ordering': ['-timestamp', 'position'],
                'verbose_name': 'attachment',
                'verbose_name_plural': 'attachments',
            },
        ),
        migrations.CreateModel(
            name='Temporary',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('formid', models.CharField(max_length=128)),
                ('timestamp', models.DateTimeField(default=django.utils.timezone.now)),
            ],
            options={
                'ordering': ['-timestamp'],
                'verbose_name': 'temporary',
                'verbose_name_plural': 'temporary',
            },
        ),
        migrations.DeleteModel(
            name='Upload',
        ),
        migrations.AlterUniqueTogether(
            name='attachment',
            unique_together=set([('content_type', 'object_id', 'uuid')]),
        ),
    ]
