Skip to content

Scoped migration not running from scoped directory #757

@joezappie

Description

@joezappie

I'm submitting a...

  • Bug report
  • Feature request
  • Question

Current behavior

When trying to use scopes, its not finding the migration files in the scoped directory and is instead running files in the ./migrations folder. This happens with both the CLI and through the API.

Expected behavior

Migrations should be run in the scoped folder.

Minimal reproduction of the problem with instructions

db-migrate create:client_1 users
// migrations/client_1/20211010214023-users.js created successfully

db-migrate up:client_1
// [migration] Nothing to run

db-migrate create users
// migrations/20211010215341-user.js created successfully

db-migrate up:client_1
// runs migrations/20211010215341-user

Looking at the code in walker.js up function, its loading the files from the filesystem with File.loadFromFileystem(this.directory, this.prefix, this.internals). "this.directory" is a path to only the migrations directory which I imagine should have the scoped folder name there as well.

Environment

Windows 10
Node v14.16.0
db-migrate: 1.0.0-beta.16
db-migrate-mongodb: 1.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions