Create func to automatically create DB indexes rather than just documenting them in a comment that has to be manually executed

This commit is contained in:
David Dworken
2023-09-22 19:11:43 -07:00
parent 51f2c15f35
commit cc11916f3c
3 changed files with 24 additions and 9 deletions

View File

@ -95,6 +95,10 @@ func OpenDB() (*database.DB, error) {
return nil, fmt.Errorf("failed to create underlying DB tables: %w", err)
}
}
err := db.CreateIndices()
if err != nil {
return nil, err
}
return db, nil
}