# Generated by Django 3.0.8 on 2020-07-30 19:47

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Contribution',
            fields=[
                ('id_contribution', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.TextField(max_length=80)),
                ('creation_date', models.DateTimeField(auto_now_add=True)),
                ('comments', models.IntegerField(default=0)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('points', models.ManyToManyField(blank=True, related_name='points', to=settings.AUTH_USER_MODEL)),
                ('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_hackernews.contribution_set+', to='contenttypes.ContentType')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
        ),
        migrations.CreateModel(
            name='ContributionAsk',
            fields=[
                ('contribution_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='hackernews.Contribution')),
                ('text', models.TextField(default='I am a text')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('hackernews.contribution',),
        ),
        migrations.CreateModel(
            name='ContributionAskUrl',
            fields=[
                ('contribution_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='hackernews.Contribution')),
                ('url', models.URLField()),
                ('text', models.TextField(default='I am a text')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('hackernews.contribution',),
        ),
        migrations.CreateModel(
            name='ContributionUrl',
            fields=[
                ('contribution_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='hackernews.Contribution')),
                ('url', models.URLField(unique=True)),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('hackernews.contribution',),
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('about', models.TextField(blank=True, max_length=500)),
                ('karma', models.IntegerField(default=1)),
                ('apikey', models.CharField(max_length=100, unique=True)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Upvoted',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('contribution', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='hackernews.Contribution')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='ContributionComment',
            fields=[
                ('contribution_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='hackernews.Contribution')),
                ('text', models.TextField(default='I am a comment')),
                ('contribution_ref', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='hackernews.Contribution')),
                ('parent', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='iam_reply', to='hackernews.ContributionComment')),
            ],
            options={
                'abstract': False,
                'base_manager_name': 'objects',
            },
            bases=('hackernews.contribution',),
        ),
    ]
