3 $table = new AlmanacProperty();
4 $conn_w = $table->establishConnection('w');
6 // We're going to JSON-encode the value in each row: previously rows stored
7 // plain strings, but now they store JSON, so we need to update them.
9 foreach (new LiskMigrationIterator($table) as $property) {
10 $key = $property->getFieldName();
12 $current_row = queryfx_one(
14 'SELECT fieldValue FROM %T WHERE id = %d',
15 $table->getTableName(),
24 'UPDATE %T SET fieldValue = %s WHERE id = %d',
25 $table->getTableName(),
26 phutil_json_encode($current_row['fieldValue']),