Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/autopatches/20140808.boardprop.3.php
| <?php | <?php | ||||
| $table = new PhabricatorProjectColumn(); | $table = new PhabricatorProjectColumn(); | ||||
| $conn_w = $table->establishConnection('w'); | $conn_w = $table->establishConnection('w'); | ||||
| foreach (new LiskMigrationIterator($table) as $column) { | foreach (new LiskMigrationIterator($table) as $column) { | ||||
| $id = $column->getID(); | $id = $column->getID(); | ||||
| echo "Adjusting column {$id}...\n"; | echo pht('Adjusting column %d...', $id)."\n"; | ||||
| if ($column->getSequence() == 0) { | if ($column->getSequence() == 0) { | ||||
| $properties = $column->getProperties(); | $properties = $column->getProperties(); | ||||
| $properties['isDefault'] = true; | $properties['isDefault'] = true; | ||||
| queryfx( | queryfx( | ||||
| $conn_w, | $conn_w, | ||||
| 'UPDATE %T SET properties = %s WHERE id = %d', | 'UPDATE %T SET properties = %s WHERE id = %d', | ||||
| $table->getTableName(), | $table->getTableName(), | ||||
| json_encode($properties), | json_encode($properties), | ||||
| $id); | $id); | ||||
| } | } | ||||
| } | } | ||||
| echo "Done.\n"; | echo pht('Done.')."\n"; | ||||