@@ -56,6 +56,7 @@ if(file.Exists( "bin/gmsv_mysqloo_linux.dll", "LUA" ) or file.Exists( "bin/gmsv_
5656 MSync_Version_Table .onError = function (Q ,E ) print (" Q1" ) print (E ) end
5757 MSync_Version_Table :start ()
5858
59+ MSync .Settings .DBVersion = MSync .DBVersion
5960 MSync .Settings .RDBVersion = MSync .Settings .RDBVersion or 0
6061 MSync .Settings .BDBVersion = MSync .Settings .BDBVersion or 0
6162 end
@@ -92,6 +93,7 @@ if(file.Exists( "bin/gmsv_mysqloo_linux.dll", "LUA" ) or file.Exists( "bin/gmsv_
9293 ]] )
9394 transaction :addQuery (MRSyncUpdateDB )
9495 print (" [MRSync] Going to update DB structure to v1.1" )
96+ MSync .Settings .RDBVersion = MSync .RDBVersion
9597 end
9698 end
9799
@@ -135,6 +137,7 @@ if(file.Exists( "bin/gmsv_mysqloo_linux.dll", "LUA" ) or file.Exists( "bin/gmsv_
135137 ]] )
136138 transaction :addQuery (updateQuery )
137139 print (" [MBSync] Going to update DB structure to v1.1" )
140+
138141 end
139142
140143 if (MSync .Settings .BDBVersion < 1.2 ) then
@@ -162,8 +165,8 @@ if(file.Exists( "bin/gmsv_mysqloo_linux.dll", "LUA" ) or file.Exists( "bin/gmsv_
162165 ]] )
163166 transaction :addQuery (updateQuery )
164167 print (" [MBSync] Going to update DB structure to v1.3" )
168+ MSync .Settings .BDBVersion = MSync .BDBVersion
165169 end
166-
167170 end
168171 --[[ if(table.HasValue(MSync.Settings.EnabledModules, "MPSync")) then
169172 //Ranks
@@ -177,19 +180,16 @@ if(file.Exists( "bin/gmsv_mysqloo_linux.dll", "LUA" ) or file.Exists( "bin/gmsv_
177180 if transaction :getQueries () ~= nil then
178181 transaction .onError = function (tr , err ) print (" [MSync] Database creation/update failed: " .. err ) end
179182 transaction .onSuccess = function ()
180- MSync .Settings .DBVersion = MSync .DBVersion
181- MSync .Settings .RDBVersion = MSync .RDBVersion
182- MSync .Settings .BDBVersion = MSync .BDBVersion
183183 MSync .SaveSettings ()
184184 print (" [MSync] Database upgrade successful, current DB schema version " .. MSync .DBVersion )
185185 end
186186 transaction :start ()
187187 end
188188
189189 local MSync_Version_Table = server :query ([[
190- INSERT into `msync_db_version` (`version`,`version_index`) VALUES (']] .. MSync .DBVersion .. [[ ','DBVersion') ON DUPLICATE KEY UPDATE version=VALUES(version);
191- INSERT into `msync_db_version` (`version`,`version_index`) VALUES (']] .. MSync .RDBVersion .. [[ ','RDBVersion') ON DUPLICATE KEY UPDATE version=VALUES(version);
192- INSERT into `msync_db_version` (`version`,`version_index`) VALUES (']] .. MSync .BDBVersion .. [[ ','BDBVersion') ON DUPLICATE KEY UPDATE version=VALUES(version)
190+ INSERT into `msync_db_version` (`version`,`version_index`) VALUES (']] .. MSync .Settings . DBVersion .. [[ ','DBVersion') ON DUPLICATE KEY UPDATE version=VALUES(version);
191+ INSERT into `msync_db_version` (`version`,`version_index`) VALUES (']] .. MSync .Settings . RDBVersion .. [[ ','RDBVersion') ON DUPLICATE KEY UPDATE version=VALUES(version);
192+ INSERT into `msync_db_version` (`version`,`version_index`) VALUES (']] .. MSync .Settings . BDBVersion .. [[ ','BDBVersion') ON DUPLICATE KEY UPDATE version=VALUES(version)
193193 ]] )
194194 MSync_Version_Table .onError = function (Q ,E ) print (" Q1" ) print (E ) end
195195 MSync_Version_Table :start ()
0 commit comments