from django.db import migrations, models
from django.db.models import Q
class Migration(migrations.Migration):
    dependencies=[("training","0004_player_legacy_assets")]
    operations=[
        migrations.AlterField(model_name="playerlegacyasset",name="asset_type",field=models.CharField(choices=[("TRAINING_FACILITY","Dedicated training facility"),("TRAINING_EQUIPMENT","Special training equipment"),("HIGH_QUALITY_CARD_OPTION","High-quality new-card option"),("RESTAURANT","Restaurant and recovery utility")],max_length=40)),
        migrations.RemoveConstraint(model_name="playerlegacyasset",name="legacyasset_valid_type"),
        migrations.AddConstraint(model_name="playerlegacyasset",constraint=models.CheckConstraint(condition=Q(asset_type__in=["TRAINING_FACILITY","TRAINING_EQUIPMENT","HIGH_QUALITY_CARD_OPTION","RESTAURANT"]),name="legacyasset_valid_type")),
        migrations.AlterField(model_name="playerlegacyassetassignment",name="event_type",field=models.CharField(choices=[("INITIAL_ASSIGNMENT","Initial assignment"),("RETIREMENT_RELEASE","Released on retirement"),("SUCCESSOR_INHERITANCE","Inherited by successor"),("OWNER_ASSIGNMENT","Owner assignment"),("OWNER_RELEASE","Owner release"),("LEASE_ASSIGNMENT","Lease assignment"),("LEASE_RELEASE","Lease release")],max_length=32)),
        migrations.RemoveConstraint(model_name="playerlegacyassetassignment",name="legacyassign_valid_type"),
        migrations.RemoveConstraint(model_name="playerlegacyassetassignment",name="legacyassign_shape_consistent"),
        migrations.AddConstraint(model_name="playerlegacyassetassignment",constraint=models.CheckConstraint(condition=Q(event_type__in=["INITIAL_ASSIGNMENT","RETIREMENT_RELEASE","SUCCESSOR_INHERITANCE","OWNER_ASSIGNMENT","OWNER_RELEASE","LEASE_ASSIGNMENT","LEASE_RELEASE"]),name="legacyassign_valid_type")),
        migrations.AddConstraint(model_name="playerlegacyassetassignment",constraint=models.CheckConstraint(condition=(Q(event_type="INITIAL_ASSIGNMENT",from_player__isnull=True,to_player__isnull=False,retirement_case__isnull=True)|Q(event_type="RETIREMENT_RELEASE",from_player__isnull=False,to_player__isnull=True,retirement_case__isnull=False)|Q(event_type="SUCCESSOR_INHERITANCE",from_player__isnull=False,to_player__isnull=False,retirement_case__isnull=False)|Q(event_type="OWNER_ASSIGNMENT",to_player__isnull=False,retirement_case__isnull=True)|Q(event_type="OWNER_RELEASE",from_player__isnull=False,to_player__isnull=True,retirement_case__isnull=True)|Q(event_type="LEASE_ASSIGNMENT",to_player__isnull=False,retirement_case__isnull=True)|Q(event_type="LEASE_RELEASE",from_player__isnull=False,to_player__isnull=True,retirement_case__isnull=True)),name="legacyassign_shape_consistent")),
    ]
