1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-29 00:40:57 +01:00
phorge-phorge/resources/sql/autopatches/20190215.daemons.01.dropdataid.php

22 lines
533 B
PHP
Raw Normal View History

<?php
// See T6615. We're about to change the nullability on the "dataID" column,
// but it may have a UNIQUE KEY on it. Make sure we get rid of this key first
// so we don't run into trouble.
// There's no "IF EXISTS" modifier for "ALTER TABLE" so run this as a PHP patch
// instead of an SQL patch.
$table = new PhabricatorWorkerActiveTask();
$conn = $table->establishConnection('w');
try {
queryfx(
$conn,
'ALTER TABLE %R DROP KEY %T',
$table,
'dataID');
} catch (AphrontQueryException $ex) {
// Ignore.
}