edge case fix for migration init task
properly close database connections when issuing DDL