mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-07 19:37:51 +00:00
linter
This commit is contained in:
parent
786bebe58b
commit
71f1e6f1dd
1 changed files with 4 additions and 4 deletions
|
|
@ -30,7 +30,6 @@ import (
|
|||
pilosa "github.com/molecula/featurebase/v2"
|
||||
"github.com/molecula/featurebase/v2/server"
|
||||
"github.com/molecula/featurebase/v2/topology"
|
||||
"github.com/molecula/featurebase/v2/vprint"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
|
|
@ -150,18 +149,19 @@ func (cmd *RestoreCommand) restoreSchema(ctx context.Context, primary *topology.
|
|||
}
|
||||
return false
|
||||
}
|
||||
logger := cmd.Logger()
|
||||
//NOTE SHOULD ONLY BE ONE
|
||||
for _, index := range schema.Indexes {
|
||||
if exists(index.Name) {
|
||||
return errors.New(fmt.Sprintf("Index Exists %v", index.Name))
|
||||
return fmt.Errorf("Index Exists %v", index.Name)
|
||||
}
|
||||
vprint.VV("Create INDEX %v", index.Name)
|
||||
logger.Printf("Create INDEX %v", index.Name)
|
||||
err = cmd.client.CreateIndex(ctx, index.Name, index.Options)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
for _, field := range index.Fields {
|
||||
vprint.VV("Create Field %v", field.Name)
|
||||
logger.Printf("Create Field %v", field.Name)
|
||||
err = cmd.client.CreateFieldWithOptions(ctx, index.Name, field.Name, field.Options)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue