mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-01-23 22:12:48 +02:00
19 lines
444 B
Go
19 lines
444 B
Go
package logs
|
|
|
|
import (
|
|
"github.com/pocketbase/dbx"
|
|
)
|
|
|
|
// This migration normalizes the request logs method to UPPERCASE (eg. "get" => "GET").
|
|
func init() {
|
|
LogsMigrations.Register(func(db dbx.Builder) error {
|
|
_, err := db.NewQuery("UPDATE {{_requests}} SET method=UPPER(method)").Execute()
|
|
|
|
return err
|
|
}, func(db dbx.Builder) error {
|
|
_, err := db.NewQuery("UPDATE {{_requests}} SET method=LOWER(method)").Execute()
|
|
|
|
return err
|
|
})
|
|
}
|