PLT-3695 refactoring to use sql_upgrader (#3788)
* PLT-3695 unitying upgrade support * PLT-3695 refactoring to use sql_upgrader * Fixing unit test * Adding 3.3 to 3.4 * Fixing upgrading * Seperating DB schema from version.go * Fixing upgrade cmd * Moving to const for exit codes * remving old unused code
Этот коммит содержится в:
@@ -29,14 +29,6 @@ func NewSqlSessionStore(sqlStore *SqlStore) SessionStore {
|
||||
return us
|
||||
}
|
||||
|
||||
func (me SqlSessionStore) UpgradeSchemaIfNeeded() {
|
||||
// ADDED for 2.1 REMOVE for 2.5
|
||||
deviceIdLength := me.GetMaxLengthOfColumnIfExists("Sessions", "DeviceId")
|
||||
if len(deviceIdLength) > 0 && deviceIdLength != "512" {
|
||||
me.AlterColumnTypeIfExists("Sessions", "DeviceId", "VARCHAR(512)", "VARCHAR(512)")
|
||||
}
|
||||
}
|
||||
|
||||
func (me SqlSessionStore) CreateIndexesIfNotExists() {
|
||||
me.CreateIndexIfNotExists("idx_sessions_user_id", "Sessions", "UserId")
|
||||
me.CreateIndexIfNotExists("idx_sessions_token", "Sessions", "Token")
|
||||
|
||||
Ссылка в новой задаче
Block a user