From ef5ddb51f38a12c8355c833501fc9d1d4e20e527 Mon Sep 17 00:00:00 2001 From: Natalie Rose Date: Thu, 17 Sep 2026 01:02:24 +1000 Subject: [PATCH] AI scratchpad db fix --- lib/Lacuna/DB/Result/AIScratchPad.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Lacuna/DB/Result/AIScratchPad.pm b/lib/Lacuna/DB/Result/AIScratchPad.pm index d8a0aae9..50852cd0 100644 --- a/lib/Lacuna/DB/Result/AIScratchPad.pm +++ b/lib/Lacuna/DB/Result/AIScratchPad.pm @@ -18,8 +18,10 @@ __PACKAGE__->set_primary_key('id'); # body_id == 0 is the "whole empire" scratch pad sentinel (see Lacuna::AI::scratch # and bin//add_colonies.pl), so this relation is only meaningful for the -# per-colony pads. -__PACKAGE__->belongs_to('body', 'Lacuna::DB::Result::Map::Body', 'body_id'); +# per-colony pads. No FK constraint, or deploy() would create one that the +# sentinel row can never satisfy (see var/upgrades/4.0002.sql). +__PACKAGE__->belongs_to('body', 'Lacuna::DB::Result::Map::Body', 'body_id', + { is_foreign_key_constraint => 0, join_type => 'left' }); __PACKAGE__->belongs_to('empire', 'Lacuna::DB::Result::Empire', 'ai_empire_id'); no Moose; -- 2.51.2