 e10fdbe77e
			
		
	
	e10fdbe77e
	
	
	
		
			
			Summary: Patches often read from slaves (possibly stale data) and use that information to write on master. It causes problems when applying more patches quickly after each other because data created in previous patch may not be replicated yet. Test Plan: $ bin/storage upgrade Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4483
		
			
				
	
	
		
			24 lines
		
	
	
		
			446 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			446 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| echo "Giving image macros PHIDs";
 | |
| $table = new PhabricatorFileImageMacro();
 | |
| $table->openTransaction();
 | |
| 
 | |
| foreach (new LiskMigrationIterator($table) as $macro) {
 | |
|   if ($macro->getPHID()) {
 | |
|     continue;
 | |
|   }
 | |
| 
 | |
|   echo ".";
 | |
| 
 | |
|   queryfx(
 | |
|     $macro->establishConnection('w'),
 | |
|     'UPDATE %T SET phid = %s WHERE id = %d',
 | |
|     $macro->getTableName(),
 | |
|     $macro->generatePHID(),
 | |
|     $macro->getID());
 | |
| }
 | |
| 
 | |
| $table->saveTransaction();
 | |
| echo "\nDone.\n";
 |