ChickenKyiv / loopback-tutor-intern-18

GNU General Public License v3.0
0 stars 0 forks source link

run automigrate before calling a mongodb database #6

Open atherdon opened 6 years ago

atherdon commented 6 years ago

when you'll switch from file with data into database - you'll need to run loopback.automigrate method. i have a samples, so buzz me and i'll move that information here.

5


Some information about migrations: first part it's a simple thing, you just need to call automigrate and specify tables that you need to drop. and you need to run that script from CLI

second part is complex and related to importing data from js array into db row.

you will need to create a file/files, with arrays(you can grab that data from db.json file) then you'll need to create a file where you'll actually import data from array into db. as before - you should check the latest version at search-api - and see how i did it here