1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-05 09:55:20 +02:00

chore(cleanup): suppress non actionable XORM warnings (#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

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8021
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
This commit is contained in:
Earl Warren 2025-05-30 13:01:08 +02:00 committed by Earl Warren
parent 8e2747859b
commit 161924abf8

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...)
}