# Generated by Django 2.0.1 on 2018-04-18 14:58

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Author',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('first_name', models.CharField(blank=True, max_length=25, verbose_name='Овог')),
                ('last_name', models.CharField(max_length=25, verbose_name='Нэр')),
                ('image', models.ImageField(blank=True, default='profile_images/default_user.png', upload_to='profile_images', verbose_name='Зураг')),
                ('profession', models.CharField(blank=True, max_length=20, verbose_name='Мэргэжил')),
                ('graduated_school', models.CharField(blank=True, max_length=40, verbose_name='Төгссөн сургууль')),
                ('about', models.TextField(blank=True, verbose_name='Тухай')),
                ('rank', models.CharField(blank=True, max_length=20, verbose_name='Албан тушаал')),
            ],
            options={
                'verbose_name': 'Зохиолч',
                'verbose_name_plural': 'Зохиолчид',
                'ordering': ('first_name',),
            },
        ),
        migrations.CreateModel(
            name='Creation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=150, verbose_name='Гарчиг')),
                ('co_authors', models.TextField(verbose_name='Хамтран зохиогчид')),
                ('type', models.CharField(max_length=50, verbose_name='Бүтээлийн төрөл')),
                ('category', models.CharField(max_length=50, verbose_name='Бүтээлийн ангилал')),
                ('subclass', models.CharField(max_length=50, verbose_name='Дэд ангилал')),
                ('overview', models.TextField(verbose_name='Бүтээлийн товч')),
                ('keyword', models.CharField(max_length=100, verbose_name='Түлхүүр үг')),
                ('created_date', models.DateField(verbose_name='Бүтээл бичигдсэн огноо')),
                ('language', models.CharField(choices=[('en', 'English'), ('mn', 'Монгол')], max_length=10, verbose_name='Хэл')),
                ('file', models.FileField(blank=True, null=True, upload_to='files', verbose_name='Файл')),
                ('price', models.IntegerField(default=0)),
                ('num_of_page', models.PositiveSmallIntegerField(verbose_name='Хуудасны тоо')),
                ('uploaded_date', models.DateField(auto_now=True)),
                ('count_overview', models.IntegerField(blank=True, default=0, editable=False)),
                ('total_downloads', models.IntegerField(blank=True, default=0, editable=False)),
                ('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='creations', to='main_app.Author', verbose_name='Зохиолч')),
            ],
            options={
                'verbose_name': 'Бүтээл',
                'verbose_name_plural': 'Бүтээлүүд',
                'ordering': ('-uploaded_date',),
            },
        ),
        migrations.CreateModel(
            name='CreationViewHit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ip', models.CharField(max_length=40)),
                ('session', models.CharField(max_length=40)),
                ('created', models.DateTimeField(auto_now=True)),
                ('model', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='views', to='main_app.Creation')),
            ],
        ),
        migrations.CreateModel(
            name='ViewHit',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ip', models.CharField(max_length=40)),
                ('session', models.CharField(max_length=40)),
                ('created', models.DateTimeField(auto_now=True)),
                ('model', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='views', to='main_app.Author')),
            ],
        ),
    ]
