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 pht('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'); | ||||
| Show All 12 Lines | $editor->addEdge( | ||||
| $rev['phid'], | $rev['phid'], | ||||
| PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST , | PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST , | ||||
| $user_phid); | $user_phid); | ||||
| } | } | ||||
| $editor->save(); | $editor->save(); | ||||
| } | } | ||||
| $table->saveTransaction(); | $table->saveTransaction(); | ||||
| echo "Done.\n"; | echo pht('Done.')."\n"; | ||||