diff options
author | Martin Kraft <mkraft@users.noreply.github.com> | 2018-05-21 06:10:26 -0400 |
---|---|---|
committer | Jesús Espino <jespinog@gmail.com> | 2018-05-21 12:10:26 +0200 |
commit | eb78d273f39202046fa71555a5a19b0ec8a95cb3 (patch) | |
tree | 0781ec60222b3c926f88022f6416b8925e25b3ec /app/app.go | |
parent | c6ba5c32d62f8c1fd0e0669a3df0c844ec794590 (diff) | |
download | chat-eb78d273f39202046fa71555a5a19b0ec8a95cb3.tar.gz chat-eb78d273f39202046fa71555a5a19b0ec8a95cb3.tar.bz2 chat-eb78d273f39202046fa71555a5a19b0ec8a95cb3.zip |
Refactors migrations check. (#8814)
Diffstat (limited to 'app/app.go')
-rw-r--r-- | app/app.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/app.go b/app/app.go index d4a663e32..16470d850 100644 --- a/app/app.go +++ b/app/app.go @@ -92,6 +92,8 @@ type App struct { clientConfig map[string]string clientConfigHash string diagnosticId string + + phase2PermissionsMigrationComplete bool } var appCount = 0 @@ -588,3 +590,14 @@ func (a *App) DoAdvancedPermissionsMigration() { mlog.Critical(fmt.Sprint(result.Err)) } } + +func (a *App) SetPhase2PermissionsMigrationStatus(isComplete bool) error { + if !isComplete { + res := <-a.Srv.Store.System().PermanentDeleteByName(model.MIGRATION_KEY_ADVANCED_PERMISSIONS_PHASE_2) + if res.Err != nil { + return res.Err + } + } + a.phase2PermissionsMigrationComplete = isComplete + return nil +} |