Skip to content

Upgraded from 0.5.4 to 0.9.2, new migrations are prefixed with slash, old migrations will not migrate down #235

@mpalmerlee

Description

@mpalmerlee

We recently upgraded from 0.5.4 to 0.9.2 and noticed that new migrations in the migrations table are prefixed with a forward slash:

old:
20150121183613-target-token

new:
/20150218150557-random

We generate these migrations like so:
./node_modules/db-migrate/bin/db-migrate create migration-name --migrations-dir lib/migrations --config config/config.json

and run up like so:
./node_modules/db-migrate/bin/db-migrate up --migrations-dir lib/migrations --config config/config.json -e local

and run the down:
./node_modules/db-migrate/bin/db-migrate down --migrations-dir lib/migrations --config config/config.json -e local

The problem is that now with db-migration 0.9.2, when we try to do a "down" on an old migration without the starting forward slash, it seems that it will run run the down migration but won't remove it from the migrations table. Using verbose it's doing this:
[SQL] DELETE FROM migrations WHERE name = ? [ [ '/20150121183613-target-token' ] ]

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions