Commit 6cc206ce655c490e7e927316ea4abdf7ffb54302

Authored by David RENÉ
1 parent 18c01f91

[*] in the database migration, in case of an empty database we execute all migra…

…tion 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.
Showing 1 changed file with 8 additions and 5 deletions   Show diff stats
database/migration_sqlite3.anubis
@@ -282,11 +282,14 @@ public define Maybe(One) @@ -282,11 +282,14 @@ public define Maybe(One)
282 )= 282 )=
283 if is_empty_database(db) then // new empty database 283 if is_empty_database(db) then // new empty database
284 logger(logInfo, "No database found. Creating a new one..."); 284 logger(logInfo, "No database found. Creating a new one...");
285 - if last(all_migrations) is success(migration) then  
286 - do_table_indexes(db, logger, migration, update_db_version)  
287 - else  
288 - logger(logError, "No database migration found. Can't create Database");  
289 - failure 285 +
  286 + do_migration_loop(db, logger, current_db_version, all_migrations, update_db_version)
  287 +
  288 +// if last(all_migrations) is success(migration) then
  289 +// do_table_indexes(db, logger, migration, update_db_version)
  290 +// else
  291 +// logger(logError, "No database migration found. Can't create Database");
  292 +// failure
290 else 293 else
291 ( 294 (
292 // with db_version = get_db_version, 295 // with db_version = get_db_version,