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

Incorporate "Safe Ecto Migrations" Content Into Credo Checks Where Possible #36

Open
Nezteb opened this issue Dec 6, 2023 · 1 comment

Comments

@Nezteb
Copy link

Nezteb commented Dec 6, 2023

Prominent Elixir dev @dbernheisel has talked about how to do safe Ecto migrations in a couple places online:

On a recent episode of the Thinking Elixir podcast, he talks again about safe migrations (the topic starts at 7:49 and ends at 18:46).

At 15:07 another host asks if David is planning on adapting his writings/recipes as credo checks. David says he probably won't and cites excellent_migrations as a good existing tool for this (that's how I ended up here 👋).

My question: As far as y'all can tell, do the credo checks in this repo cover most of the cases that David outlines in the above series/repo? I know some of what David suggests is hyper-specific to your own application, but it'd at least be nice if the "easy stuff" was covered in the credo checks!

Thanks!

@Artur-Sulej
Copy link
Owner

Hi, thanks for reaching out!
It's great to hear that excellent_migrations are being talked about. According to stats at hex.pm, it seems that the lib has gained some popularity so far. I'm happy that people find it useful.

David's Safe Ecto Migrations guide is a valuable resource. I believe excellent_migrations cover all the checks listed there, along with those in strong_migrations plus some additional discoveries like volatile defaults.
In the linked episode, David suggests using type :text instead of :string for columns. I'd like to explore this topic, because potentially it could be implemented as a new check in the library.

excellent_migrations are implemented in a generic way to find operation patterns in migrations for any application.
I encourage you to give it a try. There are several integration methods. The easiest and most recommended one is credo check.

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

No branches or pull requests

2 participants