Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Oh boy.

I had just joined a “subscription based social site” as a backend developer. I think it was PHP 4 and MySQL 3 at the time.

Someone had realized that it would be great to have database “migrations” in code instead of using phpMyAdmin to modify tables.

Thumbs up, forward thinker!

So there was an ONE BIG migrations.php file that had our DDL in it with if statements around each one to see if it had already been run.

The statements didn’t have a version number or anything super simple and trivial. It was a combination of all the worst ways you could figure out if a column had been added to a table in MySQL.

When code was deployed, someone would visit http://example.com/migrations.php real quick to migrate the site.

Oh man, classic.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: