forked from mirror/gorm
request ColumnTypes after new session method
This commit is contained in:
parent
22317b43c0
commit
d1e17d549f
|
@ -388,7 +388,7 @@ func (m Migrator) MigrateColumn(value interface{}, field *schema.Field, columnTy
|
|||
|
||||
func (m Migrator) ColumnTypes(value interface{}) (columnTypes []*sql.ColumnType, err error) {
|
||||
err = m.RunWithValue(value, func(stmt *gorm.Statement) error {
|
||||
rows, err := m.DB.Raw("select * from ?", clause.Table{Name: stmt.Table}).Rows()
|
||||
rows, err := m.DB.Session(&gorm.Session{}).Raw("select * from ?", clause.Table{Name: stmt.Table}).Rows()
|
||||
if err == nil {
|
||||
columnTypes, err = rows.ColumnTypes()
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@ require (
|
|||
github.com/google/uuid v1.1.1
|
||||
github.com/jinzhu/now v1.1.1
|
||||
github.com/lib/pq v1.6.0
|
||||
gorm.io/driver/mysql v1.0.0
|
||||
gorm.io/driver/mysql v1.0.1
|
||||
gorm.io/driver/postgres v1.0.0
|
||||
gorm.io/driver/sqlite v1.1.0
|
||||
gorm.io/driver/sqlserver v1.0.1
|
||||
gorm.io/driver/sqlite v1.1.1
|
||||
gorm.io/driver/sqlserver v1.0.2
|
||||
gorm.io/gorm v1.9.19
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue