Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / resources / sql / autopatches / 20160222.almanac.1.properties.php
blobd12b3e5c61c3da65f10bf962cfb2df581d3b9b31
1 <?php
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(
13 $conn_w,
14 'SELECT fieldValue FROM %T WHERE id = %d',
15 $table->getTableName(),
16 $property->getID());
18 if (!$current_row) {
19 continue;
22 queryfx(
23 $conn_w,
24 'UPDATE %T SET fieldValue = %s WHERE id = %d',
25 $table->getTableName(),
26 phutil_json_encode($current_row['fieldValue']),
27 $property->getID());