# -*- coding: utf-8 -*-
# Generated by Django 1.9.5 on 2016-07-16 15:45
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='Group',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=64, verbose_name='部门')),
                ('memo', models.TextField(blank=True, null=True, verbose_name='备注')),
            ],
            options={
                'verbose_name': '部门',
                'verbose_name_plural': '部门',
            },
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=32, verbose_name='姓名')),
                ('head_img', models.ImageField(blank=True, null=True, upload_to='uploads/portrait', verbose_name='头像')),
                ('email', models.EmailField(blank=True, max_length=64, null=True, verbose_name='邮箱')),
                ('phone', models.CharField(max_length=128, verbose_name='手机号')),
                ('ip', models.GenericIPAddressField(verbose_name='办公IP')),
                ('secret_key', models.TextField(verbose_name='密钥')),
                ('memo', models.TextField(blank=True, null=True, verbose_name='备注')),
                ('create_date', models.DateField(auto_now=True, verbose_name='注册时间')),
                ('department', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='member.Group', verbose_name='部门')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='后台用户')),
            ],
            options={
                'verbose_name': '成员',
                'verbose_name_plural': '成员',
            },
        ),
        migrations.AddField(
            model_name='group',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='member.UserProfile', verbose_name='负责人'),
        ),
    ]
