mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Use created & updated instead BeforeInsert & BeforeUpdate (#2482)
* use created & updated instead BeforeInsert & BeforeUpdate * fix vendor checksum * only show generated SQL when development mode * remove extra update column updated_unix * remove trace config
This commit is contained in:
		@@ -86,13 +86,7 @@ type Action struct {
 | 
			
		||||
	IsPrivate   bool      `xorm:"INDEX NOT NULL DEFAULT false"`
 | 
			
		||||
	Content     string    `xorm:"TEXT"`
 | 
			
		||||
	Created     time.Time `xorm:"-"`
 | 
			
		||||
	CreatedUnix int64     `xorm:"INDEX"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// BeforeInsert will be invoked by XORM before inserting a record
 | 
			
		||||
// representing this object.
 | 
			
		||||
func (a *Action) BeforeInsert() {
 | 
			
		||||
	a.CreatedUnix = time.Now().Unix()
 | 
			
		||||
	CreatedUnix int64     `xorm:"INDEX created"`
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// AfterSet updates the webhook object upon setting a column.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user