Proposal for a rule regarding the removal of old migration code

I took over the work of @acaubet (thank you for launching the subject) on the removal of the previous migrations:

And in the discussion it occurred to us that we should have a rule for the removal of the migrations.
So we’d like to propose a rule that state that only the migrations from up to the last 2 LTS will be supported.

It means that we will drop migration from series < 5.0 for the 7.0 release, then for the 8.0 release we will drop migrations for the series < 6.0, and so on.

It’s important to drop useless code as it makes the code easier to read, it might remove bugs also. Migrations can also sometimes generate queries that are long to compute so it might speed up a bit the update process (but it’s not the main point to drop them in my opinion).

What are your thoughts about that rule?

1 Like

Sounds reasonable and good to me.

Indeed we have already this statement.
But I think supporting one LTS is a little bit too strict as it is possible for user to stay supported with LTS by skipping one.
So I would be in favor of updating the release process to extend to 2 LTS. Also this rule should be put more visible on the migration category.

Also I do not think we should be strict on when we remove the code, it can stay longer if we do not find time to remove it. The rule is about what is supported, we can by chance support more.