MySQL database revision management script