Fixed broken migration tool (sorry)
Database migration script added