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

embedded_migrations::revert missing #1366

Closed
agentsim opened this Issue Dec 10, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@agentsim

agentsim commented Dec 10, 2017

After generating migrations with embed_migrations!, the resulting module does not include the revert method.

I would like to revert and then run migrations before each unit test, guaranteeing a clean database before each test invocation.

@sgrif

This comment has been minimized.

Member

sgrif commented Dec 12, 2017

We've purposely excluded the revert method, because what it does is dependent on which migrations have or haven't been run, and we don't expose that information.

Dropping and recreating your database is not recommended for tests. Instead, you should run your tests in a transaction. We provide begin_test_transaction and test_transaction for this purpose.

@sgrif sgrif closed this Dec 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment