Skip to content

Instantly share code, notes, and snippets.

@abhikhatri
Created January 6, 2019 17:58
Show Gist options
  • Save abhikhatri/9ec31e3f4d6f7deee4309560ceb47909 to your computer and use it in GitHub Desktop.
Save abhikhatri/9ec31e3f4d6f7deee4309560ceb47909 to your computer and use it in GitHub Desktop.
script to automatically populate the models on boot
'use strict';
module.exports = function(app) {
/*
* The `app` object provides access to a variety of LoopBack resources such as
* models (e.g. `app.models.YourModelName`) or data sources (e.g.
* `app.datasources.YourDataSource`). See
* https://loopback.io/doc/en/lb3/Working-with-LoopBack-objects.html
* for more info.
*/
app.dataSources.postgres.autoupdate();
console.log("Performed automigration.");
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment