如何在MySQL数据源中使用带有环回4的自动迁移 [英] How to use auto migration with loopback 4 for mysql datasource

查看:83
本文介绍了如何在MySQL数据源中使用带有环回4的自动迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助 在带有MySQL数据源的loopback4中,没有任何关于自动迁移的内容

Please , help There is nothing about auto migration in loopback4 with a mysql datasource

推荐答案

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..");
      });
    }
  });

我希望这可以澄清您的查询;
auth是datasource.json

I hope this clarifies your query;
And auth is a datasource defined in datasource.json

这篇关于如何在MySQL数据源中使用带有环回4的自动迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆