1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-05 01:45:22 +02:00

[v11.0/forgejo] chore(cleanup): suppress non actionable XORM warnings (#8022)

**Backport:** https://codeberg.org/forgejo/forgejo/pulls/8021

The following will trigger a XORM warning:

```
	type Repository struct {
		ID     int64    `xorm:"pk autoincr"`
		Topics []string `xorm:"TEXT JSON NOT NULL"`
	}
```

that looks like:

```
  [W] Table repository Column topics db default is '', struct default is
```

it cannot be resolved because:

- SQLite requires a default when there is a NOT NULL
- MySQL forbids a default for TEXT

Co-authored-by: Earl Warren <contact@earl-warren.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8022
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Co-authored-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
Co-committed-by: forgejo-backport-action <forgejo-backport-action@noreply.codeberg.org>
This commit is contained in:
forgejo-backport-action 2025-05-30 13:43:41 +02:00 committed by Earl Warren
parent dc0d4fb3ad
commit ff4f2bcf07

View file

@ -69,6 +69,9 @@ func (l *XORMLogBridge) Warn(v ...any) {
// Warnf show warning log
func (l *XORMLogBridge) Warnf(format string, v ...any) {
if format == "Table %s Column %s db default is %s, struct default is %s" || format == "Table %s Column %s db nullable is %v, struct nullable is %v" {
return
}
l.Log(stackLevel, log.WARN, format, v...)
}