From 6cc206ce655c490e7e927316ea4abdf7ffb54302 Mon Sep 17 00:00:00 2001 From: totoro Date: Mon, 22 Aug 2022 10:24:26 +0900 Subject: [PATCH] [*] in the database migration, in case of an empty database we execute all migration instead the last like before, because during migration, there is some stuff to do like filling table with default data, etc. That's why we need to execute the migration loop. --- database/migration_sqlite3.anubis | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/database/migration_sqlite3.anubis b/database/migration_sqlite3.anubis index bfd6d02..8a80c33 100644 --- a/database/migration_sqlite3.anubis +++ b/database/migration_sqlite3.anubis @@ -282,11 +282,14 @@ public define Maybe(One) )= if is_empty_database(db) then // new empty database logger(logInfo, "No database found. Creating a new one..."); - if last(all_migrations) is success(migration) then - do_table_indexes(db, logger, migration, update_db_version) - else - logger(logError, "No database migration found. Can't create Database"); - failure + + do_migration_loop(db, logger, current_db_version, all_migrations, update_db_version) + +// if last(all_migrations) is success(migration) then +// do_table_indexes(db, logger, migration, update_db_version) +// else +// logger(logError, "No database migration found. Can't create Database"); +// failure else ( // with db_version = get_db_version, -- libgit2 0.21.4