2026-10-26 13:59:49 +08:00
|
|
|
package migrations
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/1Panel-dev/1Panel/core/app/model"
|
|
|
|
|
"github.com/go-gormigrate/gormigrate/v2"
|
|
|
|
|
"gorm.io/gorm"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var AddPanelMCP = &gormigrate.Migration{
|
2026-10-28 14:04:38 +08:00
|
|
|
ID: "20261009-panel-mcp",
|
2026-10-26 13:59:49 +08:00
|
|
|
Migrate: func(tx *gorm.DB) error {
|
2026-10-28 14:04:38 +08:00
|
|
|
if err := tx.Migrator().DropTable(&model.MCPSetting{}); err != nil {
|
|
|
|
|
return err
|
|
|
|
|
}
|
2026-10-26 13:59:49 +08:00
|
|
|
return tx.AutoMigrate(&model.MCPCredential{}, &model.MCPGrant{}, &model.MCPInvocation{}, &model.MCPSetting{})
|
|
|
|
|
},
|
|
|
|
|
}
|