Revert "[MM-41576] Revamp database schema version (#19586)" (#19746)

* Revert "[MM-41576] Revamp database schema version (#19586)"

This reverts commit 645fee3fe3.

* Revert "MM-42049 - license endpoint not working (#19686)"

This reverts commit 4fe89e5847.
Этот коммит содержится в:
Jesse Hallam
2022-03-08 16:28:28 -04:00
коммит произвёл GitHub
родитель eff39010d8
Коммит a2a78577e9
47 изменённых файлов: 215 добавлений и 475 удалений

Просмотреть файл

@@ -20,7 +20,6 @@ import (
"os/exec"
"path"
"runtime"
"strconv"
"strings"
"sync"
"sync/atomic"
@@ -753,8 +752,8 @@ func (s *Server) Channels() *Channels {
// Return Database type (postgres or mysql) and current version of Mattermost
func (s *Server) DatabaseTypeAndMattermostVersion() (string, string) {
schemaVersion, _ := s.Store.GetDBSchemaVersion()
return *s.Config().SqlSettings.DriverName, strconv.Itoa(schemaVersion)
mattermostVersion, _ := s.Store.System().GetByName("Version")
return *s.Config().SqlSettings.DriverName, mattermostVersion.Value
}
// initLogging initializes and configures the logger(s). This may be called more than once.
@@ -1880,6 +1879,8 @@ func (ch *Channels) ClientConfigHash() string {
func (s *Server) initJobs() {
s.Jobs = jobs.NewJobServer(s, s.Store, s.Metrics)
s.Jobs.InitWorkers()
s.Jobs.InitSchedulers()
if jobsDataRetentionJobInterface != nil {
builder := jobsDataRetentionJobInterface(s)
@@ -2303,11 +2304,3 @@ func runDNDStatusExpireJob(a *App) {
}
})
}
func (a *App) GetAppliedSchemaMigrations() ([]model.AppliedMigration, *model.AppError) {
table, err := a.Srv().Store.GetAppliedMigrations()
if err != nil {
return nil, model.NewAppError("GetDBSchemaTable", "api.file.read_file.app_error", nil, err.Error(), http.StatusInternalServerError)
}
return table, nil
}