[MM-41576] Add schema version to the client configuration (#19757)

* revamp db version and add applied migrations endpoint

* replace old schema version with new

* add db version subcommand

* add to local api

* reflect review comments

* log errors

* remove setting the version from model.CurrentVersion

* fix a test

* use different field for schema version

* add build hash and current version to the support packet

* add tests

* update test to use new assets
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2022-03-15 16:39:23 +03:00
коммит произвёл GitHub
родитель 47c44a9b7d
Коммит b03d87af40
35 изменённых файлов: 399 добавлений и 50 удалений

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

@@ -233,18 +233,18 @@ func TestDatabaseTypeAndMattermostVersion(t *testing.T) {
th := Setup(t)
defer th.TearDown()
databaseType, mattermostVersion := th.Server.DatabaseTypeAndMattermostVersion()
databaseType, mattermostVersion := th.Server.DatabaseTypeAndSchemaVersion()
assert.Equal(t, "postgres", databaseType)
assert.Equal(t, "5.31.0", mattermostVersion)
assert.GreaterOrEqual(t, mattermostVersion, strconv.Itoa(1))
os.Setenv("MM_SQLSETTINGS_DRIVERNAME", "mysql")
th2 := Setup(t)
defer th2.TearDown()
databaseType, mattermostVersion = th2.Server.DatabaseTypeAndMattermostVersion()
databaseType, mattermostVersion = th2.Server.DatabaseTypeAndSchemaVersion()
assert.Equal(t, "mysql", databaseType)
assert.Equal(t, "5.31.0", mattermostVersion)
assert.GreaterOrEqual(t, mattermostVersion, strconv.Itoa(1))
}
func TestGenerateSupportPacket(t *testing.T) {