# Generated by Django 4.2.21 on 2025-07-06 16:07

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Challenge',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='name')),
                ('description', models.CharField(max_length=255, verbose_name='description')),
                ('points', models.PositiveIntegerField(verbose_name='points')),
                ('obtained', models.PositiveIntegerField(default=0, verbose_name='obtained')),
            ],
            options={
                'verbose_name': 'challenge',
                'verbose_name_plural': 'challenges',
            },
        ),
        migrations.CreateModel(
            name='Family',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, unique=True, verbose_name='name')),
                ('description', models.CharField(max_length=255, verbose_name='description')),
                ('score', models.PositiveIntegerField(default=0, verbose_name='score')),
                ('rank', models.PositiveIntegerField(verbose_name='rank')),
            ],
            options={
                'verbose_name': 'Family',
                'verbose_name_plural': 'Families',
            },
        ),
        migrations.CreateModel(
            name='Achievement',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('obtained_at', models.DateTimeField(default=django.utils.timezone.now, verbose_name='obtained at')),
                ('challenge', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='family.challenge')),
                ('family', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='family.family', verbose_name='family')),
            ],
            options={
                'verbose_name': 'achievement',
                'verbose_name_plural': 'achievements',
            },
        ),
        migrations.CreateModel(
            name='FamilyMembership',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('year', models.PositiveIntegerField(default=2025, verbose_name='year')),
                ('family', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='members', to='family.family', verbose_name='family')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='family_memberships', to=settings.AUTH_USER_MODEL, verbose_name='user')),
            ],
            options={
                'verbose_name': 'family membership',
                'verbose_name_plural': 'family memberships',
                'unique_together': {('user', 'year')},
            },
        ),
    ]
