Exclude schema from index name (#65)

Exclude schema from the index name

simple drone test

fix column default value be empty (#59)

Use https for gocover badge (#64)

Co-authored-by: Guillermo Prandi <guillep2k@users.noreply.github.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-authored-by: SijmenSchoon <sijmenschoon@noreply@gitea.io>
Reviewed-on: https://gitea.com/xorm/core/pulls/65
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Guillermo Prandi 2020-01-19 09:04:11 +00:00 committed by Lunny Xiao
parent 6a6d853b6d
commit 1e7bccc690
1 changed files with 2 additions and 2 deletions

View File

@ -26,8 +26,8 @@ type Index struct {
func (index *Index) XName(tableName string) string { func (index *Index) XName(tableName string) string {
if !strings.HasPrefix(index.Name, "UQE_") && if !strings.HasPrefix(index.Name, "UQE_") &&
!strings.HasPrefix(index.Name, "IDX_") { !strings.HasPrefix(index.Name, "IDX_") {
tableName = strings.Replace(tableName, `"`, "", -1) tableParts := strings.Split(strings.Replace(tableName, `"`, "", -1), ".")
tableName = strings.Replace(tableName, `.`, "_", -1) tableName = tableParts[len(tableParts)-1]
if index.Type == UniqueType { if index.Type == UniqueType {
return fmt.Sprintf("UQE_%v_%v", tableName, index.Name) return fmt.Sprintf("UQE_%v_%v", tableName, index.Name)
} }