Skip to content

feature(): inside migrations we need to provide Options #2

Open
@Stradivario

Description

@Stradivario

Options will look as follow:

export const options = {
  runtime: 'before'
}

We can try to create feature to override default First argument inside UP and DOWN functions like this

export const options = {
  async connect() {
    return // returned object will be available inside `up(object)`
  }
}

Full

export const options = {
  async connect() {
    return {db: 'my-db'}
  }
}

export function up(myConnection) {
    console.log(myConnection);
    // { "db":"my-db"}
}

This feature will introduce Detached connection so not only MongoDB can work with Xmigrate

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions