# Generated by Django 5.2.7 on 2026-02-17 18:15

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Group',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField()),
                ('group_type', models.CharField(choices=[('circle', 'Circle (4–12 members)'), ('community', 'Community (Open)'), ('mastermind', 'Mastermind (Structured Recurring)'), ('event_based', 'Event Based'), ('private_invite', 'Private Invite')], max_length=50)),
                ('intent_type', models.CharField(choices=[('friendship', 'Friendship'), ('networking', 'Networking'), ('activity', 'Activity'), ('accountability', 'Accountability')], max_length=50)),
                ('transition_focus', models.CharField(blank=True, max_length=100, null=True)),
                ('visibility', models.CharField(choices=[('public_members', 'Public (Members Only)'), ('private_request', 'Private (Request to Join)'), ('invite_only', 'Invite Only')], default='public_members', max_length=50)),
                ('capacity', models.PositiveIntegerField(blank=True, null=True)),
                ('location_scope', models.CharField(choices=[('local', 'Local'), ('virtual', 'Virtual')], default='local', max_length=20)),
                ('city', models.CharField(blank=True, max_length=100, null=True)),
                ('state', models.CharField(blank=True, max_length=100, null=True)),
                ('recurring_schedule', models.TextField(blank=True, help_text='Required for Mastermind groups. Use structured text or JSON.', null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('cover_image', models.ImageField(blank=True, null=True, upload_to='groups/covers/')),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='created_groups_v2', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='GroupMember',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('role', models.CharField(choices=[('member', 'Member'), ('moderator', 'Moderator'), ('owner', 'Owner')], default='member', max_length=20)),
                ('status', models.CharField(choices=[('active', 'Active'), ('pending', 'Pending')], default='active', max_length=20)),
                ('joined_at', models.DateTimeField(auto_now_add=True)),
                ('group', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='memberships', to='groups.group')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='group_memberships', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'unique_together': {('group', 'user')},
            },
        ),
    ]
