1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 12:52:42 +01:00

Fix credential upgrade issue after introduction of isLocked column

Summary: Fixes T5035. This migration isn't forward compatible after schema mutation.

Test Plan: Ran locally, will get reporting user to confirm.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: gera, epriestley

Maniphest Tasks: T5035

Differential Revision: https://secure.phabricator.com/D9101
This commit is contained in:
epriestley 2014-05-13 12:14:27 -07:00
parent 2592bfcbb3
commit 4a7499f230

View file

@ -86,8 +86,29 @@ foreach ($map as $credential_type => $credential_usernames) {
->setEditPolicy(PhabricatorPolicies::POLICY_ADMIN) ->setEditPolicy(PhabricatorPolicies::POLICY_ADMIN)
->setName($name) ->setName($name)
->setUsername($username) ->setUsername($username)
->setSecretID($secret_id) ->setSecretID($secret_id);
->save();
$credential->setPHID($credential->generatePHID());
queryfx(
$credential->establishConnection('w'),
'INSERT INTO %T (name, credentialType, providesType, viewPolicy,
editPolicy, description, username, secretID, isDestroyed,
phid, dateCreated, dateModified)
VALUES (%s, %s, %s, %s, %s, %s, %s, %d, %d, %s, %d, %d)',
$credential->getTableName(),
$credential->getName(),
$credential->getCredentialType(),
$credential->getProvidesType(),
$credential->getViewPolicy(),
$credential->getEditPolicy(),
$credential->getDescription(),
$credential->getUsername(),
$credential->getSecretID(),
$credential->getIsDestroyed(),
$credential->getPHID(),
time(),
time());
foreach ($repositories as $repository) { foreach ($repositories as $repository) {
queryfx( queryfx(