mirror of
https://github.com/go-gitea/gitea.git
synced 2026-11-25 15:27:58 +00: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:
1 parent
4c2b1be3a4
commit
005900baea
48 files changed
+519
-717
No files matched your search
+12
-4
@@ -40,18 +40,26 @@ type Mirror struct {
|
||||
|
||||
// BeforeInsert will be invoked by XORM before inserting a record
|
||||
func (m *Mirror) BeforeInsert() {
|
||||
m.UpdatedUnix = time.Now().Unix()
|
||||
m.NextUpdateUnix = m.NextUpdate.Unix()
|
||||
if m != nil {
|
||||
m.UpdatedUnix = time.Now().Unix()
|
||||
m.NextUpdateUnix = m.NextUpdate.Unix()
|
||||
}
|
||||
}
|
||||
|
||||
// BeforeUpdate is invoked from XORM before updating this object.
|
||||
func (m *Mirror) BeforeUpdate() {
|
||||
m.UpdatedUnix = time.Now().Unix()
|
||||
m.NextUpdateUnix = m.NextUpdate.Unix()
|
||||
if m != nil {
|
||||
m.UpdatedUnix = time.Now().Unix()
|
||||
m.NextUpdateUnix = m.NextUpdate.Unix()
|
||||
}
|
||||
}
|
||||
|
||||
// AfterSet is invoked from XORM after setting the value of a field of this object.
|
||||
func (m *Mirror) AfterSet(colName string, _ xorm.Cell) {
|
||||
if m == nil {
|
||||
return
|
||||
}
|
||||
|
||||
var err error
|
||||
switch colName {
|
||||
case "repo_id":
|
||||
|
||||
Reference in new issue
Block a user