From 52c4715bbcfb6b088cdb02b554661f879661d365 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 23 Apr 2017 04:38:38 -0700 Subject: [PATCH] No-op the Conpherence thumbnail resizing migration Summary: Fixes T12628. After later changes to `PhabricatorFile`, this migration no longer runs if you upgrade through it to a recent `HEAD` while your data has some room images. Since this isn't critical and has been available for ~6 months, I just nuked it as a first pass. I can find a more careful approach which lets us continue to run this migration instead if you're hesitant to skip this step, although it may be a little involved. In 95% of cases we avoid this by updating the storage table as it existed at the time the migraiton ran, but Files are much too complicated for that to be realistic. Test Plan: Ran `bin/storage upgrade -f --apply phabricator:20161005.conpherence.image.2.php`, saw it do nothing. Reviewers: chad Reviewed By: chad Maniphest Tasks: T12628 Differential Revision: https://secure.phabricator.com/D17770 --- .../20161005.conpherence.image.2.php | 34 ++----------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/resources/sql/autopatches/20161005.conpherence.image.2.php b/resources/sql/autopatches/20161005.conpherence.image.2.php index 4345cdd08b..8bad4b55e7 100644 --- a/resources/sql/autopatches/20161005.conpherence.image.2.php +++ b/resources/sql/autopatches/20161005.conpherence.image.2.php @@ -1,34 +1,4 @@ establishConnection('w'); -$table_name = 'conpherence_thread'; - -foreach (new LiskRawMigrationIterator($conn, $table_name) as $row) { - - $images = phutil_json_decode($row['imagePHIDs']); - if (!$images) { - continue; - } - - $file_phid = idx($images, 'original'); - - $file = id(new PhabricatorFileQuery()) - ->setViewer(PhabricatorUser::getOmnipotentUser()) - ->withPHIDs(array($file_phid)) - ->executeOne(); - - $xform = PhabricatorFileTransform::getTransformByKey( - PhabricatorFileThumbnailTransform::TRANSFORM_PROFILE); - $xformed = $xform->executeTransform($file); - $new_phid = $xformed->getPHID(); - - queryfx( - $conn, - 'UPDATE %T SET profileImagePHID = %s WHERE id = %d', - $table->getTableName(), - $new_phid, - $row['id']); -} +// This migration once resized room images for Conpherence, but the File table +// later changed significantly. See T12628. -- 2.51.2