Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101891209
20160222.almanac.1.properties.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Feb 14, 19:45
Size
695 B
Mime Type
text/x-php
Expires
Sun, Feb 16, 19:45 (2 d)
Engine
blob
Format
Raw Data
Handle
24239073
Attached To
rPH Phabricator
20160222.almanac.1.properties.php
View Options
<?php
$table
=
new
AlmanacProperty
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
// We're going to JSON-encode the value in each row: previously rows stored
// plain strings, but now they store JSON, so we need to update them.
foreach
(
new
LiskMigrationIterator
(
$table
)
as
$property
)
{
$key
=
$property
->
getFieldName
();
$current_row
=
queryfx_one
(
$conn_w
,
'SELECT fieldValue FROM %T WHERE id = %d'
,
$table
->
getTableName
(),
$property
->
getID
());
if
(!
$current_row
)
{
continue
;
}
queryfx
(
$conn_w
,
'UPDATE %T SET fieldValue = %s WHERE id = %d'
,
$table
->
getTableName
(),
phutil_json_encode
(
$current_row
[
'fieldValue'
]),
$property
->
getID
());
}
Event Timeline
Log In to Comment