Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F119215642
20190207.packages.04.xactions.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
Wed, Jun 25, 11:06
Size
979 B
Mime Type
text/x-php
Expires
Fri, Jun 27, 11:06 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
26992460
Attached To
rPH Phabricator
20190207.packages.04.xactions.php
View Options
<?php
$table
=
new
PhabricatorOwnersPackageTransaction
();
$conn
=
$table
->
establishConnection
(
'w'
);
$iterator
=
new
LiskRawMigrationIterator
(
$conn
,
$table
->
getTableName
());
// Migrate "Auditing State" transactions for Owners Packages from old values
// (which were "0" or "1", as JSON integer literals, without quotes) to new
// values (which are JSON strings, with quotes).
foreach
(
$iterator
as
$row
)
{
if
(
$row
[
'transactionType'
]
!==
'owners.auditing'
)
{
continue
;
}
$old_value
=
(
int
)
$row
[
'oldValue'
];
$new_value
=
(
int
)
$row
[
'newValue'
];
if
(!
$old_value
)
{
$old_value
=
'none'
;
}
else
{
$old_value
=
'audit'
;
}
if
(!
$new_value
)
{
$new_value
=
'none'
;
}
else
{
$new_value
=
'audit'
;
}
$old_value
=
phutil_json_encode
(
$old_value
);
$new_value
=
phutil_json_encode
(
$new_value
);
queryfx
(
$conn
,
'UPDATE %R SET oldValue = %s, newValue = %s WHERE id = %d'
,
$table
,
$old_value
,
$new_value
,
$row
[
'id'
]);
}
Event Timeline
Log In to Comment