简体   繁体   中英

How to use auto migration with loopback 4 for mysql datasource

请帮忙,关于使用MySQL数据源在loopback4中进行自动迁移没有任何帮助

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM