sqlalchemydjango-southrevisiondirected-acyclic-graphsalembic

What does an Alembic revision ID represent?


I have just started looking at Alembic, and coming from Django, where we have South to migrate our database schemas (which is soon to be included) which uses a friendly old fixed-width number like 0037_fix_my_schema.py to talk about the order in which migrations are to be applied, I am naturally intrigued by Alembic's revision ID. Is there a DAG backing Alembic, or can someone give a little overview of its internals in this respect?


Solution

  • I took a look myself. The source says:

    def rev_id():
        val = int(uuid.uuid4()) % 100000000000000
        return hex(val)[2:-1]
    

    Not so fascinating.