You've already forked uptime-kuma
							
							
				mirror of
				https://github.com/louislam/uptime-kuma.git
				synced 2025-10-30 23:58:13 +02:00 
			
		
		
		
	Fix: Set default value for ping column to 0 in stat tables (#6188)
				
					
				
			This commit is contained in:
		
							
								
								
									
										27
									
								
								db/knex_migrations/2025-10-15-0000-stat-table-fix.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								db/knex_migrations/2025-10-15-0000-stat-table-fix.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| // Fix for #4315. Logically, setting it to 0 ping may not be correct, but it is better than throwing errors | ||||
|  | ||||
| exports.up = function (knex) { | ||||
|     return knex.schema | ||||
|         .alterTable("stat_daily", function (table) { | ||||
|             table.integer("ping").defaultTo(0).alter(); | ||||
|         }) | ||||
|         .alterTable("stat_hourly", function (table) { | ||||
|             table.integer("ping").defaultTo(0).alter(); | ||||
|         }) | ||||
|         .alterTable("stat_minutely", function (table) { | ||||
|             table.integer("ping").defaultTo(0).alter(); | ||||
|         }); | ||||
| }; | ||||
|  | ||||
| exports.down = function (knex) { | ||||
|     return knex.schema | ||||
|         .alterTable("stat_daily", function (table) { | ||||
|             table.integer("ping").alter(); | ||||
|         }) | ||||
|         .alterTable("stat_hourly", function (table) { | ||||
|             table.integer("ping").alter(); | ||||
|         }) | ||||
|         .alterTable("stat_minutely", function (table) { | ||||
|             table.integer("ping").alter(); | ||||
|         }); | ||||
| }; | ||||
		Reference in New Issue
	
	Block a user