Reorder upgrade.sql file

Reordering has two objectives:
- minimize "NOTICE:" lines in constraint dropping
- align order of table/column renaming on order
    of table creation (in database/lib/sql22/schema-main.sql)