Upgrade the PM database structure. Need some SQL