# Generated by Django 5.1.4 on 2024-12-25 05:10

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


class Migration(migrations.Migration):

    dependencies = [
        ('hotels', '0002_initial'),
        ('users', '0001_initial'),
    ]

    operations = [
        migrations.RenameField(
            model_name='hotel',
            old_name='external_id',
            new_name='external_id_pms',
        ),
        migrations.AddField(
            model_name='userhotel',
            name='user',
            field=models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, related_name='user_hotels', to='users.user', verbose_name='Пользователь'),
            preserve_default=False,
        ),
        migrations.AddIndex(
            model_name='apirequestlog',
            index=models.Index(fields=['api'], name='hotels_apir_api_id_686bb0_idx'),
        ),
        migrations.AddIndex(
            model_name='apirequestlog',
            index=models.Index(fields=['request_time'], name='hotels_apir_request_f65147_idx'),
        ),
        migrations.AddIndex(
            model_name='fraudlog',
            index=models.Index(fields=['reservation_id'], name='hotels_frau_reserva_5a26b7_idx'),
        ),
        migrations.AddIndex(
            model_name='fraudlog',
            index=models.Index(fields=['detected_at'], name='hotels_frau_detecte_07e626_idx'),
        ),
        migrations.AddIndex(
            model_name='reservation',
            index=models.Index(fields=['hotel', 'check_in', 'check_out'], name='hotels_rese_hotel_i_6c527e_idx'),
        ),
        migrations.AddIndex(
            model_name='room',
            index=models.Index(fields=['hotel', 'number'], name='hotels_room_hotel_i_a7c4fc_idx'),
        ),
        migrations.AddConstraint(
            model_name='room',
            constraint=models.UniqueConstraint(fields=('hotel', 'number'), name='unique_hotel_room'),
        ),
    ]
