I have renamed a number of models and tables in my loopback application, however I must now migrate to this model definition.
I need to run autoMigrate(). It must be run on a dataSource object but the documentation provides no help regarding acquiring one of these.
so far I have created a new script in /boot
containing:
var loopback = require('loopback');
var app = module.exports = loopback();
app.loopback.DataSource.automigrate()
but this data source object does not contain an autoMigrate function...
I have tried running strongloop arc to use the auto migrate button present there, but the page crashes with this error:
Uncaught Error: [$injector:modulerr] Failed to instantiate module Arc due to:
Error: [$injector:modulerr] Failed to instantiate module Metrics due to:
Error: [$injector:nomod] Module 'Metrics' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
http://errors.angularjs.org/1.3.20/$injector/nomod?p0=Metrics
at http://localhost:56073/scripts/vendor/angular/angular.js:63:12
at http://localhost:56073/scripts/vendor/angular/angular.js:1778:17
at ensure (http://localhost:56073/scripts/vendor/angular/angular.js:1702:38)
at module (http://localhost:56073/scripts/vendor/angular/angular.js:1776:14)
at http://localhost:56073/scripts/vendor/angular/angular.js:4131:22
at forEach (http://localhost:56073/scripts/vendor/angular/angular.js:326:20)
at loadModules (http://localhost:56073/scripts/vendor/angular/angular.js:4115:5)
at http://localhost:56073/scripts/vendor/angular/angular.js:4132:40
at forEach (http://localhost:56073/scripts/vendor/angular/angular.js:326:20)
at loadModules (http://localhost:56073/scripts/vendor/angular/angular.js:4115:5)
http://errors.angularjs.org/1.3.20/$injector/modulerr?p0=Metrics&p1=Error%3…F%2Flocalhost%3A56073%2Fscripts%2Fvendor%2Fangular%2Fangular.js%3A4115%3A5)
at http://localhost:56073/scripts/vendor/angular/angular.js:63:12
at http://localhost:56073/scripts/vendor/angular/angular.js:4154:15
at forEach (http://localhost:56073/scripts/vendor/angular/angular.js:326:20)
at loadModules (http://localhost:56073/scripts/vendor/angular/angular.js:4115:5)
at http://localhost:56073/scripts/vendor/angular/angular.js:4132:40
at forEach (http://localhost:56073/scripts/vendor/angular/angular.js:326:20)
at loadModules (http://localhost:56073/scripts/vendor/angular/angular.js:4115:5)
at createInjector (http://localhost:56073/scripts/vendor/angular/angular.js:4041:11)
at doBootstrap (http://localhost:56073/scripts/vendor/angular/angular.js:1455:20)
at bootstrap (http://localhost:56073/scripts/vendor/angular/angular.js:1476:12)
http://errors.angularjs.org/1.3.20/$injector/modulerr?p0=Arc&p1=Error%3A%20…%2Flocalhost%3A56073%2Fscripts%2Fvendor%2Fangular%2Fangular.js%3A1476%3A12)
I just need to update the model, and do not understand why this is so difficult. Does anybody know how to overcome these obstacles? thanks!