feat: automate business upgrades and sync reviewed frontend
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"strings"
|
||||
|
||||
"gorm.io/gorm"
|
||||
"kra/internal/data/swmigration"
|
||||
datasystem "kra/internal/data/system"
|
||||
"kra/pkg/database/migration"
|
||||
)
|
||||
|
||||
@@ -36,6 +38,9 @@ func CheckPrerequisites(db *gorm.DB) error {
|
||||
}
|
||||
|
||||
func CheckSchema(db *gorm.DB) error {
|
||||
if err := swmigration.CheckSchema(db); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := CheckPrerequisites(db); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -50,6 +55,9 @@ func CheckSchema(db *gorm.DB) error {
|
||||
if db.Dialector.Name() != "mysql" {
|
||||
return nil
|
||||
}
|
||||
if err := datasystem.CheckBusinessRoles(db); err != nil {
|
||||
return err
|
||||
}
|
||||
indexes := append([]businessQueryIndex{}, businessQueryIndexes...)
|
||||
var idType string
|
||||
if err := db.Raw("SELECT data_type FROM information_schema.columns WHERE table_schema=DATABASE() AND table_name='tab_promote' AND column_name='id'").Scan(&idType).Error; err != nil {
|
||||
|
||||
Reference in New Issue
Block a user