Add v0.2-v0.3 db upgrade script
This commit is contained in:
		
							parent
							
								
									21650994d2
								
							
						
					
					
						commit
						f69e3a821c
					
				
					 1 changed files with 18 additions and 0 deletions
				
			
		
							
								
								
									
										18
									
								
								db/upgrade/v0.2-v0.3.sql
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								db/upgrade/v0.2-v0.3.sql
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,18 @@
 | 
			
		|||
BEGIN;
 | 
			
		||||
 | 
			
		||||
UPDATE version SET minor = 3;
 | 
			
		||||
 | 
			
		||||
CREATE TABLE cron (
 | 
			
		||||
    jobName varchar UNIQUE NOT NULL, -- Application-recognizable name for the job
 | 
			
		||||
    runinterval interval NOT NULL, -- Duration between runs
 | 
			
		||||
		-- Last successful run - only gets updated if run is successful
 | 
			
		||||
    lastSuccess timestamptz DEFAULT to_timestamp(0), -- Defaults to beginning of time
 | 
			
		||||
		PRIMARY KEY(jobName)
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
INSERT INTO cron (jobName,runInterval) VALUES
 | 
			
		||||
('processBans','30 minutes'),
 | 
			
		||||
('processEmptyMetadata','1 day');
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
COMMIT;
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue