chore: update database migrator

This commit is contained in:
Steven
2024-01-06 16:55:13 +08:00
parent fd8333eeda
commit d67eaaaee2
21 changed files with 71 additions and 385 deletions

View File

@@ -6,6 +6,8 @@ import (
"os"
"testing"
"github.com/joho/godotenv"
"github.com/usememos/memos/server/profile"
"github.com/usememos/memos/server/version"
)
@@ -24,6 +26,10 @@ func getUnusedPort() int {
}
func GetTestingProfile(t *testing.T) *profile.Profile {
if err := godotenv.Load(".env"); err != nil {
t.Fatal("failed to load .env file", err)
}
// Get a temporary directory for the test data.
dir := t.TempDir()
mode := "dev"