The first time I tried to run the migration failed with the warnings:
+ discourse-ynh-deps : Depends: postgresql but it is not going to be installed
+ Depends: postgresql-server-dev-all but it is not going to be installed
+ Depends: postgresql-contrib but it is not going to be installed
+ synapse-ynh-deps : Depends: postgresql but it is not going to be installed
I wasn’t really using discourse or synapse, so I continued by uninstalling discourse and synapse through yunohost, and then running in terminal:
apt-get remove discourse-ynh-deps
apt-get remove synapse-ynh-deps
I then re-ran the migration, and it worked successfully.
Sharing here, in case anyone runs into the same issue.