Entire site crashes when I upload CMS field changes

I've made some changes to the CMS fields and the database structure of a template of mine. It works just fine on my machine, but when I upload it to my test server, the entire site crashes. I can't go to the admin login, I can't reach dev/build or anything, it just gives me:

"Website Error
There has been an error

The website server has not been able to respond to your request."

for every page I try to access. When I replace the php file in mysite/code with the old one, everything starts working again. What have I done wrong? This is the code that I've modified: