From 79b3f173fb8c7246ba165c5bd93da186dac8e4bf Mon Sep 17 00:00:00 2001 From: Jared Scheib Date: Wed, 1 Nov 2017 10:56:19 -0700 Subject: [PATCH] Change version on UsersBucket to V2 for clean upgrade path Signed-off-by: Michael de Sa Signed-off-by: Jared Scheib --- bolt/client.go | 4 ---- bolt/users.go | 20 +------------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/bolt/client.go b/bolt/client.go index ee347461a..43eb06d10 100644 --- a/bolt/client.go +++ b/bolt/client.go @@ -89,10 +89,6 @@ func (c *Client) Open(ctx context.Context) error { if err := c.OrganizationsStore.Migrate(ctx); err != nil { return err } - // TODO: this will have to change, and is temporary - if err := c.UsersStore.Migrate(ctx); err != nil { - return err - } return nil } diff --git a/bolt/users.go b/bolt/users.go index c867edad4..1397d4039 100644 --- a/bolt/users.go +++ b/bolt/users.go @@ -13,31 +13,13 @@ import ( var _ chronograf.UsersStore = &UsersStore{} // UsersBucket is used to store users local to chronograf -var UsersBucket = []byte("UsersV1") +var UsersBucket = []byte("UsersV2") // UsersStore uses bolt to store and retrieve users type UsersStore struct { client *Client } -// Migrate changes all existing users to be SuperAdmin -func (s *UsersStore) Migrate(ctx context.Context) error { - users, err := s.All(ctx) - if err != nil { - return err - } - - // TODO(desa): REMOVE!!!!!!!!!!!!!! - for _, u := range users { - u.SuperAdmin = true - if err := s.Update(ctx, &u); err != nil { - return err - } - } - - return nil -} - // get searches the UsersStore for user with id and returns the bolt representation func (s *UsersStore) get(ctx context.Context, id uint64) (*chronograf.User, error) { var u chronograf.User