mirror of
https://github.com/StarFleetCPTN/GoMFT.git
synced 2026-10-24 06:50:26 +02:00
chore: Switch to glebarez/sqlite and add migration support
- Replace mattn/go-sqlite3 with glebarez/sqlite for better cross-platform compatibility - Add gormigrate for database migration support - Update go.mod and go.sum with new dependencies - Modify database initialization to use the new SQLite driver - Ignore compiled binary in .gitignore
This commit is contained in:
1 parent
2b2c305ccb
commit
248f9cce51
4 files changed
+39
-9
No files matched your search
+2
-2
@@ -8,7 +8,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/starfleetcptn/gomft/internal/auth"
|
||||
"gorm.io/driver/sqlite"
|
||||
"github.com/glebarez/sqlite"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
@@ -136,7 +136,7 @@ func Initialize(dbPath string) (*DB, error) {
|
||||
return nil, fmt.Errorf("failed to create database directory: %v", err)
|
||||
}
|
||||
|
||||
// Open database connection
|
||||
// Open database connection with modernc.org/sqlite driver
|
||||
db, err := gorm.Open(sqlite.Open(dbPath), &gorm.Config{})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to connect to database: %v", err)
|
||||
|
||||
Reference in new issue
Block a user