Add database migration to re-index prices with negative values support
This commit is contained in:
		
							parent
							
								
									5b5de95828
								
							
						
					
					
						commit
						5cfd715d4a
					
				| @ -7,7 +7,7 @@ import cpfpRepository from '../repositories/CpfpRepository'; | ||||
| import { RowDataPacket } from 'mysql2'; | ||||
| 
 | ||||
| class DatabaseMigration { | ||||
|   private static currentVersion = 52; | ||||
|   private static currentVersion = 53; | ||||
|   private queryTimeout = 3600_000; | ||||
|   private statisticsAddedIndexed = false; | ||||
|   private uniqueLogs: string[] = []; | ||||
| @ -468,6 +468,13 @@ class DatabaseMigration { | ||||
|         logger.warn('' + (e instanceof Error ? e.message : e)); | ||||
|       } | ||||
|     } | ||||
| 
 | ||||
|     if (databaseSchemaVersion < 53) { | ||||
|       this.uniqueLog(logger.notice, `'prices' table has been truncated`); | ||||
|       this.uniqueLog(logger.notice, `'blocks_prices' table has been truncated`); | ||||
|       await this.$executeQuery(`TRUNCATE prices`); | ||||
|       await this.$executeQuery(`TRUNCATE blocks_prices`); | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   /** | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user