from __future__ import unicode_literals

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='Community',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('user_generated', models.BooleanField(default=False)),
                ('description', models.TextField(blank=True, null=True)),
                ('image', models.ImageField(blank=True, default='images/community_images/nothing.jpg', null=True, upload_to='images/community_images/%Y/%m/%d/%H_%M_%S')),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Document',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=128)),
                ('created_date', models.DateField(auto_now=True)),
                ('content', models.TextField(blank=True, null=True)),
                ('language', models.CharField(choices=[('English', 'English'), ('French', 'French')], default='EN', max_length=8)),
                ('published', models.BooleanField(default=True)),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('communities', models.ManyToManyField(blank=True, to='classifier.Community')),
                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Tag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=128)),
                ('user_generated', models.BooleanField(default=False)),
                ('description', models.TextField(blank=True, null=True)),
                ('image', models.ImageField(blank=True, default='images/tag_images/nothing.jpg', null=True, upload_to='images/tag_images/%Y/%m/%d/%H_%M_%S')),
                ('slug', models.SlugField(max_length=255, unique=True)),
                ('communities', models.ManyToManyField(to='classifier.Community')),
                ('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='document',
            name='tags',
            field=models.ManyToManyField(blank=True, to='classifier.Tag'),
        ),
    ]
