修改数据表结构功能
This commit is contained in:
1 parent
1b03cf2c48
commit
9947ab3fa8
4 files changed
+75
-5
No files matched your search
@@ -39,10 +39,16 @@ type SysTables struct {
|
||||
UpdateBy string `gorm:"column:update_By" json:"updateBy"`
|
||||
UpdateTime string `gorm:"column:update_time" json:"updateTime"`
|
||||
DataScope string `gorm:"-" json:"dataScope"`
|
||||
Params string `gorm:"-" json:"params"`
|
||||
Params Params `gorm:"-" json:"params"`
|
||||
Columns []SysColumns `gorm:"-" json:"columns"`
|
||||
}
|
||||
|
||||
type Params struct {
|
||||
TreeCode string `gorm:"-" json:"treeCode"`
|
||||
TreeParentCode string `gorm:"-" json:"treeParentCode"`
|
||||
TreeName string `gorm:"-" json:"treeName"`
|
||||
}
|
||||
|
||||
func (e *SysTables) GetPage(pageSize int, pageIndex int) ([]SysTables, int32, error) {
|
||||
var doc []SysTables
|
||||
|
||||
@@ -120,6 +126,10 @@ func (e *SysTables) Update() (update SysTables, err error) {
|
||||
if err = orm.Eloquent.Table("sys_tables").Model(&update).Updates(&e).Error; err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
for i:=0;i< len(e.Columns);i++ {
|
||||
_, _ = e.Columns[i].Update()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user