Artur-Sulej / excellent_migrations

An Elixir tool for checking safety of database migrations.
MIT License
232 stars 25 forks source link

Architecture of detectors #13

Open Artur-Sulej opened 2 years ago

Artur-Sulej commented 2 years ago

It's a good idea to tackle complexity of finding unsafe operations – to make them easier to read, understand, maintain and develop. There two aspects:

Possible approach is to make AstParser return relevant parts of code (not yet detected unsafe operations). Then add another step to the process that would decide about dangers (based on that data from AstParser). I like this approach, because it would decompose the logic into separate, independent steps with different responsibilities.

The question is: will this approach be suitable for all cases, including detecting irreversible migrations.

We've already had some discussion about it with @hiagomeels here.