Page MenuHomePhabricator

Update a very old Phriction migration which incorrectly uses "save()"
ClosedPublic

Authored by epriestley on Apr 15 2020, 3:03 PM.
Tags
None
Referenced Files
F18940588: D21124.diff
Tue, Nov 11, 8:42 AM
F18822406: D21124.id.diff
Thu, Oct 23, 6:35 AM
F18820953: D21124.diff
Wed, Oct 22, 6:10 PM
F18775417: D21124.id50306.diff
Oct 10 2025, 6:59 PM
F18756284: D21124.id50307.diff
Oct 5 2025, 10:36 AM
F18734232: D21124.id.diff
Sep 30 2025, 10:50 PM
F18630905: D21124.diff
Sep 16 2025, 1:34 PM
F18390000: D21124.id50306.diff
Aug 29 2025, 6:25 AM
Subscribers
Restricted Owners Package

Details

Summary

See https://discourse.phabricator-community.org/t/storage-upgrade-error/3748.

It is broadly unsafe for migrations to use "save()". If the object gains new fields later, the query will include "SET newField = X", which will fail against the old schema which is in the process of being upgraded.

Instead, migrations must issue raw SQL against the schema as it is expected to exist at the time the migration executes.

Migrations have followed this rule for a long time, but this ~6 year old migration was overlooked. Update it to issue a raw query to perform the policy update.

Test Plan

This is somewhat flimsy since rebuilding a genuine reproduction case is messy, but used "bin/storage --apply ..." to at least get the new query to execute against modern Phabricator without issues.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable