Merge pull request #796 from slingamn/issue715_upgradedb

fix #715
This commit is contained in:
Shivaram Lingamneni 2020-02-22 20:07:03 -08:00 committed by GitHub
commit 010bb3e926
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -156,6 +156,12 @@ func performAutoUpgrade(currentVersion string, config *Config) (err error) {
// UpgradeDB upgrades the datastore to the latest schema. // UpgradeDB upgrades the datastore to the latest schema.
func UpgradeDB(config *Config) (err error) { func UpgradeDB(config *Config) (err error) {
// #715: test that the database exists
_, err = os.Stat(config.Datastore.Path)
if err != nil {
return err
}
store, err := buntdb.Open(config.Datastore.Path) store, err := buntdb.Open(config.Datastore.Path)
if err != nil { if err != nil {
return err return err