"""
Phase 7 — Habits.

Generated by `makemigrations` and left as generated: it creates one table and
touches nothing that exists.

Two absences are worth reading off it, because both are decisions rather than
omissions. **There is no `streak_count` column** — the streak is a function of
the log and the schedule, and filling in a forgotten day has to repair it, which
it only can if nothing is stored. **There is no `HabitLog` table** — the log is
one `JSONField` keyed by day, because a day's entry has no identity outside its
habit and the read it gets is "the last ninety days at once".
"""

# Generated by Django 6.0.6 on 2026-09-18 12:15

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


class Migration(migrations.Migration):

    dependencies = [
        ('lifey_api', '0005_notes'),
    ]

    operations = [
        migrations.CreateModel(
            name='Habit',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('title', models.CharField(blank=True, max_length=300)),
                ('notes', models.TextField(blank=True)),
                ('icon', models.CharField(blank=True, max_length=64, null=True)),
                ('color', models.CharField(blank=True, max_length=16, null=True)),
                ('tags', models.JSONField(blank=True, default=list)),
                ('schedule', models.JSONField(blank=True, default=dict)),
                ('target', models.IntegerField(default=1)),
                ('unit', models.CharField(blank=True, max_length=32)),
                ('log', models.JSONField(blank=True, default=dict)),
                ('archived', models.BooleanField(default=False)),
                ('properties', models.JSONField(blank=True, default=dict)),
                ('is_sample', models.BooleanField(default=False)),
                ('page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='habits', to='lifey_api.page')),
            ],
            options={
                'ordering': ['id'],
                'indexes': [models.Index(fields=['page', 'archived'], name='lifey_api_h_page_id_54e332_idx')],
            },
        ),
    ]
