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;
if (schemaVersion > 0)
res += ", Period='" + TARIFF::PeriodToString(td.tariffConf.period) + "'";
+if (schemaVersion > 1)
+ res += ", change_policy='" + TARIFF::ChangePolicyToString(td.tariffConf.changePolicy) + "'";
+
strprintf(¶m, " WHERE name='%s' LIMIT 1", tariffName.c_str());
res += param;