PgPatcher is a program which helps you organise and apply SQL patches for your Postgres database schema. You could run this program as part of your upgrade scripts which makes sure that each patch is applied in the right order.