# Generated by Django 6.0.1 on 2026-06-14 10:48

import uuid
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0002_add_note_model'),
    ]

    operations = [
        migrations.CreateModel(
            name='ReferenceSequence',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('prefix', models.CharField(db_index=True, help_text='Module prefix, e.g. CMP/INQ/OBS/APR/SGT', max_length=8)),
                ('hospital_token', models.CharField(db_index=True, help_text='Sanitized hospital code', max_length=24)),
                ('year_month', models.CharField(db_index=True, help_text='YYYYMM', max_length=6)),
                ('last_number', models.IntegerField(default=0)),
            ],
            options={
                'indexes': [models.Index(fields=['prefix', 'hospital_token', 'year_month'], name='core_refere_prefix_a449a6_idx')],
                'unique_together': {('prefix', 'hospital_token', 'year_month')},
            },
        ),
    ]
