// EqualTableStruct tests whether two table's struct are same.
EqualTableStruct tests whether two table's struct are same.
// EqualTableStruct tests whether two table ' s struct are same .
func (df *Diff) EqualTableStruct(tableInfo1, tableInfo2 *model.TableInfo) (bool, error) {
	if len(tableInfo1.Columns) != len(tableInfo2.Columns) {
		return false, nil
	}
	for j, col := range tableInfo1.Columns {
		if col.Name.O != tableInfo2.Columns[j].Name.O {
			return false, nil
		}
		if col.Tp != tableInfo2.Columns[j].Tp {
			return false, nil
		}
	}
	if len(tableInfo1.Indices) != len(tableInfo2.Indices) {
		return false, nil
	}
	for i, index := range tableInfo1.Indices {
		index2 := tableInfo2.Indices[i]
		if index.Name.O != index2.Name.O {
			return false, nil
		}
		if len(index.Columns) != len(index2.Columns) {
			return false, nil
		}
		for j, col := range index.Columns {
			if col.Name.O != index2.Columns[j].Name.O {
				return false, nil
			}
		}
	}
	return true, nil
}
func ( df * Diff ) EqualTableStruct ( tableInfo1 , tableInfo2 * model . TableInfo ) ( bool , error ) { if len ( tableInfo1 . Columns ) != len ( tableInfo2 . Columns ) { return false , nil } for j , col := range tableInfo1 . Columns { if col . Name . O != tableInfo2 . Columns [ j ] . Name . O { return false , nil } if col . Tp != tableInfo2 . Columns [ j ] . Tp { return false , nil } } if len ( tableInfo1 . Indices ) != len ( tableInfo2 . Indices ) { return false , nil } for i , index := range tableInfo1 . Indices { index2 := tableInfo2 . Indices [ i ] if index . Name . O != index2 . Name . O { return false , nil } if len ( index . Columns ) != len ( index2 . Columns ) { return false , nil } for j , col := range index . Columns { if col . Name . O != index2 . Columns [ j ] . Name . O { return false , nil } } } return true , nil }
EqualTableStruct tests whether two table's struct are same.
EqualTableStruct tests whether two table ' s struct are same .
// check columns // check index