mirror of
https://github.com/tangpanqing/aorm.git
synced 2025-10-05 16:06:56 +08:00
update
This commit is contained in:
@@ -3,8 +3,8 @@ package migrate_sqlite3
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/tangpanqing/aorm/builder"
|
||||
"github.com/tangpanqing/aorm/helper"
|
||||
"github.com/tangpanqing/aorm/null"
|
||||
"github.com/tangpanqing/aorm/utils"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strconv"
|
||||
@@ -86,7 +86,7 @@ func (mm *MigrateExecutor) getTableFromCode(tableName string) Table {
|
||||
func (mm *MigrateExecutor) getColumnsFromCode(typeOf reflect.Type) []Column {
|
||||
var columnsFromCode []Column
|
||||
for i := 0; i < typeOf.Elem().NumField(); i++ {
|
||||
fieldName := helper.UnderLine(typeOf.Elem().Field(i).Name)
|
||||
fieldName := utils.UnderLine(typeOf.Elem().Field(i).Name)
|
||||
fieldType := typeOf.Elem().Field(i).Type.Name()
|
||||
fieldMap := getTagMap(typeOf.Elem().Field(i).Tag.Get("aorm"))
|
||||
columnsFromCode = append(columnsFromCode, Column{
|
||||
@@ -105,7 +105,7 @@ func (mm *MigrateExecutor) getColumnsFromCode(typeOf reflect.Type) []Column {
|
||||
func (mm *MigrateExecutor) getIndexesFromCode(typeOf reflect.Type, tableFromCode Table) []Index {
|
||||
var indexesFromCode []Index
|
||||
for i := 0; i < typeOf.Elem().NumField(); i++ {
|
||||
fieldName := helper.UnderLine(typeOf.Elem().Field(i).Name)
|
||||
fieldName := utils.UnderLine(typeOf.Elem().Field(i).Name)
|
||||
fieldMap := getTagMap(typeOf.Elem().Field(i).Tag.Get("aorm"))
|
||||
|
||||
_, primaryIs := fieldMap["primary"]
|
||||
|
Reference in New Issue
Block a user