Merge DB script update

Implemented in pure SQL via python-mysql drive.