[OC-11573] Shutdown postgresql after schema migration.

 - Also, do not run schema migration if postgresql has been disabled