# Generated by Django 2.2.16 on 2021-02-26 07:36

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='Location',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='我的家', max_length=256)),
                ('is_default', models.BooleanField(default=True)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='locations', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='LocationMemberInvitation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('invite_code', models.CharField(max_length=6)),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='member_invitations', to='location.Location')),
            ],
        ),
        migrations.CreateModel(
            name='LocationMember',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('role', models.PositiveSmallIntegerField(choices=[(0, 'family'), (1, 'housekeeping')], default=0)),
                ('status', models.PositiveSmallIntegerField(choices=[(0, 'family'), (1, 'housekeeping')], default=0)),
                ('location', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='members', to='location.Location')),
                ('member', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='member_of_locations', to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
