mirror of
				https://github.com/juanfont/headscale.git
				synced 2025-11-04 10:01:05 +01:00 
			
		
		
		
	fix postgres migration (#1802)
This commit is contained in:
		
							parent
							
								
									7a920ee701
								
							
						
					
					
						commit
						c9966ba6c2
					
				@ -317,7 +317,14 @@ func NewHeadscaleDatabase(
 | 
				
			|||||||
				// no longer used.
 | 
									// no longer used.
 | 
				
			||||||
				ID: "202402151347",
 | 
									ID: "202402151347",
 | 
				
			||||||
				Migrate: func(tx *gorm.DB) error {
 | 
									Migrate: func(tx *gorm.DB) error {
 | 
				
			||||||
					return tx.Migrator().DropColumn(&types.Node{}, "last_successful_update")
 | 
										err := tx.Migrator().DropColumn(&types.Node{}, "last_successful_update")
 | 
				
			||||||
 | 
										if err != nil && strings.Contains(err.Error(), `of relation "nodes" does not exist`) {
 | 
				
			||||||
 | 
											return nil
 | 
				
			||||||
 | 
										} else {
 | 
				
			||||||
 | 
											return err
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										return err
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				Rollback: func(tx *gorm.DB) error {
 | 
									Rollback: func(tx *gorm.DB) error {
 | 
				
			||||||
					return nil
 | 
										return nil
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user