# Generated by Django 2.1 on 2018-08-14 16:34

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Discussione',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('titolo', models.CharField(max_length=120)),
                ('data_creazione', models.DateTimeField(auto_now_add=True)),
                ('autore_discussione', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='discussioni', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'discussione',
                'verbose_name_plural': 'discussioni',
            },
        ),
        migrations.CreateModel(
            name='Post',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('contenuto', models.TextField()),
                ('data_creazione', models.DateTimeField(auto_now_add=True)),
                ('autore_post', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='posts', to=settings.AUTH_USER_MODEL)),
                ('discussione', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='forum.Discussione')),
            ],
            options={
                'verbose_name': 'post',
                'verbose_name_plural': 'posts',
            },
        ),
        migrations.CreateModel(
            name='Sezione',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nome_sezione', models.CharField(max_length=80)),
                ('descrizione', models.CharField(blank=True, max_length=150, null=True)),
                ('logo_sezione', models.ImageField(blank=True, null=True, upload_to='')),
            ],
            options={
                'verbose_name': 'sezione',
                'verbose_name_plural': 'sezioni',
            },
        ),
        migrations.AddField(
            model_name='discussione',
            name='sezione_di_appartenenza',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='forum.Sezione'),
        ),
    ]
