mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-10-29 17:58:36 +08:00
update vendor
This commit is contained in:
@@ -139,7 +139,7 @@ require (
|
||||
yunion.io/x/log v0.0.0-20190629062853-9f6483a7103d
|
||||
yunion.io/x/pkg v0.0.0-20200103043034-27c6f82160fa
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/sqlchemy v0.0.0-20200114051901-dfdc01cac3c3
|
||||
yunion.io/x/sqlchemy v0.0.0-20200119074814-09089d67c78d
|
||||
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3
|
||||
)
|
||||
|
||||
|
||||
@@ -679,7 +679,7 @@ yunion.io/x/pkg v0.0.0-20200103043034-27c6f82160fa h1:+7zYi8MhaOW/53/7FOERnhQqAU
|
||||
yunion.io/x/pkg v0.0.0-20200103043034-27c6f82160fa/go.mod h1:t6rEGG2sQ4J7DhFxSZVOTjNd0YO/KlfWQyK1W4tog+E=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e h1:v+EzIadodSwkdZ/7bremd7J8J50Cise/HCylsOJngmo=
|
||||
yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e/go.mod h1:0iFKpOs1y4lbCxeOmq3Xx/0AcQoewVPwj62eRluioEo=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200114051901-dfdc01cac3c3 h1:4OA/7udM060GPhj1hqX80Tu+lC2ziAcMrKpo+EG5LZA=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200114051901-dfdc01cac3c3/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200119074814-09089d67c78d h1:z9gliVPaZir4qJ9/E1ItnqCZeMq1thGbcuRwYeSKgQM=
|
||||
yunion.io/x/sqlchemy v0.0.0-20200119074814-09089d67c78d/go.mod h1:FTdwPdGhMgh4E+UFXc9klI1Ok34fMuybTT+jLhOaIjI=
|
||||
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3 h1:bfC8EhXYvyGYldRWlzxiCM39Zfj3s3+zham9mW2h2LE=
|
||||
yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3/go.mod h1:EP6NSv2C0zzqBDTKumv8hPWLb3XvgMZDHQRfyuOrQng=
|
||||
|
||||
Vendored
+1
-1
@@ -846,7 +846,7 @@ yunion.io/x/pkg/util/workqueue
|
||||
yunion.io/x/pkg/utils
|
||||
# yunion.io/x/s3cli v0.0.0-20190917004522-13ac36d8687e
|
||||
yunion.io/x/s3cli
|
||||
# yunion.io/x/sqlchemy v0.0.0-20200114051901-dfdc01cac3c3
|
||||
# yunion.io/x/sqlchemy v0.0.0-20200119074814-09089d67c78d
|
||||
yunion.io/x/sqlchemy
|
||||
# yunion.io/x/structarg v0.0.0-20190809075558-115bed041de3
|
||||
yunion.io/x/structarg
|
||||
|
||||
+14
-2
@@ -335,9 +335,22 @@ func (ts *STableSpec) SyncSQL() []string {
|
||||
/* IGNORE DROP STATEMENT */
|
||||
for _, col := range remove {
|
||||
sql := fmt.Sprintf("DROP COLUMN `%s`", col.Name())
|
||||
log.Infof("ALTER TABLE %s %s;", ts.name, sql)
|
||||
// alters = append(alters, sql)
|
||||
// ignore drop statement
|
||||
// but if the column is not nullable but no default
|
||||
// if the column is auto_increment integer column,
|
||||
// then need to drop auto_increment attribute
|
||||
if intCol, ok := col.(*SIntegerColumn); ok {
|
||||
if intCol.IsAutoIncrement {
|
||||
// make sure the column is nullable
|
||||
col.SetNullable(true)
|
||||
log.Errorf("column %s is auto_increment, drop auto_inrement attribute", col.Name())
|
||||
intCol.IsAutoIncrement = false
|
||||
sql := fmt.Sprintf("MODIFY %s", col.DefinitionString())
|
||||
alters = append(alters, sql)
|
||||
}
|
||||
}
|
||||
// if the column is not nullable but no default
|
||||
// then need to drop the not-nullable attribute
|
||||
if !col.IsNullable() && col.Default() == "" {
|
||||
col.SetNullable(true)
|
||||
@@ -345,7 +358,6 @@ func (ts *STableSpec) SyncSQL() []string {
|
||||
alters = append(alters, sql)
|
||||
log.Errorf("column %s is not nullable but no default, drop not nullable attribute", col.Name())
|
||||
}
|
||||
log.Infof("ALTER TABLE %s %s;", ts.name, sql)
|
||||
}
|
||||
for _, cols := range update {
|
||||
sql := fmt.Sprintf("MODIFY %s", cols.newCol.DefinitionString())
|
||||
|
||||
Reference in New Issue
Block a user