1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

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
This commit is contained in:
epriestley 2013-12-02 11:26:12 -08:00
parent d59722321f
commit 95c2b50974

View file

@ -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";