Replace GORM with bbolt for database operations

Migrated from GORM to bbolt for lightweight key-value storage, better aligning with project requirements. Updated repository methods to utilize bbolt's native APIs and removed dependencies associated with GORM.
This commit is contained in:
2025-05-09 23:58:48 +05:00
parent f262d5f931
commit 86886fb5d9
7 changed files with 92 additions and 84 deletions

View File

@@ -1,15 +1,12 @@
package migration
import (
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/setting"
"gorm.io/gorm"
"go.etcd.io/bbolt"
)
func Run(db *gorm.DB) error {
err := db.AutoMigrate(&setting.Setting{})
if err != nil {
func Run(db *bbolt.DB) error {
return db.Update(func(tx *bbolt.Tx) error {
_, err := tx.CreateBucketIfNotExists([]byte("settings"))
return err
}
return nil
})
}