# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-06-13 19:48
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('newapa', '__first__'),
    ]

    operations = [
        migrations.CreateModel(
            name='AntiDos',
            fields=[
                ('ip_address', models.CharField(max_length=24, primary_key=True, serialize=False)),
                ('last_access', models.IntegerField()),
                ('hits_count', models.IntegerField()),
            ],
            options={
                'db_table': 'anti_dos',
            },
        ),
        migrations.CreateModel(
            name='BannedCookie',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('cookie_id', models.CharField(db_index=True, max_length=64)),
                ('datetime', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='BannedImages',
            fields=[
                ('md5sum', models.CharField(max_length=32, primary_key=True, serialize=False)),
                ('datetime', models.DateTimeField()),
            ],
            options={
                'db_table': 'banned_images',
            },
        ),
        migrations.CreateModel(
            name='CapLog',
            fields=[
                ('keyword', models.CharField(max_length=32)),
                ('comment_id', models.IntegerField(primary_key=True, serialize=False)),
                ('datetime', models.IntegerField()),
            ],
            options={
                'db_table': 'cap_log',
            },
        ),
        migrations.CreateModel(
            name='Captcha',
            fields=[
                ('image_name', models.CharField(max_length=32, primary_key=True, serialize=False)),
                ('image_file', models.ImageField(null=True, upload_to='capture/base/')),
                ('keyword', models.CharField(max_length=32)),
                ('image_id', models.CharField(editable=False, max_length=12, null=True)),
                ('last_updated', models.IntegerField(editable=False)),
                ('num_used', models.IntegerField(editable=False)),
            ],
            options={
                'db_table': 'capture',
            },
        ),
        migrations.CreateModel(
            name='CheckedIp',
            fields=[
                ('ip_address', models.CharField(max_length=24, primary_key=True, serialize=False)),
                ('datetime', models.CharField(blank=True, max_length=24, null=True)),
            ],
            options={
                'db_table': 'checked_ip',
            },
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('comment_id', models.AutoField(primary_key=True, serialize=False)),
                ('poster_id', models.IntegerField()),
                ('cookie_id', models.CharField(max_length=64)),
                ('root_id', models.IntegerField()),
                ('parent_id', models.IntegerField()),
                ('datetime', models.IntegerField()),
                ('rating', models.SmallIntegerField(db_index=True)),
                ('picrand', models.SmallIntegerField()),
                ('tcrc', models.IntegerField()),
                ('captxt', models.CharField(max_length=16)),
                ('text', models.TextField(blank=True, null=True)),
                ('source', models.TextField(blank=True, null=True)),
                ('deleted', models.BooleanField(db_index=True, default=False)),
            ],
            options={
                'db_table': 'comments',
            },
        ),
        migrations.CreateModel(
            name='ComNoUp',
            fields=[
                ('comment_id', models.IntegerField(primary_key=True, serialize=False)),
                ('down', models.SmallIntegerField()),
            ],
            options={
                'db_table': 'com_no_up',
            },
        ),
        migrations.CreateModel(
            name='Cookies',
            fields=[
                ('cookie_id', models.CharField(max_length=6, primary_key=True, serialize=False)),
                ('creation_date', models.IntegerField()),
                ('datetime', models.IntegerField()),
                ('ban_votes', models.IntegerField()),
                ('ua_crc', models.IntegerField()),
                ('provider_crc', models.IntegerField()),
                ('rnd_code', models.IntegerField()),
                ('ip_address', models.CharField(max_length=23)),
            ],
            options={
                'db_table': 'cookies',
            },
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('text_id', models.CharField(max_length=12, primary_key=True, serialize=False)),
                ('entry_id', models.IntegerField()),
                ('datetime', models.IntegerField()),
                ('x_size', models.SmallIntegerField()),
                ('y_size', models.SmallIntegerField()),
                ('extension', models.CharField(db_column='extencion', max_length=5)),
                ('md5sum', models.CharField(max_length=32)),
                ('img_hash', models.CharField(db_index=True, editable=False, max_length=255, null=True)),
                ('no_big_image', models.IntegerField(blank=True, null=True)),
                ('poster_ip', models.CharField(max_length=23)),
                ('uses', models.IntegerField(default=0)),
                ('deleted', models.BooleanField(default=False)),
                ('banned', models.BooleanField(default=False)),
            ],
            options={
                'db_table': 'images',
            },
        ),
        migrations.CreateModel(
            name='Inbox',
            fields=[
                ('number', models.IntegerField(primary_key=True, serialize=False)),
                ('datetime', models.IntegerField(blank=True, null=True)),
                ('pass_field', models.CharField(blank=True, db_column='pass', max_length=32, null=True)),
                ('text', models.TextField(blank=True, null=True)),
            ],
            options={
                'db_table': 'inbox',
            },
        ),
        migrations.CreateModel(
            name='IpCountryTable',
            fields=[
                ('start_ip', models.IntegerField(primary_key=True, serialize=False)),
                ('end_ip', models.IntegerField()),
                ('country_code', models.CharField(max_length=2)),
            ],
            options={
                'db_table': 'ip_country_table',
            },
        ),
        migrations.CreateModel(
            name='Members',
            fields=[
                ('member_id', models.AutoField(primary_key=True, serialize=False)),
                ('rights', models.SmallIntegerField()),
                ('last_view', models.IntegerField()),
                ('last_visit', models.IntegerField()),
                ('login', models.CharField(max_length=16)),
                ('password', models.CharField(max_length=32)),
            ],
            options={
                'db_table': 'members',
            },
        ),
        migrations.CreateModel(
            name='Polls',
            fields=[
                ('comment_id', models.IntegerField(primary_key=True, serialize=False)),
                ('vote1', models.SmallIntegerField(blank=True, null=True)),
                ('vote2', models.SmallIntegerField(blank=True, null=True)),
                ('vote3', models.SmallIntegerField(blank=True, null=True)),
                ('vote4', models.SmallIntegerField(blank=True, null=True)),
                ('vote5', models.SmallIntegerField(blank=True, null=True)),
            ],
            options={
                'db_table': 'polls',
            },
        ),
        migrations.CreateModel(
            name='ShowAsAd',
            fields=[
                ('datetime', models.IntegerField()),
                ('comment_id', models.IntegerField(primary_key=True, serialize=False)),
            ],
            options={
                'db_table': 'show_as_ad',
            },
        ),
        migrations.CreateModel(
            name='Spammers',
            fields=[
                ('ip_address', models.CharField(max_length=23, primary_key=True, serialize=False)),
                ('datetime', models.IntegerField()),
                ('reason', models.TextField()),
            ],
            options={
                'db_table': 'spammers',
            },
        ),
        migrations.CreateModel(
            name='Sticker',
            fields=[
                ('root_id', models.IntegerField(primary_key=True, serialize=False)),
                ('category', models.IntegerField()),
            ],
            options={
                'db_table': 'sticker',
            },
        ),
        migrations.CreateModel(
            name='Title',
            fields=[
                ('title_id', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=80)),
            ],
            options={
                'db_table': 'titles',
            },
        ),
        migrations.CreateModel(
            name='Votes',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comment_id', models.IntegerField()),
                ('cookie_id', models.CharField(max_length=6)),
                ('br_crc', models.IntegerField()),
                ('ip_part', models.IntegerField()),
                ('datetime', models.IntegerField()),
                ('value', models.SmallIntegerField()),
            ],
            options={
                'db_table': 'votes',
            },
        ),
        migrations.CreateModel(
            name='WrongLogins',
            fields=[
                ('ip_addr', models.CharField(max_length=23, primary_key=True, serialize=False)),
                ('last_attempt', models.IntegerField()),
                ('attempts_count', models.SmallIntegerField()),
            ],
            options={
                'db_table': 'wrong_logins',
            },
        ),
        migrations.CreateModel(
            name='Lenta',
            fields=[
                ('root', models.OneToOneField(db_column='root_id', on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='apa.Comment')),
                ('sticker', models.SmallIntegerField(db_index=True)),
                ('drowner', models.SmallIntegerField(db_index=True)),
                ('roulette', models.SmallIntegerField()),
                ('poll', models.SmallIntegerField()),
                ('hidden', models.SmallIntegerField(db_index=True)),
                ('replies', models.IntegerField()),
                ('rating', models.IntegerField(db_index=True, default=0, editable=False)),
                ('datetime', models.IntegerField(db_index=True)),
                ('category', models.ForeignKey(db_column='category', on_delete=django.db.models.deletion.DO_NOTHING, to='newapa.Category')),
            ],
            options={
                'db_table': 'lenta',
            },
        ),
        migrations.AlterUniqueTogether(
            name='votes',
            unique_together=set([('comment_id', 'cookie_id')]),
        ),
        migrations.AlterUniqueTogether(
            name='sticker',
            unique_together=set([('category', 'root_id')]),
        ),
        migrations.AddField(
            model_name='comment',
            name='image',
            field=models.ForeignKey(blank=True, db_column='image_id', max_length=12, null=True, on_delete=django.db.models.deletion.CASCADE, to='apa.Image'),
        ),
        migrations.AddField(
            model_name='comment',
            name='title',
            field=models.ForeignKey(db_column='title_id', null=True, on_delete=django.db.models.deletion.CASCADE, to='apa.Title'),
        ),
        migrations.AlterIndexTogether(
            name='lenta',
            index_together=set([('drowner', 'hidden', 'category', 'sticker', 'datetime'), ('drowner', 'hidden', 'category'), ('drowner', 'hidden', 'rating'), ('drowner', 'hidden', 'datetime'), ('drowner', 'hidden')]),
        ),
    ]
