Fix lint and format code in client/orm dir

This commit is contained in:
loyalsoldier
2021-06-06 20:52:38 +08:00
parent ca328208cc
commit 1b8c801ec6
32 changed files with 108 additions and 137 deletions

View File

@@ -72,9 +72,7 @@ type Migration struct {
RemoveForeigns []*Foreign
}
var (
migrationMap map[string]Migrationer
)
var migrationMap map[string]Migrationer
func init() {
migrationMap = make(map[string]Migrationer)
@@ -82,7 +80,6 @@ func init() {
// Up implement in the Inheritance struct for upgrade
func (m *Migration) Up() {
switch m.ModifyType {
case "reverse":
m.ModifyType = "alter"
@@ -94,7 +91,6 @@ func (m *Migration) Up() {
// Down implement in the Inheritance struct for down
func (m *Migration) Down() {
switch m.ModifyType {
case "alter":
m.ModifyType = "reverse"
@@ -311,6 +307,7 @@ func isRollBack(name string) bool {
}
return false
}
func getAllMigrations() (map[string]string, error) {
o := orm.NewOrm()
var maps []orm.Params