I tried digging into the source code and found the cause to this issue:
https://github.com/strongloop/loopback-datasource-juggler/blob/6b83b6f4d1a4941917ffbaf8cebf476e40a53f83/lib/datasource.js#L1141
Apparently, the autoupdate function waits for the connection to be established before proceeding with its execution, but instead of queuing itself it queues the automigrate function. This causes tables to be dropped instead of altered.
I tried digging into the source code and found the cause to this issue:
https://github.com/strongloop/loopback-datasource-juggler/blob/6b83b6f4d1a4941917ffbaf8cebf476e40a53f83/lib/datasource.js#L1141
Apparently, the
autoupdatefunction waits for the connection to be established before proceeding with its execution, but instead of queuing itself it queues theautomigratefunction. This causes tables to be dropped instead of altered.