ChickenKyiv / foodolog

Food Log is a project, where user can log meals
GNU General Public License v3.0
0 stars 1 forks source link

run automigrate before calling a mongodb database #8

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 if you'll have some questions and i'll move that information here. It's a bit tricky part, so you'll need my help

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.

4

iankiku commented 6 years ago

I need help figuring this out. Package.Json broke after i included dependencies of automigrate.js Iam doing something very wrong. Let me push code of what I've done. Something isn't working. Maybe I can see you resolve, please.

atherdon commented 6 years ago

ok, i'll check it. don't worry.

atherdon commented 6 years ago

will take a look a bit later - should finish my article first. will keep you posted.

iankiku commented 6 years ago

Ok great. Thanks

On Fri, Mar 23, 2018, 18:32 Arthur Tkachenko notifications@github.com wrote:

will take a look a bit later - should finish my article first. will keep you posted.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/ChickenKyiv/foodolog/issues/8#issuecomment-375824799, or mute the thread https://github.com/notifications/unsubscribe-auth/AHZ6Cc-gazrfKe8Fa9yKvaL3FK9k9G-Fks5thYYfgaJpZM4S2Q5i .

atherdon commented 6 years ago

i'll take quick look, but not promise that i catch an error without debuggin. still if we have an error and it was not catched by raven - then we did something wrong

On 24-Mar-2018 at 03:52 AM, Ian Kiku wrote:

Ok great. Thanks

On Fri, Mar 23, 2018, 18:32 Arthur Tkachenko notifications@github.com wrote:

will take a look a bit later - should finish my article first. will keep you posted.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/ChickenKyiv/foodolog/issues/8#issuecomment-375824799,

or mute the thread < https://github.com/notifications/unsubscribe-auth/AHZ6Cc-gazrfKe8Fa9yKvaL3FK9k9G-Fks5thYYfgaJpZM4S2Q5i>

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ChickenKyiv/foodolog/issues/8#issuecomment-375844390, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZrDoVxq_h-zzAdovGnhmTTKoPkQEaXks5thcMAgaJpZM4S2Q5i .

atherdon commented 6 years ago

it was easy - json didn't support comments and you also forget a , don't worry - in january i spend 3 days, trying to find a simple mistake :)

grab my changes and try to run it

iankiku commented 6 years ago

I am reviewing my errors now. Thanks

iankiku commented 6 years ago

merged changes code works fine now. Thanks

atherdon commented 6 years ago

I think all is fine with migrating thing. I pushed some updates, please take a look. in order to test migrate only - please run npm run m

Check this file. that script create other tables. https://github.com/ChickenKyiv/foodolog/blob/demo-staging/bin/automigrate.js

you also cannot run import script without other files, with arrays, like department.js, etc. Check recipe-api-search repo - you'll see it.

atherdon commented 6 years ago

I think i got two notifications that was caused by you, hope it'll help you https://sentry.io/share/issue/1d11d4bddd5846719ab95844a963e032/ https://sentry.io/share/issue/e1f2708fa94d45c2bc0e7ab8727d4163/

not sure why it was related to another project. maybe i gave you a wrong keys... it should send notifications into recipe-api, but your errors goes into groceristar.

keep this, later we'll need to figure it out.

iankiku commented 6 years ago

Yes, I had that issue even after I pulled the changes you made. I don't know why.

atherdon commented 6 years ago

I think we should do this from other side. push your latest code at demo branch again, please. want to have the latest code to see.

atherdon commented 6 years ago

first part Migrate file cannot work well, because it have different tables, that you have at db.json

second part, migrate is just a thing that will drop all data from your mongo database. Most important to import things. And if you want to run an import script - you should have files, with structure like this(for each table) : https://github.com/ChickenKyiv/recipe-search-api/blob/master/bin/departments.js so for each table, that you have at db.json - you should create file like this and move data into array.

buzz me when this will be done.

atherdon commented 6 years ago

will back to you soon

atherdon commented 6 years ago

@iankiku what do you think about helping me with react while i cannot help with this issue?

iankiku commented 6 years ago

Sure, what do you need me to do?

atherdon commented 6 years ago

i'm working on separating front and backend at groceristar, and have a lot of things that converted into tasks, but don't have any frontend developers to help me with. so i remembered that you know react

atherdon commented 6 years ago

startin looking on your issue

atherdon commented 6 years ago

i think i fixed it. you should review my commit and explain here what i did

iankiku commented 6 years ago

Ok I will look at it. Thanks

atherdon commented 6 years ago

you welcome! soon it be more easy - i mean less buggy from packages side

On 13-Apr-2018 at 08:47 AM, Ian Kiku wrote:

Ok I will look at it. Thanks

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ChickenKyiv/foodolog/issues/8#issuecomment-381068913, or mute the thread https://github.com/notifications/unsubscribe-auth/ABZrDqh194IBvzGmualqQyiFVzXrqql2ks5toGY6gaJpZM4S2Q5i .