avniproject / avni-etl

GNU Affero General Public License v3.0
0 stars 6 forks source link

[ETL] Incorrect table name used for undoing exits and cancels #112

Open mahalakshme opened 2 weeks ago

mahalakshme commented 2 weeks ago

Issue:

org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [delete from "poweratuat"."indivi_exit_compensation_in_case_exit"
using "poweratuat"."indivi_exit_compensation_in_case"
where "poweratuat"."indivi_exit_compensation_in_case_exit".id = "poweratuat"."indivi_exit_compensation_in_case".id
and "poweratuat"."indivi_exit_compensation_in_case".program_exit_date_time is null;]
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:99)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:70)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:79)
at org.springframework.jdbc.core.JdbcTemplate.translateException(JdbcTemplate.java:1538)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:393)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:431)

Tech analysis:

AC:

Questions:

exit and cancel suffixes added at two places when truncated. - just by searching for exit we can find the usage

Test suggestions

Good to test with few orgs which has exit table issue(power org has this) and general encounter/program encounter issue and normal case as well is my opinion.

himeshr commented 1 day ago

Caused an urgent issue for Shelter.. raised as ticket

himeshr commented 1 day ago

Since the issue is encountered after recent data-fix in prod env DB, this can currently only be tested on local using dump. Marking it Tech-qa.

himeshr commented 1 day ago

Successfull completed ETL schema run for Shelter org dump on local.