Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: Pass only storageOptions to Storage constructor #137

Merged
merged 3 commits into from
May 9, 2017

Conversation

jukkah
Copy link
Contributor

@jukkah jukkah commented May 4, 2017

Change Storage constructor to accept only storageOptions passed to Umzug constructor. In addition, try to figure out if created storage doesn't support this and use old format as fallback. Old style will be dropped in some major version in future, probably in version 3. This affetcs to all custom storages.

DEPRECATED

  • Storage constructors doesn't accept options that contains storageOptions any more. They accept only storageOptions directly.
- let storage = new Storage(this.options)
+ let storage = new Storage(this.options.storageOptions)

If you are writing a custom Storage and want to support Umzug v1- follow these instructions

constructor(options) {
  // convert options from v1- to v2+
  if (options.storageOptions) {
    options = options.storageOptions
  }

  // continue as normal
  this.option1 = options.option1
}

Change Storage constructor to accept only storageOptions passed to Umzug
constructor. In addition, try to figure out if created storage doesn't support
this and use old format as fallback. Old style will be dropped in some major
version in future, probably in version 3. This affetcs to all custom storages.

DEPRECATED:
- Storage constructors doesn't accept options that contains storageOptions any
  more. They accept only storageOptions directly.

```diff
- let storage = new Storage(this.options)
+ let storage = new Storage(this.options.storageOptions)
```
@mention-bot
Copy link

@jukkah, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rpaterson, @sdepold and @Americas to be potential reviewers.

@jukkah jukkah merged commit 4cd9dd3 into sequelize:v2.x May 9, 2017
@jukkah jukkah deleted the storage-options branch May 9, 2017 03:07
jmike added a commit to yeepio/umzug-mysql-storage that referenced this pull request May 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants