Make PhabricatorRepositoryCommmit schema changes for audit
Summary: - Add a proper mailKey field to make these things mailable. Backfill all existing objects. - Denormalize authorPHID to the commit object so we can query by it efficiently in a future diff. We currently use the search engine to drive "commits by author" but that's not so good for audit, which needs more constraints. - Add an overall audit status field so we can efficiently query "commits that needs your attention". - Add enough code to convince myself that these fields are basically reasonable and work correctly. Test Plan: - Ran schema upgrades. Checked database state afterward. - Ran "reparse.php --owners --herald" to verify worker changes. - Looked at a commit, altered aggregate status via audits / reparse.php, verified it responded correctly. Reviewers: btrahan, jungejason Reviewed By: jungejason CC: aran, epriestley, nh Maniphest Tasks: T904 Differential Revision: https://secure.phabricator.com/D1706
This commit is contained in:
		
							
								
								
									
										11
									
								
								resources/sql/patches/110.commitaudit.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								resources/sql/patches/110.commitaudit.sql
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
ALTER TABLE phabricator_repository.repository_commit
 | 
			
		||||
  ADD mailKey VARCHAR(20) NOT NULL;
 | 
			
		||||
 | 
			
		||||
ALTER TABLE phabricator_repository.repository_commit
 | 
			
		||||
  ADD authorPHID VARCHAR(64) BINARY;
 | 
			
		||||
 | 
			
		||||
ALTER TABLE phabricator_repository.repository_commit
 | 
			
		||||
  ADD auditStatus INT UNSIGNED NOT NULL;
 | 
			
		||||
 | 
			
		||||
ALTER TABLE phabricator_repository.repository_commit
 | 
			
		||||
  ADD KEY (authorPHID, auditStatus, epoch);
 | 
			
		||||
		Reference in New Issue
	
	Block a user