With this patch alembic migration script should always be idempotent.
This is forced by new functional test which makes sure that migrations
starting from first alembic migration script from the stable/2024.1
release is idempotent.
Closes-bug: #2100770
Change-Id: Ia14f3748245b59850bc21cbc87e04ffbdbb5850f