"""
Phase 10 — Focus.

Generated by `makemigrations` and left as generated: one new table, nothing
existing touched.

**`started_at` and `ended_at` are `DateTimeField`s, and they are the only two
real instants in this schema.** Every other date in the app is a `DateField`, a
JSON day key or — for Calendar — a `CharField` holding wall clock with no zone.
A focus session is a measured interval whose length is the whole point, so it
is the one thing `USE_TZ = True` is actually for. `models/focus.py` argues it.

There is no `paused_at` column: a running session lives in the client, and a row
that arrives from the server is finished.
"""

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

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


class Migration(migrations.Migration):

    dependencies = [
        ('lifey_api', '0008_bookshelf'),
    ]

    operations = [
        migrations.CreateModel(
            name='FocusSession',
            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)),
                ('focus_minutes', models.IntegerField(default=25)),
                ('break_minutes', models.IntegerField(default=5)),
                ('cycles', models.IntegerField(default=1)),
                ('mode', models.CharField(default='timer', max_length=16)),
                ('started_at', models.DateTimeField()),
                ('ended_at', models.DateTimeField(blank=True, null=True)),
                ('paused_ms', models.BigIntegerField(default=0)),
                ('focus_minutes_logged', models.IntegerField(default=0)),
                ('break_minutes_logged', models.IntegerField(default=0)),
                ('completed', models.BooleanField(default=False)),
                ('is_sample', models.BooleanField(default=False)),
                ('page', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='focus_sessions', to='lifey_api.page')),
                ('task', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='focus_sessions', to='lifey_api.task')),
                ('task_page', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='linked_focus_sessions', to='lifey_api.page')),
            ],
            options={
                'ordering': ['-started_at', '-id'],
                'indexes': [models.Index(fields=['page', '-started_at'], name='lifey_api_f_page_id_0d4e2a_idx')],
            },
        ),
    ]
