Closed atherdon closed 6 years ago
for a few tables - you need to update code. users and Roles must be assigned together. some information you can see here: https://github.com/GroceriStar/groceristar/blob/master/bin/grocery/users.js it's an old version, but you'll be able to see a main logic. and this file is called here: https://github.com/GroceriStar/groceristar/blob/master/bin/grocery/import.js#L51
Did you test - import working well?
busy looking at it. Get Error: Cannot migrate models not attached to this datasource: Attribute. Should I replace this code in 001-import.js async.parallel({ attributes : async.apply(helper.create, options, Attribute),
by deleting attributes and rather add each table like this:
async.parallel({ campground: async.apply(helper.create, options, Campground), reservation : async.apply(helper.create, options, Reservation), ETC. Because I dont know what purpose the Attributes table has in my code.
you don't have that table. this is just copy-pasted from serach-api. delete it.
yes, 001-import.js is the main file, where you work with import logic. feel free to update it. you can also improve it - it'll be cool for other backenders work
Import is now working without any errors
after reviewing that files, maybe you have suggestions about how we can improve the structure/logic of this script?
This was the first time I saw an import script. don't really know how to improve on it.
ok, we'll work on it few times, so maybe later we'll improve it
this is the most recent version of import script that i did: https://github.com/ChickenKyiv/recipe-search-api/tree/master/bin
how to run this script: https://github.com/ChickenKyiv/recipe-search-api/blob/master/package.json#L15
not remember - but it can be broken at this moment. If it will crash - buzz me - and i'll finish it - cause i'm lazy to do it.