1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-01-23 22:12:48 +02:00
pocketbase/migrations/logs/1677760279_uppsercase_method.go
2023-03-02 15:17:29 +02:00

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