Fix compatibility bug under postgres
This commit is contained in:
parent
bc68761f8e
commit
0a41ec3e8f
|
@ -250,6 +250,7 @@ const cmdLogoutHelp = `logout - Logout from Skype`
|
|||
|
||||
func (handler *CommandHandler) CommandLogout(ce *CommandEvent) {
|
||||
if ce.User.Conn == nil {
|
||||
ce.Reply("You're not logged into Skype.")
|
||||
return
|
||||
}
|
||||
//_ = ce.User.Conn.GetConversations("", ce.User.bridge.Config.Bridge.InitialChatSync)
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package upgrades
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
)
|
||||
|
||||
func init() {
|
||||
upgrades[19] = upgrade{"Update user fields varying.", func(tx *sql.Tx, c context) error {
|
||||
if c.dialect == Postgres {
|
||||
_, err := tx.Exec(`ALTER TABLE "user" ALTER COLUMN skype_token TYPE varchar(1500),
|
||||
ALTER COLUMN registration_token TYPE varchar(1500),
|
||||
ALTER COLUMN registration_token_str TYPE varchar(1500)`)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}}
|
||||
}
|
|
@ -39,7 +39,7 @@ type upgrade struct {
|
|||
fn upgradeFunc
|
||||
}
|
||||
|
||||
const NumberOfUpgrades = 19
|
||||
const NumberOfUpgrades = 20
|
||||
|
||||
var upgrades [NumberOfUpgrades]upgrade
|
||||
|
||||
|
|
Loading…
Reference in New Issue