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

Added seed option for migration run and refresh #377

Merged
merged 3 commits into from
Sep 6, 2018

Conversation

jordykoppen
Copy link
Contributor

Proposed changes

Added --seed option to migrate:run and migrate:refresh for seeding after migration has ran.

Types of changes

What types of changes does your code introduce?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have read the CONTRIBUTING doc
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if appropriate)

@coveralls
Copy link

coveralls commented Sep 5, 2018

Coverage Status

Coverage increased (+0.007%) to 96.47% when pulling a6d5de4 on jordykoppen:develop into 55fffb9 on adonisjs:develop.

* If seed is passed, seed the DB after migration
*/
if (seed) {
await ace.call('seed')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also pass keepAlive and force flags to the seed command?

await ace.call('seed', {}, { keepAlive, force })

this._validateState(force)

if (keepAlive) {
this.migration.keepAlive()
}

await ace.call('migration:reset', {}, { log, force, silent })
await ace.call('migration:run', {}, { log, force, silent })
await ace.call('migration:run', {}, { log, force, silent, seed })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pass keepAlive here too :)

@thetutlage thetutlage merged commit 23dc3eb into adonisjs:develop Sep 6, 2018
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.

3 participants