summaryrefslogtreecommitdiffstats
path: root/store/sqlstore/user_store.go
diff options
context:
space:
mode:
Diffstat (limited to 'store/sqlstore/user_store.go')
-rw-r--r--store/sqlstore/user_store.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/store/sqlstore/user_store.go b/store/sqlstore/user_store.go
index 203ad4c26..d8a77cd9d 100644
--- a/store/sqlstore/user_store.go
+++ b/store/sqlstore/user_store.go
@@ -1316,3 +1316,14 @@ func (us SqlUserStore) ClearAllCustomRoleAssignments() store.StoreChannel {
}
})
}
+
+func (us SqlUserStore) InferSystemInstallDate() store.StoreChannel {
+ return store.Do(func(result *store.StoreResult) {
+ createAt, err := us.GetReplica().SelectInt("SELECT CreateAt FROM Users WHERE CreateAt IS NOT NULL ORDER BY CreateAt ASC LIMIT 1")
+ if err != nil {
+ result.Err = model.NewAppError("SqlUserStore.GetSystemInstallDate", "store.sql_user.get_system_install_date.app_error", nil, err.Error(), http.StatusInternalServerError)
+ return
+ }
+ result.Data = createAt
+ })
+}