How to use auto migration with loopback 4 for mysql datasource

雨燕双飞 提交于 2020-01-06 06:20:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!