Search code examples
exportsails.jsmodels

Sails DB tables to models export


I was wondering if there is any way to export the DB tables to Sails Models structure, so i can make a instant replica of a current DB in sails and start using the DB with sails.

Its kinds of reverse migration. (DB -> SAILS)


Solution

  • Yes as of only just a couple of weeks now a module has been created to do this for you. At present it is limited to only a couple of database types e.g. postgresql and mySql however the publisher seems to be actively working on new database conversions also.

    To find all the info check here:

    https://www.npmjs.com/package/sails-inverse-model

    I have used it to convert 53 postgresql tables to sails models.