go17/vblog/apps/token/model_test.go

21 lines
398 B
Go
Raw Permalink Normal View History

2024-12-01 17:17:51 +08:00
package token_test
import (
"testing"
"github.com/infraboard/mcube/v2/ioc/config/datasource"
"gitlab.com/go-course-project/go17/vblog/apps/token"
2024-12-15 15:10:44 +08:00
"gitlab.com/go-course-project/go17/vblog/test"
2024-12-01 17:17:51 +08:00
)
func TestMigrate(t *testing.T) {
// db 数据库连接对象, migrate
if err := datasource.DB().AutoMigrate(&token.Token{}); err != nil {
t.Fatal(err)
}
}
func init() {
2024-12-15 15:10:44 +08:00
test.LoadConfig()
2024-12-01 17:17:51 +08:00
}