# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations
import django.utils.timezone


class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('versionable_testapp', '0002_auto_20150813_1634'),
    ]

    operations = [
        migrations.CreateModel(
            name='PolymorphicBase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
                ('version_state', models.CharField(db_index=True, default='d', max_length=1, choices=[('c', 'Copied'), ('C', 'Copying'), ('d', 'Draft'), ('p', 'Published'), ('a', 'Archived')], verbose_name='Version state')),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Creation date')),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PolymorphicDependencyBase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SubDependencyModel2',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, verbose_name='ID', serialize=False)),
                ('name', models.CharField(max_length=100)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PolymorphicChild1',
            fields=[
                ('polymorphicbase_ptr', models.OneToOneField(parent_link=True, primary_key=True, serialize=False, to='versionable_testapp.PolymorphicBase', auto_created=True)),
                ('name1', models.CharField(max_length=100)),
            ],
            options={
                'abstract': False,
            },
            bases=('versionable_testapp.polymorphicbase',),
        ),
        migrations.CreateModel(
            name='PolymorphicChild2',
            fields=[
                ('polymorphicbase_ptr', models.OneToOneField(parent_link=True, primary_key=True, serialize=False, to='versionable_testapp.PolymorphicBase', auto_created=True)),
                ('name2', models.CharField(max_length=100)),
            ],
            options={
                'abstract': False,
            },
            bases=('versionable_testapp.polymorphicbase',),
        ),
        migrations.CreateModel(
            name='PolymorphicDependencyChild1',
            fields=[
                ('polymorphicdependencybase_ptr', models.OneToOneField(parent_link=True, primary_key=True, serialize=False, to='versionable_testapp.PolymorphicDependencyBase', auto_created=True)),
                ('name1', models.CharField(max_length=100)),
                ('items', models.ManyToManyField(related_name='links', to='versionable_testapp.SubDependencyModel2')),
            ],
            options={
                'abstract': False,
            },
            bases=('versionable_testapp.polymorphicdependencybase',),
        ),
        migrations.CreateModel(
            name='PolymorphicDependencyChild2',
            fields=[
                ('polymorphicdependencybase_ptr', models.OneToOneField(parent_link=True, primary_key=True, serialize=False, to='versionable_testapp.PolymorphicDependencyBase', auto_created=True)),
                ('name2', models.CharField(max_length=100)),
            ],
            options={
                'abstract': False,
            },
            bases=('versionable_testapp.polymorphicdependencybase',),
        ),
        migrations.AddField(
            model_name='polymorphicdependencybase',
            name='original_version',
            field=models.ForeignKey(to='versionable_testapp.PolymorphicDependencyBase', null=True, related_name='all_duplicates'),
        ),
        migrations.AddField(
            model_name='polymorphicdependencybase',
            name='parent_version',
            field=models.ForeignKey(to='versionable_testapp.PolymorphicDependencyBase', null=True, related_name='direct_duplicates'),
        ),
        migrations.AddField(
            model_name='polymorphicdependencybase',
            name='polymorphic_ctype',
            field=models.ForeignKey(editable=False, null=True, related_name='polymorphic_versionable_testapp.polymorphicdependencybase_set+', to='contenttypes.ContentType'),
        ),
        migrations.AddField(
            model_name='polymorphicbase',
            name='original_version',
            field=models.ForeignKey(to='versionable_testapp.PolymorphicBase', null=True, related_name='all_duplicates'),
        ),
        migrations.AddField(
            model_name='polymorphicbase',
            name='parent_version',
            field=models.ForeignKey(to='versionable_testapp.PolymorphicBase', null=True, related_name='direct_duplicates'),
        ),
        migrations.AddField(
            model_name='polymorphicbase',
            name='polymorphic_ctype',
            field=models.ForeignKey(editable=False, null=True, related_name='polymorphic_versionable_testapp.polymorphicbase_set+', to='contenttypes.ContentType'),
        ),
        migrations.AddField(
            model_name='polymorphicdependencybase',
            name='parent',
            field=models.ForeignKey(to='versionable_testapp.PolymorphicChild1', related_name='children'),
        ),
    ]
