about summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--database.h2
-rw-r--r--litterbox.c9
2 files changed, 3 insertions, 8 deletions
diff --git a/database.h b/database.h
index c852e11..878a5f6 100644
--- a/database.h
+++ b/database.h
@@ -123,7 +123,7 @@ static inline void dbFind(char *path, int flags) {
 		dataDirs += len;
 		if (*dataDirs) dataDirs++;
 	}
-	errx(EX_NOINPUT, "database not found");
+	errx(EX_NOINPUT, "database not found; initialize it with litterbox -i");
 }
 
 static struct Persist {
diff --git a/litterbox.c b/litterbox.c
index 632549a..808b565 100644
--- a/litterbox.c
+++ b/litterbox.c
@@ -793,17 +793,12 @@ int main(int argc, char *argv[]) {
 		dbInit();
 		return EX_OK;
 	}
-	if (migrate) {
-		dbMigrate();
-		return EX_OK;
-	}
 	if (backup) {
 		dbBackup(backup);
 		return EX_OK;
 	}
-	if (dbVersion() != DatabaseVersion) {
-		errx(EX_CONFIG, "database out of date; migrate with -m");
-	}
+	dbMigrate();
+	if (migrate) return EX_OK;
 	createJoins();
 
 	if (!host) errx(EX_USAGE, "host required");