X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/bd6a9a4e59fa38929491c7114abef914d4002ee5..0667c218f13a0e68f520016ef47210d198eac4b7:/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp diff --git a/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp b/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp index 045411b1..0dd74902 100644 --- a/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp +++ b/projects/stargazer/plugins/store/postgresql/postgresql_store_tariffs.cpp @@ -317,6 +317,10 @@ int32_t id; if (version > 6) query << ", period = '" << TARIFF::PeriodToString(td.tariffConf.period) << "'"; + if (version > 7) + query << ", change_policy = '" << TARIFF::ChangePolicyToString(td.tariffConf.changePolicy) << "', \ + change_policy_timeout = CAST('" << Int2TS(td.tariffConf.changePolicyTimeout) << "' AS TIMESTAMP)"; + query << " WHERE pk_tariff = " << id; result = PQexec(connection, query.str().c_str()); @@ -455,6 +459,9 @@ query << "SELECT pk_tariff, \ if (version > 6) query << ", period"; +if (version > 7) + query << ", change_policy"; + query << " FROM tb_tariffs WHERE name = '" << ename << "'"; result = PQexec(connection, query.str().c_str()); @@ -505,6 +512,9 @@ int id; if (version > 6) td->tariffConf.period = TARIFF::StringToPeriod(PQgetvalue(result, 0, 5)); +if (version > 7) + td->tariffConf.changePolicy = TARIFF::StringToChangePolicy(PQgetvalue(result, 0, 6)); + PQclear(result); query.str("");