Fixed drone build
Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
This commit is contained in:
parent
7f854f3ee7
commit
d1f1b7a5c2
5
Gopkg.lock
generated
5
Gopkg.lock
generated
|
|
@ -299,8 +299,7 @@
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/go-xorm/builder"
|
name = "github.com/go-xorm/builder"
|
||||||
packages = ["."]
|
packages = ["."]
|
||||||
revision = "bad0a612f0d6277b953910822ab5dfb30dd18237"
|
revision = "9283e7910554af2071cdb04c71b18e5a6ee1ca40"
|
||||||
version = "v0.2.0"
|
|
||||||
|
|
||||||
[[projects]]
|
[[projects]]
|
||||||
name = "github.com/go-xorm/core"
|
name = "github.com/go-xorm/core"
|
||||||
|
|
@ -875,6 +874,6 @@
|
||||||
[solve-meta]
|
[solve-meta]
|
||||||
analyzer-name = "dep"
|
analyzer-name = "dep"
|
||||||
analyzer-version = 1
|
analyzer-version = 1
|
||||||
inputs-digest = "4aeb6b1c6c7d9e4c915c19802c66d6503044797f7881dc42424cdd250ce9513e"
|
inputs-digest = "c3d7e9c0a37b01871b651b18a44c8a77a9a91f2e43e360178282ea9e3d667248"
|
||||||
solver-name = "gps-cdcl"
|
solver-name = "gps-cdcl"
|
||||||
solver-version = 1
|
solver-version = 1
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,8 @@ ignored = ["google.golang.org/appengine*"]
|
||||||
|
|
||||||
[[override]]
|
[[override]]
|
||||||
name = "github.com/go-xorm/builder"
|
name = "github.com/go-xorm/builder"
|
||||||
version = "0.2.0"
|
#version = "0.2.0"
|
||||||
|
revision = "9283e7910554af2071cdb04c71b18e5a6ee1ca40"
|
||||||
|
|
||||||
[[override]]
|
[[override]]
|
||||||
name = "github.com/gorilla/mux"
|
name = "github.com/gorilla/mux"
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ var migrations = []Migration{
|
||||||
// v68 -> V69
|
// v68 -> V69
|
||||||
NewMigration("Reformat and remove incorrect topics", reformatAndRemoveIncorrectTopics),
|
NewMigration("Reformat and remove incorrect topics", reformatAndRemoveIncorrectTopics),
|
||||||
// v69 -> v70
|
// v69 -> v70
|
||||||
//NewMigration("move team units to team_unit table", moveTeamUnitsToTeamUnitTable),
|
NewMigration("move team units to team_unit table", moveTeamUnitsToTeamUnitTable),
|
||||||
}
|
}
|
||||||
|
|
||||||
// Migrate database to current version
|
// Migrate database to current version
|
||||||
|
|
|
||||||
5
vendor/github.com/go-xorm/builder/builder.go
generated
vendored
5
vendor/github.com/go-xorm/builder/builder.go
generated
vendored
|
|
@ -67,6 +67,11 @@ func (b *Builder) From(tableName string) *Builder {
|
||||||
return b
|
return b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TableName returns the table name
|
||||||
|
func (b *Builder) TableName() string {
|
||||||
|
return b.tableName
|
||||||
|
}
|
||||||
|
|
||||||
// Into sets insert table name
|
// Into sets insert table name
|
||||||
func (b *Builder) Into(tableName string) *Builder {
|
func (b *Builder) Into(tableName string) *Builder {
|
||||||
b.tableName = tableName
|
b.tableName = tableName
|
||||||
|
|
|
||||||
113
vendor/github.com/go-xorm/xorm/engine_table.go
generated
vendored
Normal file
113
vendor/github.com/go-xorm/xorm/engine_table.go
generated
vendored
Normal file
|
|
@ -0,0 +1,113 @@
|
||||||
|
// Copyright 2018 The Xorm Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package xorm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"reflect"
|
||||||
|
"strings"
|
||||||
|
|
||||||
|
"github.com/go-xorm/core"
|
||||||
|
)
|
||||||
|
|
||||||
|
// TableNameWithSchema will automatically add schema prefix on table name
|
||||||
|
func (engine *Engine) tbNameWithSchema(v string) string {
|
||||||
|
// Add schema name as prefix of table name.
|
||||||
|
// Only for postgres database.
|
||||||
|
if engine.dialect.DBType() == core.POSTGRES &&
|
||||||
|
engine.dialect.URI().Schema != "" &&
|
||||||
|
engine.dialect.URI().Schema != postgresPublicSchema &&
|
||||||
|
strings.Index(v, ".") == -1 {
|
||||||
|
return engine.dialect.URI().Schema + "." + v
|
||||||
|
}
|
||||||
|
return v
|
||||||
|
}
|
||||||
|
|
||||||
|
// TableName returns table name with schema prefix if has
|
||||||
|
func (engine *Engine) TableName(bean interface{}, includeSchema ...bool) string {
|
||||||
|
tbName := engine.tbNameNoSchema(bean)
|
||||||
|
if len(includeSchema) > 0 && includeSchema[0] {
|
||||||
|
tbName = engine.tbNameWithSchema(tbName)
|
||||||
|
}
|
||||||
|
|
||||||
|
return tbName
|
||||||
|
}
|
||||||
|
|
||||||
|
// tbName get some table's table name
|
||||||
|
func (session *Session) tbNameNoSchema(table *core.Table) string {
|
||||||
|
if len(session.statement.AltTableName) > 0 {
|
||||||
|
return session.statement.AltTableName
|
||||||
|
}
|
||||||
|
|
||||||
|
return table.Name
|
||||||
|
}
|
||||||
|
|
||||||
|
func (engine *Engine) tbNameForMap(v reflect.Value) string {
|
||||||
|
if v.Type().Implements(tpTableName) {
|
||||||
|
return v.Interface().(TableName).TableName()
|
||||||
|
}
|
||||||
|
if v.Kind() == reflect.Ptr {
|
||||||
|
v = v.Elem()
|
||||||
|
if v.Type().Implements(tpTableName) {
|
||||||
|
return v.Interface().(TableName).TableName()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return engine.TableMapper.Obj2Table(v.Type().Name())
|
||||||
|
}
|
||||||
|
|
||||||
|
func (engine *Engine) tbNameNoSchema(tablename interface{}) string {
|
||||||
|
switch tablename.(type) {
|
||||||
|
case []string:
|
||||||
|
t := tablename.([]string)
|
||||||
|
if len(t) > 1 {
|
||||||
|
return fmt.Sprintf("%v AS %v", engine.Quote(t[0]), engine.Quote(t[1]))
|
||||||
|
} else if len(t) == 1 {
|
||||||
|
return engine.Quote(t[0])
|
||||||
|
}
|
||||||
|
case []interface{}:
|
||||||
|
t := tablename.([]interface{})
|
||||||
|
l := len(t)
|
||||||
|
var table string
|
||||||
|
if l > 0 {
|
||||||
|
f := t[0]
|
||||||
|
switch f.(type) {
|
||||||
|
case string:
|
||||||
|
table = f.(string)
|
||||||
|
case TableName:
|
||||||
|
table = f.(TableName).TableName()
|
||||||
|
default:
|
||||||
|
v := rValue(f)
|
||||||
|
t := v.Type()
|
||||||
|
if t.Kind() == reflect.Struct {
|
||||||
|
table = engine.tbNameForMap(v)
|
||||||
|
} else {
|
||||||
|
table = engine.Quote(fmt.Sprintf("%v", f))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if l > 1 {
|
||||||
|
return fmt.Sprintf("%v AS %v", engine.Quote(table),
|
||||||
|
engine.Quote(fmt.Sprintf("%v", t[1])))
|
||||||
|
} else if l == 1 {
|
||||||
|
return engine.Quote(table)
|
||||||
|
}
|
||||||
|
case TableName:
|
||||||
|
return tablename.(TableName).TableName()
|
||||||
|
case string:
|
||||||
|
return tablename.(string)
|
||||||
|
case reflect.Value:
|
||||||
|
v := tablename.(reflect.Value)
|
||||||
|
return engine.tbNameForMap(v)
|
||||||
|
default:
|
||||||
|
v := rValue(tablename)
|
||||||
|
t := v.Type()
|
||||||
|
if t.Kind() == reflect.Struct {
|
||||||
|
return engine.tbNameForMap(v)
|
||||||
|
}
|
||||||
|
return engine.Quote(fmt.Sprintf("%v", tablename))
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user