You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, @wesleytodd
I'm trying to create a custom SQL store for migrations, and I want to store migrations log not as one json stringified row.
I want organized it as one row - one migration.
All works fine for up migrations but for down migrations in save method I have problems.
I can't understand the context (up or down) of invoking save method.
And I see two reasons.
save does not have access to direction value.
set.lastRun has a specific value, that does not reflect really last running migration for down. lastRun has incorrect value when migrating down #142
But I understand that this trick with lastRun allows work whole system in general.
So I see two ways how it can be fixed.
add lastDirection prop to set.
Change/extend signature of store save method. Add third argument context. save(set, fn, ctx);
And pass the context with { direction } to store.save.
I can prepare PR if you agree with my suggestion and select one of them.
Hi, @wesleytodd
I'm trying to create a custom SQL store for migrations, and I want to store migrations log not as one json stringified row.
I want organized it as one row - one migration.
All works fine for
upmigrations but fordownmigrations insavemethod I have problems.I can't understand the context (
upordown) of invokingsavemethod.And I see two reasons.
savedoes not have access to direction value.down.lastRunhas incorrect value when migrating down #142But I understand that this trick with lastRun allows work whole system in general.
So I see two ways how it can be fixed.
add lastDirection prop to set.

Change/extend signature of store save method. Add third argument


context. save(set, fn, ctx);And pass the context with { direction } to store.save.
I can prepare PR if you agree with my suggestion and select one of them.