Skip to content

Instantly share code, notes, and snippets.

@abhikhatri
Created January 6, 2019 15:14
Show Gist options
  • Save abhikhatri/ce128dfeedfd3da0c5b1f90165e4a4f8 to your computer and use it in GitHub Desktop.
Save abhikhatri/ce128dfeedfd3da0c5b1f90165e4a4f8 to your computer and use it in GitHub Desktop.
Loopback script to migrate tables for default tables boot/server.js. EOS
//Importing the db structure for default apps
var appModels = ['User', 'AccessToken', 'ACL', 'RoleMapping', 'Role'];
var ds = app.dataSources.postgres;
ds.isActual(appModels, function (err, actual) {
if (!actual) {
ds.autoupdate(appModels, function (err) {
if (err) throw (err);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment