Saturday, September 20, 2014

Day 5: What did you call that table?

There was programming!!!

Tracy pulled Mike and I before SCRUM and told us she had a project that would be great for us. 

There's a possible client coming up who's using curriculum pretty close to that of an existing client. In order to pitch them a dummy site, we need to pull a copy of the curriculum, compile it into an Excel file, then import it into the new site. Tracy wanted us to write the queries and scripts to make this happen.

Awesome! Something tangible to accomplish!

Tracy gave us an outline of the database set up to let us know which columns we would need to query. There are two separate imports, so we each had one. My project only needed four columns in the end, compared to Mike's ten or so. Yet I needed to query four tables while Mike only needed one. 

We dispersed so we going get to going on our new project. 

I started laying out the tables I had and the connections they had, writing my query and sub-queries, getting it to print to a dummy site off of a test database. I'd gone into Sequel Pro to verify a couple of column names. 

I was testing parts of my queries when I realized something was not lining up correctly. 

I looked at the content of a couple of databases, when it became clear that the connections Tracy had lined out for me weren't correct. Theoretically connecting columns didn't have any similar content. 

Once I figured out where my necessary columns were located, it was pretty straightforward query. 

The next step was getting it all into a CSV. The problem here was that I'm new to PHP. It builds it's multi-dimensional arrays differently than I'm used to, so iterating through it was a little different.

I was working away when it occurred to me that no one else was still working. 

I could hear people in the main entry space on the couches. Evidently, Fridays are Beer Fridays. Anyone in the office on a Friday afternoon around 3:30 pm just stops working and starts drinking. Thankfully, it's not a pressure drinking situation. There was someone who just had coffee, some who had nothing at all to drink, some who just took the chance to go home early, and some that went a little crazy. It helps contribute to their laid back and community atmosphere.

We'll see how that pans out.