diff --git a/core/migrations/0010_alter_piecestate_dislodged_from.py b/core/migrations/0010_alter_piecestate_dislodged_from.py new file mode 100644 index 0000000..dcef872 --- /dev/null +++ b/core/migrations/0010_alter_piecestate_dislodged_from.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2 on 2021-05-10 15:23 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('core', '0009_piece_turn_destroyed'), + ] + + operations = [ + migrations.AlterField( + model_name='piecestate', + name='dislodged_from', + field=models.ForeignKey(blank=True, help_text="True if the piece was dislodged via a land attack during this turn. The piece's attacker_territory field will be set to this value next turn.", null=True, on_delete=django.db.models.deletion.CASCADE, related_name='pieces_dislodged_from_here', to='core.territory'), + ), + ] diff --git a/core/models/piece.py b/core/models/piece.py index f4e1ea3..c88b143 100644 --- a/core/models/piece.py +++ b/core/models/piece.py @@ -110,7 +110,7 @@ class PieceState(PerTurnModel): on_delete=models.CASCADE, related_name='piece_dislodged', ) - dislodged_from = models.OneToOneField( + dislodged_from = models.ForeignKey( 'Territory', blank=True, null=True,