I can't get automigrate and autoupdate to work.
I created my project, datasource and model. All looks good, but I can't get automigrate to work. If I go to my SQL Server and create the table/schema then all the GET/POST methods work fine.
I went to the server/boot directory. there are currently two files in there authentication and root.
I created a new file called automigrate.js
'use strict';
module.exports = function (app) {
app.dataSources.mysql.automigrate();
console.log("Performed automigration.");
}
When I run it I get an error :
C:\Users\ajmal\loopback\telematics\server\server.js:31 if (err) throw err; ^
TypeError: Cannot read property 'automigrate' of undefined
at Object.module.exports [as func] (C:\Users\ajmal\loopback\telematics\server\boot\automigrate.js:9:26)
at C:\Users\ajmal\loopback\telematics\node_modules\loopback-boot\lib\executor.js:316:22
mysql? Check your filedatasources.jsonand make sure that you're using exactly the same datasource name - akkonrad