mirror of
https://gitee.com/shikong-sk/gofiber-study
synced 2025-02-23 23:32:15 +08:00
23 lines
434 B
Go
23 lines
434 B
Go
package generate
|
|
|
|
import (
|
|
"fmt"
|
|
"gofiber.study.skcks.cn/common/utils"
|
|
"gofiber.study.skcks.cn/model/casbin_model/models"
|
|
"testing"
|
|
)
|
|
|
|
import (
|
|
_ "github.com/go-sql-driver/mysql"
|
|
)
|
|
|
|
// 从结构体 同步表结构到 数据库
|
|
func TestSync(t *testing.T) {
|
|
fmt.Println("同步数据库/表结构")
|
|
err := utils.SyncStructs("./config.yml", models.CasbinModel{})
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
fmt.Println("同步成功")
|
|
}
|