问题
Please , help There is nothing about auto migration in loopback4 with a mysql datasource
回答1:
let auth = server.dataSources.auth;
auth.isActual( function(err, actual) {
if (!actual) {
auth.autoupdate(function(err, result) {
console.log('Error in autoMigrate script',err);
console.log("All tables are updated..");
});
}
});
I hope this clarifies your query;
And auth is a datasource defined in datasource.json
来源:https://stackoverflow.com/questions/53111076/how-to-use-auto-migration-with-loopback-4-for-mysql-datasource