Big problem with the main SQL statement discover

that’s why I need to commit these changes, just in case I need to bring
back all this issues, although are available in one of the issues of
this project (#1)