Skip to content

Commit

Permalink
fix(backend): improve forward / backward compatibility on db status t…
Browse files Browse the repository at this point in the history
…able (#4351)
  • Loading branch information
frozeNinK authored Aug 13, 2020
1 parent 5ec7ec8 commit 384afac
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion backend/src/apiserver/storage/db_status_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ type DBStatusStoreInterface interface {
MarkSampleLoaded() error
}

var (
dbStatusStoreColumns = []string{
"HaveSamplesLoaded",
}
)

// Implementation of a DBStatusStoreInterface. This store read/write state of the database.
// For now we store status like whether sample is loaded.
type DBStatusStore struct {
Expand Down Expand Up @@ -77,7 +83,7 @@ func (s *DBStatusStore) InitializeDBStatusTable() error {

func (s *DBStatusStore) HaveSamplesLoaded() (bool, error) {
var haveSamplesLoaded bool
sql, args, err := sq.Select("*").From("db_statuses").ToSql()
sql, args, err := sq.Select(dbStatusStoreColumns...).From("db_statuses").ToSql()
if err != nil {
return false, util.NewInternalServerError(err, "Error creating query to get load sample status.")
}
Expand Down

0 comments on commit 384afac

Please sign in to comment.