]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/store/mysql/mysql_store.cpp
Ticket 37. if (schemaVersion > 1) check added and td->tariffConf.changePolicy variable
[stg.git] / projects / stargazer / plugins / store / mysql / mysql_store.cpp
index 37da860b94f627244265f9d9ced24e76f37f0548..754a9ee223483094ca8dd90437a3a275bf16e6e4 100644 (file)
@@ -1661,6 +1661,26 @@ else
     td->tariffConf.period = TARIFF::MONTH;
     }
 
+if (schemaVersion > 1)
+{
+    str = row[6+8*DIR_NUM];
+    param = "ChangePolicy";
+
+    if (str.length() == 0)
+        {
+        mysql_free_result(res);
+        errorStr = "Cannot read tariff " + tariffName + ". Parameter " + param;
+        mysql_close(sock);
+        return -1;
+        }
+
+    td->tariffConf.changePolicy = TARIFF::StringToChangePolicy(str);
+    }
+else
+    {
+    td->tariffConf.changePolicy = TARIFF::ALLOW;
+    }
+
 mysql_free_result(res);
 mysql_close(sock);
 return 0;