From 95c2b50974471df97b308b20384ef234b1309018 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 2 Dec 2013 11:26:12 -0800 Subject: [PATCH] Shorten extremely long credential names when migrating them Summary: Fixes T4183. If you have too many repositories sharing the same credential and MySQL is in strict mode, we'll fail a query when trying to write a credential with a name longer than 255 characters. Instead, shorten the variable-length part to 128 characters. Test Plan: Wiped credentials column and successfully re-ran migration with `storage upgrade --force --apply phabricator:20131121.repocredentials.2.mig.php` Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T4183 Differential Revision: https://secure.phabricator.com/D7677 --- resources/sql/patches/20131121.repocredentials.2.mig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/sql/patches/20131121.repocredentials.2.mig.php b/resources/sql/patches/20131121.repocredentials.2.mig.php index e147cc8b51..398401d3ac 100644 --- a/resources/sql/patches/20131121.repocredentials.2.mig.php +++ b/resources/sql/patches/20131121.repocredentials.2.mig.php @@ -69,7 +69,7 @@ foreach ($map as $credential_type => $credential_usernames) { $callsigns = mpull($repositories, 'getCallsign'); $name = pht( 'Migrated Repository Credential (%s)', - implode(', ', $callsigns)); + phutil_utf8_shorten(implode(', ', $callsigns), 128)); echo "Creating: {$name}...\n";