2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

feat: 初始化数据库条目模型

This commit is contained in:
耗子
2024-11-07 00:49:11 +08:00
parent f2eb3a180c
commit ff7e76ac2b
3 changed files with 89 additions and 0 deletions

View File

@@ -55,4 +55,17 @@ func init() {
)
},
})
Migrations = append(Migrations, &gormigrate.Migration{
ID: "20241107-database-item",
Migrate: func(tx *gorm.DB) error {
return tx.AutoMigrate(
&biz.DatabaseItem{},
)
},
Rollback: func(tx *gorm.DB) error {
return tx.Migrator().DropTable(
&biz.DatabaseItem{},
)
},
})
}