Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/patches/20130201.revisionunsubscribed.php
| <?php | <?php | ||||
| echo "Migrating Differential unsubscribed users to edges...\n"; | echo "Migrating Differential unsubscribed users to edges...\n"; | ||||
| $table = new DifferentialRevision(); | $table = new DifferentialRevision(); | ||||
| $table->openTransaction(); | $table->openTransaction(); | ||||
| // We couldn't use new LiskMigrationIterator($table) because the $unsubscribed | // We couldn't use new LiskMigrationIterator($table) because the $unsubscribed | ||||
| // property gets deleted. | // property gets deleted. | ||||
| $revs = queryfx_all( | $revs = queryfx_all( | ||||
| $table->establishConnection('w'), | $table->establishConnection('w'), | ||||
| 'SELECT id, phid, unsubscribed FROM differential_revision'); | 'SELECT id, phid, unsubscribed FROM differential_revision'); | ||||
| foreach ($revs as $rev) { | foreach ($revs as $rev) { | ||||
| echo "."; | echo '.'; | ||||
| $unsubscribed = json_decode($rev['unsubscribed']); | $unsubscribed = json_decode($rev['unsubscribed']); | ||||
| if (!$unsubscribed) { | if (!$unsubscribed) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| $editor = new PhabricatorEdgeEditor(); | $editor = new PhabricatorEdgeEditor(); | ||||
| $editor->setSuppressEvents(true); | $editor->setSuppressEvents(true); | ||||
| Show All 11 Lines | |||||