# -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2016-12-05 14:41
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('user', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=32, verbose_name='标题')),
                ('content', models.TextField(default='', verbose_name='正文')),
                ('event_type', models.SmallIntegerField(default=0)),
                ('vote_count', models.IntegerField(default=0)),
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True, db_index=True)),
                ('author', models.OneToOneField(blank=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='user.User')),
            ],
            options={
                'verbose_name': '事件',
                'verbose_name_plural': '事件',
            },
        ),
        migrations.CreateModel(
            name='Vote',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('vote', models.SmallIntegerField(default=1)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('author', models.ForeignKey(blank=None, null=True, on_delete=django.db.models.deletion.CASCADE, to='user.User')),
                ('event', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='board.Event')),
            ],
            options={
                'verbose_name': '投票',
                'verbose_name_plural': '投票',
            },
        ),
        migrations.AlterIndexTogether(
            name='vote',
            index_together=set([('event', 'vote'), ('event', 'created_at')]),
        ),
        migrations.AlterIndexTogether(
            name='event',
            index_together=set([('created_at', 'vote_count'), ('event_type', 'created_at')]),
        ),
    ]
