完善后台的图标库引用逻辑和在线图标库的引用
This commit is contained in:
@@ -16,8 +16,8 @@ import (
|
||||
"home-vue-go/internal/ent"
|
||||
"home-vue-go/internal/ent/migrate"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
_ "modernc.org/sqlite"
|
||||
)
|
||||
|
||||
const siteConfigPayloadColumn = "config_json"
|
||||
@@ -28,7 +28,7 @@ type Database struct {
|
||||
}
|
||||
|
||||
func Init(dbPath string, cfg *config.Config) (*Database, error) {
|
||||
db, err := sql.Open("sqlite3", dbPath+"?_fk=1")
|
||||
db, err := sql.Open("sqlite", dbPath+"?_pragma=foreign_keys(1)")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"home-vue-go/internal/config"
|
||||
@@ -25,9 +24,6 @@ func TestSiteSettingsMigrationAndBooleanPersistence(t *testing.T) {
|
||||
cfg := config.New(dataDir)
|
||||
db, err := Init(cfg.DatabasePath, cfg)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "CGO_ENABLED=0") {
|
||||
t.Skip("go-sqlite3 requires cgo for the database integration test")
|
||||
}
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
Reference in New Issue
Block a user