# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-03-05 16:30
from __future__ import unicode_literals

from django.conf import settings
import django.contrib.postgres.fields
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import osf.models.validators
import osf.utils.fields


class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('osf', '0085_merge_20180316_1625'),
    ]

    operations = [
        migrations.CreateModel(
            name='CollectedGuidMetadata',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('collected_type', models.CharField(blank=True, max_length=31)),
                ('status', models.CharField(blank=True, max_length=31)),
                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('guid', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='osf.Guid')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.DeleteModel(
            name='Collection',
        ),
        migrations.CreateModel(
            name='CollectionProvider',
            fields=[
            ],
            options={
                'proxy': True,
                'indexes': [],
            },
            bases=('osf.abstractprovider',),
        ),
        migrations.AlterField(
            model_name='abstractprovider',
            name='type',
            field=models.CharField(choices=[('osf.collectionprovider', 'collection provider'), ('osf.preprintprovider', 'preprint provider')], db_index=True, max_length=255),
        ),
        migrations.CreateModel(
            name='Collection',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('content_type_pk', models.PositiveIntegerField(blank=True, null=True)),
                ('title', models.CharField(max_length=200, validators=[osf.models.validators.validate_title])),
                ('collected_type_choices', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=31), blank=True, default=list, size=None)),
                ('status_choices', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=31), blank=True, default=list, size=None)),
                ('is_public', models.BooleanField(db_index=True, default=False)),
                ('is_promoted', models.BooleanField(db_index=True, default=False)),
                ('is_bookmark_collection', models.BooleanField(db_index=True, default=False)),
                ('collected_types', models.ManyToManyField(related_name='_collection_collected_types_+', to='contenttypes.ContentType')),
                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('guid_links', models.ManyToManyField(related_name='collections', through='osf.CollectedGuidMetadata', to='osf.Guid')),
                ('provider', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='osf.AbstractProvider')),
                ('deleted', osf.utils.fields.NonNaiveDateTimeField(blank=True, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='collectedguidmetadata',
            name='collection',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='osf.Collection'),
        ),
        migrations.AlterOrderWithRespectTo(
            name='collectedguidmetadata',
            order_with_respect_to='collection',
        ),
        migrations.AlterUniqueTogether(
            name='collectedguidmetadata',
            unique_together=set([('collection', 'guid')]),
        ),
    ]
