Skip to content

lastRun has incorrect value when migrating down #142

@stalniy

Description

@stalniy

I'm trying to create a custom store for migrations, a table in SQL db:

CREATE TABLE IF NOT EXISTS "schema_migrations" (version character varying NOT NULL PRIMARY KEY)

All works good for up migrations but for down migrations lastRun in save method of my custom store has invalid value. That value actually points to the next migration not that one which was run.

if you do console.log(migration.title, migration.timestamp, set.lastRun) at https://github.com/tj/node-migrate/blob/master/lib/migrate.js#L67 you will see that migration.title and lastRun have different values.

So, then I don't know which migration to remove from schema_migrations table

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions