As I want to reduce to the max the downtime of the site I was planning to make a bunch of modifications by using SQL queries directly on the database
If you are following the recommended method for upgrading - there should be no need for what you are describing - which is dangerous at best

PLEASE Back up your database before doing any of this