[MM-41576] Revamp database schema version (#19586)
* 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
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
05503440a6
Коммит
645fee3fe3
@@ -68,6 +68,7 @@ func TestMfaRequired(t *testing.T) {
|
||||
mockStore.On("User").Return(&mockUserStore)
|
||||
mockStore.On("Post").Return(&mockPostStore)
|
||||
mockStore.On("System").Return(&mockSystemStore)
|
||||
mockStore.On("GetDBSchemaVersion").Return(1, nil)
|
||||
|
||||
th.App.Srv().SetLicense(model.NewTestLicense("mfa"))
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ func TestHandlerServeHTTPSecureTransport(t *testing.T) {
|
||||
mockStore.On("User").Return(&mockUserStore)
|
||||
mockStore.On("Post").Return(&mockPostStore)
|
||||
mockStore.On("System").Return(&mockSystemStore)
|
||||
mockStore.On("GetDBSchemaVersion").Return(1, nil)
|
||||
|
||||
th.App.UpdateConfig(func(config *model.Config) {
|
||||
*config.ServiceSettings.TLSStrictTransport = true
|
||||
@@ -321,6 +322,7 @@ func TestHandlerServeCSPHeader(t *testing.T) {
|
||||
mockStore.On("User").Return(&mockUserStore)
|
||||
mockStore.On("Post").Return(&mockPostStore)
|
||||
mockStore.On("System").Return(&mockSystemStore)
|
||||
mockStore.On("GetDBSchemaVersion").Return(1, nil)
|
||||
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
*cfg.ServiceSettings.SiteURL = *cfg.ServiceSettings.SiteURL + "/subpath"
|
||||
@@ -641,6 +643,7 @@ func TestCheckCSRFToken(t *testing.T) {
|
||||
mockStore.On("User").Return(&mockUserStore)
|
||||
mockStore.On("Post").Return(&mockPostStore)
|
||||
mockStore.On("System").Return(&mockSystemStore)
|
||||
mockStore.On("GetDBSchemaVersion").Return(1, nil)
|
||||
|
||||
th.App.UpdateConfig(func(cfg *model.Config) {
|
||||
*cfg.ServiceSettings.ExperimentalStrictCSRFEnforcement = true
|
||||
|
||||
Ссылка в новой задаче
Block a user