Upgrading Ghost v3 -> v4 fails with "Table '*.products' doesn't exist"

To reproduce:

Set up Mysql:

CREATE DATABASE ghost3;
CREATE USER 'ghost'@'localhost' IDENTIFIED WITH mysql_native_password BY '***';
GRANT create, delete, insert, select, update, alter, references ON ghost3.* TO 'ghost'@'localhost';
FLUSH PRIVILEGES;

Create a Ghost installation:

ghost install v3 --local --development --no-start \
	--db mysql --dbhost localhost --dbuser ghost --dbpass '***' --dbname ghost3

Btw; Using the switch --verbose will cause the installation to fail with stdout maxBuffer exceeded

In non-verbose mode the Ghost installation will work as expected and is possible to view and configure at http://localhost:2368/ghost/.

Update with:

ghost stop
ghost update --verbose

Everything seems fine, and ghost doctor gives you no errors, but starting it up with ghost start will give you this error:

A GhostError occurred.

Message: Ghost was able to start, but errored during boot with: show columns from `products` - ER_NO_SUCH_TABLE: Table 'ghost3.products' doesn't exist

Debug Information:
    OS: macOS, v11.4
    Node Version: v14.17.1
    Ghost Version: 4.8.0
    Ghost-CLI Version: 1.17.3
    Environment: development
    Command: 'ghost start'

Funny thing is that running ghost doctor at this stage still gives no errors.

FYI; Did a fresh install of Ghost v4 with:

ghost install --local --development --verbose --no-start \
        --db mysql --dbhost localhost --dbuser ghost --dbpass '***' --dbname ghost4

Started it up and then I compared tables with the failed version 3-one and found that not only the products table was missing, also:

members_email_change_events
members_login_events
members_paid_subscription_events
members_payment_events
members_products
members_status_events
members_subscribe_events
stripe_prices
stripe_products

I’ve searched the verbose log looking for database errors but found none.

I had quite a lotta “fun” upgrading ghost on mysql - you will probably see more output / fails if you run it with this set in the environment:
DEBUG="knex-migrator:*,knex:query"

Look for “Rolling” in the resulting output, my guess is it tried to create a table and rolled back for some reason (mine did that many many times). Post the results.