summaryrefslogtreecommitdiffstats
path: root/vendor/xorm.io/xorm/dialects
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-01-05 14:28:51 +0800
committerGitHub <noreply@github.com>2021-01-05 14:28:51 +0800
commit126c9331d6d8789563fae5d5bac2196d63fee0e8 (patch)
tree304d5f1ce134bd75344a4e7e1a376d7a6dc9cfb1 /vendor/xorm.io/xorm/dialects
parent8db0372a45082c8827bdee1b449f618b393c026d (diff)
downloadgitea-126c9331d6d8789563fae5d5bac2196d63fee0e8.tar.gz
gitea-126c9331d6d8789563fae5d5bac2196d63fee0e8.zip
upgrade xorm to v1.0.6 (#14246)
Diffstat (limited to 'vendor/xorm.io/xorm/dialects')
-rw-r--r--vendor/xorm.io/xorm/dialects/dialect.go2
-rw-r--r--vendor/xorm.io/xorm/dialects/mssql.go5
-rw-r--r--vendor/xorm.io/xorm/dialects/sqlite3.go2
3 files changed, 7 insertions, 2 deletions
diff --git a/vendor/xorm.io/xorm/dialects/dialect.go b/vendor/xorm.io/xorm/dialects/dialect.go
index dc96f73ae2..18b781a155 100644
--- a/vendor/xorm.io/xorm/dialects/dialect.go
+++ b/vendor/xorm.io/xorm/dialects/dialect.go
@@ -163,7 +163,7 @@ func (db *Base) DropIndexSQL(tableName string, index *schemas.Index) string {
func (db *Base) ModifyColumnSQL(tableName string, col *schemas.Column) string {
s, _ := ColumnString(db.dialect, col, false)
- return fmt.Sprintf("alter table %s MODIFY COLUMN %s", tableName, s)
+ return fmt.Sprintf("ALTER TABLE %s MODIFY COLUMN %s", tableName, s)
}
func (b *Base) ForUpdateSQL(query string) string {
diff --git a/vendor/xorm.io/xorm/dialects/mssql.go b/vendor/xorm.io/xorm/dialects/mssql.go
index 8e76e53855..5340455dd3 100644
--- a/vendor/xorm.io/xorm/dialects/mssql.go
+++ b/vendor/xorm.io/xorm/dialects/mssql.go
@@ -368,6 +368,11 @@ func (db *mssql) DropTableSQL(tableName string) (string, bool) {
"DROP TABLE \"%s\"", tableName, tableName), true
}
+func (db *mssql) ModifyColumnSQL(tableName string, col *schemas.Column) string {
+ s, _ := ColumnString(db.dialect, col, false)
+ return fmt.Sprintf("ALTER TABLE %s ALTER COLUMN %s", tableName, s)
+}
+
func (db *mssql) IndexCheckSQL(tableName, idxName string) (string, []interface{}) {
args := []interface{}{idxName}
sql := "select name from sysindexes where id=object_id('" + tableName + "') and name=?"
diff --git a/vendor/xorm.io/xorm/dialects/sqlite3.go b/vendor/xorm.io/xorm/dialects/sqlite3.go
index 73f98beb9d..62a383976f 100644
--- a/vendor/xorm.io/xorm/dialects/sqlite3.go
+++ b/vendor/xorm.io/xorm/dialects/sqlite3.go
@@ -483,7 +483,7 @@ func (db *sqlite3) GetIndexes(queryer core.Queryer, ctx context.Context, tableNa
continue
}
- indexName := strings.Trim(sql[nNStart+6:nNEnd], "` []'\"")
+ indexName := strings.Trim(strings.TrimSpace(sql[nNStart+6:nNEnd]), "`[]'\"")
var isRegular bool
if strings.HasPrefix(indexName, "IDX_"+tableName) || strings.HasPrefix(indexName, "UQE_"+tableName) {
index.Name = indexName[5+len(tableName):]