mirror of
https://github.com/dolthub/dolt.git
synced 2026-03-15 19:31:03 -05:00
constraint equal reverted
This commit is contained in:
@@ -40,9 +40,9 @@ func DropPrimaryKeyFromTable(ctx context.Context, table *doltdb.Table, nbf *type
|
||||
newCollection := schema.MapColCollection(sch.GetAllCols(), func(col schema.Column) schema.Column {
|
||||
col.IsPartOfPK = false
|
||||
// Removing PK does not remove NOT NULL constraint, so add it back if it's somehow gone
|
||||
if col.IsNullable() {
|
||||
col.Constraints = append(col.Constraints, schema.NotNullConstraint{})
|
||||
}
|
||||
//if col.IsNullable() {
|
||||
// col.Constraints = append(col.Constraints, schema.NotNullConstraint{})
|
||||
//}
|
||||
return col
|
||||
})
|
||||
|
||||
|
||||
@@ -93,6 +93,12 @@ func IndexOfConstraint(constraints []ColConstraint, constraintType string) int {
|
||||
// ColConstraintsAreEqual validates two ColConstraint slices are identical.
|
||||
func ColConstraintsAreEqual(a, b []ColConstraint) bool {
|
||||
// kinda shitty. Probably shouldn't require order to be identical
|
||||
if len(a) != len(b) {
|
||||
return false
|
||||
} else if len(a) == 0 {
|
||||
return true
|
||||
}
|
||||
|
||||
for i := 0; i < len(a); i++ {
|
||||
ca, cb := a[i], b[i]
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ func encodeAllColConstraints(constraints []schema.ColConstraint) []encodedConstr
|
||||
for _, c := range constraints {
|
||||
if c.GetConstraintType() == schema.NotNullConstraintType {
|
||||
if seenNotNull {
|
||||
continue
|
||||
//continue
|
||||
}
|
||||
seenNotNull = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user