# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-21 07:09
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 = [
        ('auth', '0008_alter_user_username_max_length'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Avatar',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('avatar_raw', models.ImageField(default='', upload_to='upload/%Y%m%d', verbose_name='User upload avatar')),
                ('avatar_l', models.ImageField(default='', upload_to='avatar/%Y%m%d', verbose_name='large avatar')),
                ('avatar_m', models.ImageField(default='', upload_to='avatar/%Y%m%d', verbose_name='medium avatar')),
                ('avatar_s', models.ImageField(default='', upload_to='avatar/%Y%m%d', verbose_name='small avatar')),
                ('deleted', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now=True, db_index=True)),
                ('detail', models.TextField()),
                ('read', models.BooleanField(default=False)),
                ('deleted', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ['-date'],
            },
        ),
        migrations.CreateModel(
            name='ReputationStat',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(auto_now=True)),
                ('stat_type', models.IntegerField()),
                ('amount', models.IntegerField()),
                ('total', models.IntegerField()),
                ('topic_id', models.IntegerField(blank=True, null=True)),
                ('node_id', models.IntegerField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='profile', serialize=False, to=settings.AUTH_USER_MODEL, verbose_name='user')),
                ('oauth', models.CharField(blank=True, max_length=16, null=True)),
                ('display_name', models.CharField(blank=True, max_length=256, null=True)),
                ('website', models.URLField(blank=True, null=True)),
                ('location', models.CharField(blank=True, max_length=256, null=True)),
                ('company', models.CharField(blank=True, max_length=256, null=True)),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('description', models.CharField(blank=True, max_length=256, null=True)),
                ('github', models.URLField(blank=True, null=True)),
                ('gitlab', models.URLField(blank=True, null=True)),
                ('profile_init_reward', models.BooleanField(default=False)),
                ('last_modified', models.DateTimeField(auto_now=True, null=True)),
                ('reputation', models.IntegerField(default=0)),
                ('has_notification', models.BooleanField(default=False)),
                ('avatar', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='niuauth.Avatar')),
                ('following', models.ManyToManyField(blank=True, related_name='follower', to='niuauth.UserProfile')),
            ],
            options={
                'db_table': 'user_profile',
            },
        ),
        migrations.AddField(
            model_name='reputationstat',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='repu_stat', to=settings.AUTH_USER_MODEL),
        ),
        migrations.AddField(
            model_name='notification',
            name='user',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL),
        ),
    ]
