Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
fix: prevent copydb to create a fresh memos (#2486)
Athurg Gooth35f0861d6eaa
diff --git a/cmd/copydb.go b/cmd/copydb.goindex fed5c1963..6f7727b9d 100644--- a/cmd/copydb.go+++ b/cmd/copydb.go@@ -59,6 +59,13 @@ func copydb(fromProfile, toProfile *_profile.Profile) error {return errors.Wrap(err, "fail to create `to` driver")}+ // Check if `to` driver has been created before+ if history, err := toDriver.FindMigrationHistoryList(ctx, nil); err != nil {+ return errors.New("fail to check migration history of `to` driver")+ } else if len(history) == 0 {+ return errors.New("migration history of `to` driver should not be empty")+ }+if err := toDriver.Migrate(ctx); err != nil {return errors.Wrap(err, "fail to migrate db")}