GSoC 2017 - Week 9

What I did

This week, I completed the functionality for “WITHIN” and “HOLDS WITHIN” query wrapper commands for Cargo. Understanding the control flow of the already existing code had been easier for this one but writing my own piece of code to perform the intended operation had been tough. Due to the involvement of two syntaxes to declare table in the Cargo query, I faced some difficulties to write a generic business logic for that could cater the “WITHIN” and “HOLDS WITHIN” commands.

Some of my old commits were already merged into the master, and then Tobias discovered a bug, related to DB-JOIN. At the beginning, it was very dicey that what has caused it to occur and it took time to understand that the newly hierarchy table has caused all the pain. The old schema fields were not apt to store a table like hierarchy. This lead to immense discussion for changing cargo_tables schema to meet the current needs. We finalized adding new column “field_helper_tables” to “cargo_tables”.

While performing this I had to write SQL patches that would affect the Database Schema of the Cargo Extension, when update.php is run. Also due to the change in schema and design idea, the code at some other places also needed to be modified.

In between the slack of this periodic task, I kept updating the patches as per the code reviews and advice I kept receiving.

What I learnt

I learnt about creating database patches. I understood how significant it is. My mentors carried out a discussion with a great depth, regarding the decision of making the schema changes. During all those discussions, we tried to predict all the repercussions and the corner cases that were required to be handled.

Tip to future myself (and anyone else reading this post)

“Schema changes are not easy to make… It’s like you have a single bullet in your gun, use it wisely.

comments powered by Disqus