-- Remove vessel → site relationship (vessels are standalone cost centres)
ALTER TABLE "Vessel" DROP COLUMN IF EXISTS "siteId";

-- Restore vesselId as required on PurchaseOrder
-- First null out any rows that have no vesselId (set to first vessel as fallback, should be none in practice)
UPDATE "PurchaseOrder" SET "vesselId" = (SELECT id FROM "Vessel" LIMIT 1) WHERE "vesselId" IS NULL;
ALTER TABLE "PurchaseOrder" ALTER COLUMN "vesselId" SET NOT NULL;
