On Tue, Dec 18, 2018 at 4:02 AM Samir <selshark...@kpler.com> wrote:
>
> Hi all,
>
> Is there anyway to tell alembic to store the history of all applied 
> migrations and when they were applied instead of only saving the latest 
> migration ?

There's a request for this feature at
https://github.com/sqlalchemy/alembic/issues/309 where I've described
the implementation and we would welcome contributors who want to work
on this relatively simple feature.    You can also add this feature to
an application right now by making use of the on_version_apply hook:
https://alembic.sqlalchemy.org/en/latest/api/runtime.html#alembic.runtime.environment.EnvironmentContext.configure.params.on_version_apply
to write records into your own "history" table.

>
> Is there a reason only the latest migration is saved in the `alembic_version` 
> table instead of saving the history of all applied migrations like django 
> migrations or other tools from other languages like flyway or liquibase ?

because it's not necessary or relevant in order for Alembic to know
what needs to be done for a particular database.   The alembic_version
table is concerned with storing the current state of the database,
which is based on a non-linear versioning model.    A particular
database state may be represented across any number of heads, which
can be moved up or down independently of each other, which is probably
not the case for some/all the other tools you mentioned.    A separate
history table with a straight log of events that occurred is what
people are looking for here and that should be a totally separate
concern.


>
> Regards,
> Samir
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy-alembic" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy-alembic+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy-alembic+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to