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.
The text was updated successfully, but these errors were encountered:
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 fordown
migrations insave
method I have problems.I can't understand the context (
up
ordown
) of invokingsave
method.And I see two reasons.
save
does not have access to direction value.down
.lastRun
has 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.
The text was updated successfully, but these errors were encountered: