# Generated by Django 6.0.1 on 2026-01-23 16:06

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Project',
            fields=[
                ('id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('sessions_count', models.PositiveIntegerField(default=0)),
                ('mtime', models.FloatField(default=0)),
                ('archived', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ['-mtime'],
            },
        ),
        migrations.CreateModel(
            name='Session',
            fields=[
                ('id', models.CharField(max_length=255, primary_key=True, serialize=False)),
                ('last_offset', models.PositiveBigIntegerField(default=0)),
                ('last_line', models.PositiveIntegerField(default=0)),
                ('mtime', models.FloatField(default=0)),
                ('archived', models.BooleanField(default=False)),
                ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sessions', to='core.project')),
            ],
            options={
                'ordering': ['-mtime'],
            },
        ),
        migrations.CreateModel(
            name='SessionItem',
            fields=[
                ('id', models.BigAutoField(primary_key=True, serialize=False)),
                ('line_num', models.PositiveIntegerField()),
                ('content', models.TextField()),
                ('session', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='items', to='core.session')),
            ],
            options={
                'ordering': ['line_num'],
                'constraints': [models.UniqueConstraint(fields=('session', 'line_num'), name='unique_session_line')],
            },
        ),
    ]
