MCPcopy Create free account
hub / github.com/aui-framework/aui / doMigration

Method doMigration

aui.data/src/AUI/Data/AMigrationManager.cpp:22–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20}
21
22void AMigrationManager::doMigration()
23{
24 int migrationNumber = AMeta::get("migration").toInt();
25 unsigned index = 0;
26
27
28 try {
29 for (auto& m : mMigrations)
30 {
31 if (migrationNumber == 0)
32 {
33 m.second();
34 ALogger::info("Successful migration "_i18n + AString::number(index) + " (" + mMigrations.at(index).first + ")");
35 }
36 else
37 {
38 migrationNumber -= 1;
39 }
40 ++index;
41 }
42 } catch (const AException& e)
43 {
44 AError::handle(e, "Could not finish migration "_i18n + AString::number(index) + " (" + mMigrations.at(index).first + ")");
45 }
46
47 AMeta::set("migration", index);
48}

Callers 1

SetUpMethod · 0.80

Calls 7

getFunction · 0.85
infoFunction · 0.85
numberFunction · 0.85
atMethod · 0.80
setFunction · 0.70
handleFunction · 0.50
toIntMethod · 0.45

Tested by 1

SetUpMethod · 0.64