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

Add db:truncate command with TestUtils helper #889

Merged
merged 5 commits into from Oct 26, 2022

Conversation

Julien-R44
Copy link
Member

@Julien-R44 Julien-R44 commented Oct 22, 2022

  • Fix a raising exception in Dialect.truncate when truncating a table whose name was reserved ( postgres / redshift )
  • Add a command ace db:truncate which will truncate all tables, except those of Adonis that manage migrations
  • Add aTestUtils().db().truncate() helper which is an alternative to TestUtils().db().migrate()

TestUtils.migrate() will migrate and rollback the whole database at each new run. So this is not necessarily necessary in most cases.

This new helper can be used as an alternative. What it will do is, apply the migrations at the beginning of the cycle, only if necessary, and at the end of the cycle, truncate all the tables.

@Julien-R44
Copy link
Member Author

Should be good now

@thetutlage
Copy link
Member

Looks beautiful 👍

@thetutlage thetutlage merged commit 215631e into develop Oct 26, 2022
@RomainLanz RomainLanz deleted the feat/test-utils-truncate branch October 26, 2022 08:52
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.

None yet

2 participants