Commit 6df1914c50c820e73f55cd363327cbdd2643f708
1 parent
ece42708
IMPORTANT CHANGE
load_vtm and load_latest_vtm call arguments changed. Now we must provide the name of application and the path where to search the vtm file. the filename format of the vtm file are also changed. Now the vtm file name must follow the following rule: AAAA_vtm_vVVVV.adm where : AAAA = name of the application VVVV = version of database as example for application named "my_app" with version "1.2.0.0" the vtm file name must be "my_app_vtm_v1.2.0.0.adm"
Showing
1 changed file
with
22 additions
and
14 deletions
Show diff stats
view/load_vtm.anubis
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | 9 | ||
| 10 | transmit view_table_manager_types.anubis | 10 | transmit view_table_manager_types.anubis |
| 11 | 11 | ||
| 12 | -define String modules_directory = find_and_replace(my_anubis_directory, "\", "/") + "/modules/". | 12 | +//define String modules_directory = find_and_replace(my_anubis_directory, "\", "/") + "/modules/". |
| 13 | 13 | ||
| 14 | public define Maybe(VTM) | 14 | public define Maybe(VTM) |
| 15 | load_plugin | 15 | load_plugin |
| @@ -34,6 +34,7 @@ public define Maybe(VTM) | @@ -34,6 +34,7 @@ public define Maybe(VTM) | ||
| 34 | define Maybe(VTM) | 34 | define Maybe(VTM) |
| 35 | load_vtm | 35 | load_vtm |
| 36 | ( | 36 | ( |
| 37 | + String app_vtm_path, | ||
| 37 | List(String) left, | 38 | List(String) left, |
| 38 | DB_Version vtm_version | 39 | DB_Version vtm_version |
| 39 | )= | 40 | )= |
| @@ -41,13 +42,13 @@ define Maybe(VTM) | @@ -41,13 +42,13 @@ define Maybe(VTM) | ||
| 41 | { | 42 | { |
| 42 | [] then failure, | 43 | [] then failure, |
| 43 | [file_name . t] then | 44 | [file_name . t] then |
| 44 | - if load_plugin(modules_directory+file_name) is | 45 | + if load_plugin(app_vtm_path+file_name) is |
| 45 | { | 46 | { |
| 46 | - failure then load_vtm(t, vtm_version), | 47 | + failure then load_vtm(app_vtm_path, t, vtm_version), |
| 47 | success(_vtm) then | 48 | success(_vtm) then |
| 48 | if compare_db_version(_vtm.db_version, vtm_version) is | 49 | if compare_db_version(_vtm.db_version, vtm_version) is |
| 49 | { | 50 | { |
| 50 | - less then load_vtm(t, vtm_version), | 51 | + less then load_vtm(app_vtm_path, t, vtm_version), |
| 51 | more then failure, | 52 | more then failure, |
| 52 | equal then success(_vtm), | 53 | equal then success(_vtm), |
| 53 | equal_but_sign then success(_vtm) | 54 | equal_but_sign then success(_vtm) |
| @@ -59,6 +60,7 @@ define Maybe(VTM) | @@ -59,6 +60,7 @@ define Maybe(VTM) | ||
| 59 | define Maybe(VTM) | 60 | define Maybe(VTM) |
| 60 | load_latest_vtm | 61 | load_latest_vtm |
| 61 | ( | 62 | ( |
| 63 | + String app_vtm_path, | ||
| 62 | List(String) left, | 64 | List(String) left, |
| 63 | VTM _current_vtm | 65 | VTM _current_vtm |
| 64 | )= | 66 | )= |
| @@ -71,16 +73,16 @@ define Maybe(VTM) | @@ -71,16 +73,16 @@ define Maybe(VTM) | ||
| 71 | else | 73 | else |
| 72 | success(_current_vtm), | 74 | success(_current_vtm), |
| 73 | [file_name . t] then | 75 | [file_name . t] then |
| 74 | - if load_plugin(modules_directory+file_name) is | 76 | + if load_plugin(app_vtm_path+file_name) is |
| 75 | { | 77 | { |
| 76 | - failure then load_latest_vtm(t, _current_vtm), | 78 | + failure then load_latest_vtm(app_vtm_path, t, _current_vtm), |
| 77 | success(_vtm) then | 79 | success(_vtm) then |
| 78 | if compare_db_version( _vtm.db_version, _current_vtm.db_version) is | 80 | if compare_db_version( _vtm.db_version, _current_vtm.db_version) is |
| 79 | { | 81 | { |
| 80 | - less then load_latest_vtm(t, _current_vtm), | ||
| 81 | - more then load_latest_vtm(t, _vtm), | ||
| 82 | - equal then load_latest_vtm(t, _current_vtm), | ||
| 83 | - equal_but_sign then load_latest_vtm(t, _current_vtm) | 82 | + less then load_latest_vtm(app_vtm_path, t, _current_vtm), |
| 83 | + more then load_latest_vtm(app_vtm_path, t, _vtm), | ||
| 84 | + equal then load_latest_vtm(app_vtm_path, t, _current_vtm), | ||
| 85 | + equal_but_sign then load_latest_vtm(app_vtm_path, t, _current_vtm) | ||
| 84 | } | 86 | } |
| 85 | } | 87 | } |
| 86 | } | 88 | } |
| @@ -89,16 +91,22 @@ define Maybe(VTM) | @@ -89,16 +91,22 @@ define Maybe(VTM) | ||
| 89 | public define Maybe(VTM) | 91 | public define Maybe(VTM) |
| 90 | load_vtm | 92 | load_vtm |
| 91 | ( | 93 | ( |
| 94 | + String app_vtm_path, | ||
| 95 | + String app_name, | ||
| 92 | DB_Version vtm_version | 96 | DB_Version vtm_version |
| 93 | ) | 97 | ) |
| 94 | = | 98 | = |
| 95 | - with files = directory_list(modules_directory, "vtm_v*.adm"), | ||
| 96 | - load_vtm(files, vtm_version) | 99 | + with files = directory_list(app_vtm_path, app_name+"_v*.vtm"), |
| 100 | + load_vtm(app_vtm_path, files, vtm_version) | ||
| 97 | . | 101 | . |
| 98 | 102 | ||
| 99 | public define Maybe(VTM) | 103 | public define Maybe(VTM) |
| 100 | load_latest_vtm | 104 | load_latest_vtm |
| 105 | + ( | ||
| 106 | + String app_vtm_path, | ||
| 107 | + String app_name | ||
| 108 | + ) | ||
| 101 | = | 109 | = |
| 102 | - with files = directory_list(modules_directory, "vtm_v*.adm"), | ||
| 103 | - load_latest_vtm(files, blank_vtm) | 110 | + with files = directory_list(app_vtm_path, app_name+"_vtm_v*.adm"), |
| 111 | + load_latest_vtm(app_vtm_path, files, blank_vtm) | ||
| 104 | . | 112 | . |