Fixed bug with diffing column defaults

This commit is contained in:
Daylon Wilkins
2020-09-11 14:51:44 -07:00
committed by Daylon Wilkins
parent 3e17e271d2
commit 31a9cf7e01
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -601,6 +601,7 @@ func dumbDownSchema(in schema.Schema) (schema.Schema, error) {
err := allCols.Iter(func(tag uint64, col schema.Column) (stop bool, err error) {
col.Name = strconv.FormatUint(tag, 10)
col.Constraints = nil
col.Default = ""
dumbCols = append(dumbCols, col)
return false, nil
@@ -813,7 +814,7 @@ func createSplitter(fromSch schema.Schema, toSch schema.Schema, joiner *rowconv.
unionSch, err = untyped.UntypedSchemaUnion(dumbNewSch, dumbOldSch)
if err != nil {
return nil, nil, errhand.BuildDError("Failed to merge schemas").Build()
return nil, nil, errhand.BuildDError("Failed to merge schemas").AddCause(err).Build()
}
} else {
+1
View File
@@ -131,6 +131,7 @@ func (c Column) Equals(other Column) bool {
c.Kind == other.Kind &&
c.IsPartOfPK == other.IsPartOfPK &&
c.TypeInfo.Equals(other.TypeInfo) &&
c.Default == other.Default &&
ColConstraintsAreEqual(c.Constraints, other.Constraints)
}