1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2025-03-18 21:57:50 +02:00

[#5611] make PRAGMA optimize optional

This commit is contained in:
Gani Georgiev 2024-10-07 10:20:03 +03:00
parent 1e480c5380
commit 1f7aba40f0
2 changed files with 4 additions and 1 deletions

View File

@ -8,6 +8,8 @@
func(T) error
```
- Make `PRAGMA optimize` statement optional ([#5611](https://github.com/pocketbase/pocketbase/discussions/5611)).
## v0.23.0-rc2

View File

@ -2,6 +2,7 @@ package core
import (
"fmt"
"log/slog"
"strconv"
"strings"
@ -145,7 +146,7 @@ func (app *BaseApp) SyncRecordTableSchema(newCollection *Collection, oldCollecti
// (https://www.sqlite.org/pragma.html#pragma_optimize)
_, optimizeErr := app.DB().NewQuery("PRAGMA optimize").Execute()
if optimizeErr != nil {
return fmt.Errorf("failed to run optimize after the fields changes: %w", optimizeErr)
app.Logger().Warn("Failed to run PRAGMA optimize after record table sync", slog.String("error", optimizeErr.Error()))
}
return nil