Alembic版本ID代表什么? [英] What does an Alembic revision ID represent?

查看:85
本文介绍了Alembic版本ID代表什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始研究Alembic,来自Django,我们有 South 来迁移数据库使用友好的旧固定格式的架构(包含在很快中)像 0037_fix_my_schema.py 这样的宽度数字来讨论应用迁移的顺序,我自然对Alembic的修订版ID感兴趣。是否有DAG支持Alembic,或者有人可以在这方面对其内部进行一些概述?

解决方案

我。 来源说:

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

不那么吸引人。 / p>

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?

解决方案

I took a look myself. The source says:

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

Not so fascinating.

这篇关于Alembic版本ID代表什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆