mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-23 04:19:25 +01:00
commit
010bb3e926
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user