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 --exit option to migration generator #40

Closed
zimt28 opened this issue Jan 11, 2021 · 4 comments
Closed

Add --exit option to migration generator #40

zimt28 opened this issue Jan 11, 2021 · 4 comments
Labels
enhancement New feature or request needs review

Comments

@zimt28
Copy link
Contributor

zimt28 commented Jan 11, 2021

Would make sense to add an --exit option to Mix.Tasks.AshPostgres.GenerateMigrations? It could then be used in CIs and fail if resources and migrations don't fit together. The big issue I see here is that the CI would have to be changed every time there's a new api.

@zimt28 zimt28 added enhancement New feature or request needs review labels Jan 11, 2021
@zimt28
Copy link
Contributor Author

zimt28 commented Jan 11, 2021

--exit might not be the best name though. Maybe --enforce-latest-migrations?
This is how other libraries do it:

[
  "format --check-formatted",
  "credo --strict",
  "sobelow --exit",
  "dialyzer --halt-exit-status"
]

@zachdaniel
Copy link
Contributor

Yeah, I think ash_postgres.generate_migrations --check-generated would be a good name for the flag. We'd then just have to add a check after we've generated a full list of "operations" and if there are any, check the --check-generated flag and bail if that is set.

@zachdaniel
Copy link
Contributor

A good idea :)

@zimt28
Copy link
Contributor Author

zimt28 commented Jan 13, 2021

This has been added via #43

@zimt28 zimt28 closed this as completed Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs review
Projects
None yet
Development

No branches or pull requests

2 participants