3082b8cef557_add_naming_convention_table_and_closed_.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:rucio 作者: rucio01 项目源码 文件源码
def upgrade():
    '''
    upgrade method
    '''
    if context.get_context().dialect.name != 'sqlite':
        add_column('dids', sa.Column('closed_at', sa.DateTime))
        add_column('contents_history', sa.Column('deleted_at', sa.DateTime))
        create_table('naming_conventions',
                     sa.Column('scope', sa.String(25)),
                     sa.Column('regexp', sa.String(255)),
                     sa.Column('convention_type', sa.String(1)),
                     sa.Column('updated_at', sa.DateTime),
                     sa.Column('created_at', sa.DateTime))
        create_primary_key('NAMING_CONVENTIONS_PK', 'naming_conventions', ['scope'])
        create_foreign_key('NAMING_CONVENTIONS_SCOPE_FK', 'naming_conventions',
                           'scopes', ['scope'], ['scope'])
        create_check_constraint('NAMING_CONVENTIONS_CREATED_NN', 'naming_conventions',
                                'created_at is not null')
        create_check_constraint('NAMING_CONVENTIONS_UPDATED_NN', 'naming_conventions',
                                'updated_at is not null')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号