2013-08-02 21:56:58 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
$table = new PhabricatorPaste();
|
|
|
|
$x_table = new PhabricatorPasteTransaction();
|
|
|
|
|
|
|
|
$conn_w = $table->establishConnection('w');
|
|
|
|
$conn_w->openTransaction();
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Adding transactions for existing paste objects...')."\n";
|
2013-08-02 21:56:58 +02:00
|
|
|
|
|
|
|
$rows = new LiskRawMigrationIterator($conn_w, 'pastebin_paste');
|
|
|
|
foreach ($rows as $row) {
|
|
|
|
|
|
|
|
$id = $row['id'];
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Adding transactions for paste id %d...', $id)."\n";
|
2013-08-02 21:56:58 +02:00
|
|
|
|
|
|
|
$xaction_phid = PhabricatorPHID::generateNewPHID(
|
2014-07-24 00:05:46 +02:00
|
|
|
PhabricatorApplicationTransactionTransactionPHIDType::TYPECONST);
|
2013-08-02 21:56:58 +02:00
|
|
|
|
|
|
|
queryfx(
|
|
|
|
$conn_w,
|
|
|
|
'INSERT INTO %T (phid, authorPHID, objectPHID, viewPolicy, editPolicy,
|
|
|
|
transactionType, oldValue, newValue,
|
2013-08-04 20:32:32 +02:00
|
|
|
contentSource, metadata, dateCreated, dateModified,
|
|
|
|
commentVersion)
|
|
|
|
VALUES (%s, %s, %s, %s, %s, %s, %ns, %ns, %s, %s, %d, %d, %d)',
|
2013-08-02 21:56:58 +02:00
|
|
|
$x_table->getTableName(),
|
|
|
|
$xaction_phid,
|
|
|
|
$row['authorPHID'],
|
|
|
|
$row['phid'],
|
|
|
|
'public',
|
|
|
|
$row['authorPHID'],
|
2014-05-04 20:11:46 +02:00
|
|
|
PhabricatorPasteTransaction::TYPE_CONTENT,
|
2013-08-02 21:56:58 +02:00
|
|
|
'null',
|
|
|
|
$row['filePHID'],
|
|
|
|
PhabricatorContentSource::newForSource(
|
2016-03-25 13:56:16 +01:00
|
|
|
PhabricatorOldWorldContentSource::SOURCECONST)->serialize(),
|
2013-08-02 21:56:58 +02:00
|
|
|
'[]',
|
|
|
|
$row['dateCreated'],
|
2013-08-04 20:32:32 +02:00
|
|
|
$row['dateCreated'],
|
|
|
|
0);
|
2013-08-02 21:56:58 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$conn_w->saveTransaction();
|
|
|
|
|
2015-05-22 09:27:56 +02:00
|
|
|
echo pht('Done.')."\n";
|