# Generated by Django 2.2.1 on 2019-05-18 20:40

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='EmailPro',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(max_length=20, verbose_name='验证码')),
                ('email', models.EmailField(max_length=50, verbose_name='邮箱')),
                ('send_type', models.CharField(choices=[('register', '邮箱注册'), ('forget', '忘记密码')], max_length=6, verbose_name='发送类型')),
                ('send_time', models.DateTimeField(auto_now_add=True, verbose_name='发送时间')),
            ],
            options={
                'verbose_name': '邮箱验证码',
                'verbose_name_plural': '邮箱验证码',
                'db_table': 'emailpro',
            },
        ),
        migrations.CreateModel(
            name='NewsInformation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255, verbose_name='新闻标题')),
                ('content', models.TextField(verbose_name='新闻内容')),
                ('author', models.CharField(max_length=30, verbose_name='新闻发布者')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='新闻发布时间')),
            ],
            options={
                'verbose_name': '新闻资讯',
                'verbose_name_plural': '新闻资讯',
                'db_table': 'news',
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('username', models.CharField(max_length=30, verbose_name='用户名')),
                ('password', models.CharField(max_length=255, verbose_name='密码')),
                ('gender', models.CharField(choices=[('male', '男'), ('female', '女')], default='male', max_length=10, verbose_name='性别')),
                ('email', models.EmailField(max_length=254, verbose_name='电子邮箱')),
                ('birthday', models.DateField(blank=True, null=True, verbose_name='生日')),
                ('telephone', models.CharField(blank=True, max_length=12, null=True, verbose_name='手机号')),
                ('QQ', models.CharField(blank=True, max_length=12, null=True, verbose_name='qq号')),
                ('headPortrait', models.CharField(default='/static/images/guanyu.jpg', max_length=200, verbose_name='头像路径')),
                ('signature', models.TextField(blank=True, null=True, verbose_name='个人签名')),
                ('regTime', models.DateTimeField(auto_now_add=True, verbose_name='注册时间')),
                ('isActive', models.BooleanField(default=1, verbose_name='账号是否激活')),
            ],
            options={
                'verbose_name': '用户信息',
                'verbose_name_plural': '用户信息',
                'db_table': 'user',
            },
        ),
        migrations.CreateModel(
            name='Village',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, verbose_name='地区名称')),
            ],
            options={
                'verbose_name': '地区',
                'verbose_name_plural': '地区',
                'db_table': 'village',
            },
        ),
        migrations.CreateModel(
            name='UserHistory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('add_time', models.DateTimeField(auto_now_add=True, null=True, verbose_name='浏览时间')),
                ('houseH', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homelink.HouseInfo', verbose_name='房源')),
                ('userH', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='index.User', verbose_name='用户')),
            ],
            options={
                'verbose_name': '浏览记录',
                'verbose_name_plural': '浏览记录',
                'db_table': 'history',
            },
        ),
        migrations.CreateModel(
            name='UserFocus',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('add_time', models.DateTimeField(auto_now_add=True)),
                ('houseF', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homelink.HouseInfo')),
                ('userF', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='index.User')),
            ],
            options={
                'verbose_name': '关注',
                'verbose_name_plural': '关注',
                'db_table': 'focus',
            },
        ),
        migrations.CreateModel(
            name='UserComment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('satisfied', models.IntegerField(choices=[(1, '好评'), (2, '中评'), (3, '差评')], verbose_name='满意度')),
                ('content', models.TextField(verbose_name='评论内容')),
                ('create_time', models.DateTimeField(auto_now_add=True, verbose_name='评论时间')),
                ('house', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homelink.HouseInfo')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user', to='index.User')),
            ],
            options={
                'verbose_name': '评论',
                'verbose_name_plural': '评论',
                'db_table': 'comment',
            },
        ),
        migrations.CreateModel(
            name='UserAdvice',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('nickname', models.CharField(max_length=30, verbose_name='昵称')),
                ('email', models.EmailField(max_length=254, verbose_name='用户邮箱')),
                ('advices', models.TextField(verbose_name='用户建议')),
                ('reversion', models.TextField(blank=True, null=True, verbose_name='回复')),
                ('add_time', models.DateTimeField(auto_now_add=True, null=True, verbose_name='提建议时间')),
                ('userA', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='index.User', verbose_name='用户')),
            ],
            options={
                'verbose_name': '申诉建议',
                'verbose_name_plural': '申诉建议',
                'db_table': 'advice',
            },
        ),
        migrations.AddField(
            model_name='user',
            name='userFo',
            field=models.ManyToManyField(related_name='guanzhu', through='index.UserFocus', to='homelink.HouseInfo'),
        ),
        migrations.AddField(
            model_name='user',
            name='userHi',
            field=models.ManyToManyField(related_name='history', through='index.UserHistory', to='homelink.HouseInfo'),
        ),
        migrations.CreateModel(
            name='SpecifyThePurchase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('location', models.IntegerField(verbose_name='位置')),
                ('housetype', models.CharField(choices=[('zufang', '租房'), ('xinfang', '新房'), ('ershoufang', '二手房')], default='zufang', max_length=30, verbose_name='找房类型')),
                ('addressinfo', models.CharField(max_length=50, verbose_name='详细地址')),
                ('telephone', models.CharField(max_length=11, verbose_name='联系方式')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='指定时间')),
                ('mod_time', models.DateTimeField(auto_now=True, verbose_name='修改时间')),
                ('userS', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='index.User', verbose_name='用户')),
                ('villageS', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='index.Village', verbose_name='地区')),
            ],
            options={
                'verbose_name': '指定购房',
                'verbose_name_plural': '指定购房',
                'db_table': 'specifythepurchase',
            },
        ),
        migrations.CreateModel(
            name='Release',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('add_time', models.DateTimeField(auto_now_add=True, verbose_name='发布时间')),
                ('mod_time', models.DateTimeField(auto_now=True, verbose_name='修改时间')),
                ('houseR', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homelink.HouseInfo', verbose_name='房源')),
                ('userR', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='index.User', verbose_name='用户')),
            ],
            options={
                'verbose_name': '用户发布信息',
                'verbose_name_plural': '用户发布信息',
                'db_table': 'release',
            },
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=30, verbose_name='位置名称')),
                ('villageLocation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='village', to='index.Village', verbose_name='地区')),
            ],
            options={
                'verbose_name': '地区位置',
                'verbose_name_plural': '地区位置',
                'db_table': 'location',
            },
        ),
        migrations.CreateModel(
            name='UserAgent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('relname', models.CharField(max_length=30, verbose_name='真实姓名')),
                ('identity', models.CharField(max_length=30, verbose_name='身份证信息')),
                ('workage', models.IntegerField(verbose_name='工作年限')),
                ('isTelephone', models.BooleanField(default=1, verbose_name='是否显示联系方式')),
                ('img', models.CharField(default='/static/media/zhongjieImg/guoxiangyu.jpg', max_length=255, verbose_name='经纪人照片')),
                ('message', models.TextField(verbose_name='个人描述')),
                ('isActive', models.BooleanField(default=0, verbose_name='审核是否通过')),
                ('userAgent', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='index.User', verbose_name='用户名')),
                ('villageAgent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='index.Village', verbose_name='地区')),
            ],
            options={
                'verbose_name': '经纪人信息',
                'verbose_name_plural': '经纪人信息',
                'db_table': 'agent',
                'unique_together': {('userAgent',)},
            },
        ),
        migrations.AlterUniqueTogether(
            name='user',
            unique_together={('username', 'email', 'telephone', 'QQ')},
        ),
    ]
