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:
@@ -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
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user