# Generated by Django 4.2.29 on 2026-03-10 13:49

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('textdocs', '0001_initial'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='document',
            name='conclusion',
        ),
        migrations.RemoveField(
            model_name='document',
            name='introduction',
        ),
        migrations.RemoveField(
            model_name='document',
            name='main_body',
        ),
        migrations.AddField(
            model_name='document',
            name='author',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL),
            preserve_default=False,
        ),
        migrations.CreateModel(
            name='DocumentVersion',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('version_number', models.PositiveIntegerField()),
                ('introduction', models.TextField()),
                ('main_body', models.TextField()),
                ('conclusion', models.TextField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('document', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='versions', to='textdocs.document')),
            ],
            options={
                'ordering': ['-version_number'],
                'unique_together': {('document', 'version_number')},
            },
        ),
    ]
