# Generated by Django 2.2 on 2019-04-11 07:19

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='CategoryContent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=12, verbose_name='内容类别')),
                ('parent', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='user.CategoryContent')),
            ],
        ),
        migrations.CreateModel(
            name='CategoryWrite',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=12, verbose_name='书体名称')),
            ],
        ),
        migrations.CreateModel(
            name='HandWrite',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=256, verbose_name='标题')),
                ('info', models.TextField(verbose_name='作品简介')),
                ('flag', models.BooleanField(default=False, verbose_name='审核情况')),
                ('score', models.IntegerField(default=0, verbose_name='点赞数')),
                ('file_path', models.CharField(max_length=256)),
                ('create_date', models.DateTimeField(default=datetime.datetime.now)),
                ('category_super', models.IntegerField(default=0, null=True, verbose_name='管理员的分类')),
                ('category_content', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.CategoryContent', verbose_name='内容分类')),
                ('category_write', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.CategoryWrite', verbose_name='书体分类')),
            ],
        ),
        migrations.CreateModel(
            name='Union',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=12, verbose_name='盟团名称')),
                ('status', models.IntegerField(default=0, verbose_name='审核状态')),
                ('active', models.IntegerField(default=0, verbose_name='活跃度')),
                ('create_date', models.DateTimeField(default=datetime.datetime.now)),
                ('content', models.TextField()),
                ('cover', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='user.HandWrite', verbose_name='封面作品')),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=12, verbose_name='用户名')),
                ('passwd', models.CharField(max_length=512, verbose_name='密码')),
                ('email', models.EmailField(max_length=254, verbose_name='邮箱地址')),
                ('permission', models.IntegerField(default=2, verbose_name='用户类型')),
                ('status', models.IntegerField(default=0, verbose_name='用户状态')),
            ],
        ),
        migrations.CreateModel(
            name='UserInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('create_date', models.DateTimeField(default=datetime.datetime.now)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.User')),
            ],
        ),
        migrations.CreateModel(
            name='UnionInfo',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('content', models.TextField()),
                ('create_date', models.DateTimeField(default=datetime.datetime.now)),
                ('union', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.Union')),
            ],
        ),
        migrations.AddField(
            model_name='union',
            name='owner',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='owner', to='user.User', verbose_name='管理者'),
        ),
        migrations.AddField(
            model_name='union',
            name='users',
            field=models.ManyToManyField(related_name='members', to='user.User'),
        ),
        migrations.CreateModel(
            name='KnonWrite',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=256, verbose_name='标题')),
                ('info', models.TextField(verbose_name='作品简介')),
                ('score', models.IntegerField(default=0, verbose_name='点赞数')),
                ('category_content', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.CategoryContent', verbose_name='内容分类')),
                ('category_write', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='user.CategoryWrite', verbose_name='书体分类')),
            ],
        ),
        migrations.AddField(
            model_name='handwrite',
            name='in_union',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='user.Union'),
        ),
        migrations.AddField(
            model_name='handwrite',
            name='owner',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='user.User'),
        ),
    ]
