Database Migration

Finished script for migrating the database from version 2 to version 3