# Generated by Django 3.0.3 on 2020-02-10 11:20

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Material',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', models.DateTimeField(auto_now_add=True)),
                ('type', models.PositiveSmallIntegerField(choices=[(0, 'Article'), (1, 'News')], default=0)),
                ('title', models.CharField(max_length=255)),
                ('text', models.TextField()),
                ('publish_date', models.DateTimeField(blank=True, null=True)),
                ('author', models.EmailField(max_length=254)),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.CharField(max_length=500)),
                ('user', models.EmailField(max_length=254)),
                ('material', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='comments', to='forum_app.Material')),
            ],
        ),
        migrations.CreateModel(
            name='Vote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.PositiveSmallIntegerField(choices=[(0, 'Like'), (1, 'Dislike')])),
                ('user', models.EmailField(max_length=254)),
                ('object_id', models.PositiveIntegerField()),
                ('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')),
            ],
            options={
                'unique_together': {('object_id', 'content_type', 'user')},
            },
        ),
    ]
