3ad36e2268b0_create_collection_replicas_updates_table.py 文件源码

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

项目:rucio 作者: rucio01 项目源码 文件源码
def upgrade():
    '''
    upgrade method
    '''
    if context.get_context().dialect.name != 'sqlite':
        add_column('collection_replicas', sa.Column('available_replicas_cnt', sa.BigInteger()))
        add_column('collection_replicas', sa.Column('available_bytes', sa.BigInteger()))

    create_table('updated_col_rep',
                 sa.Column('id', GUID()),
                 sa.Column('scope', sa.String(25)),
                 sa.Column('name', sa.String(255)),
                 sa.Column('did_type', DIDType.db_type(name='UPDATED_COL_REP_TYPE_CHK')),
                 sa.Column('rse_id', GUID()),
                 sa.Column('updated_at', sa.DateTime),
                 sa.Column('created_at', sa.DateTime))

    if context.get_context().dialect.name != 'sqlite':
        create_primary_key('UPDATED_COL_REP_PK', 'updated_col_rep', ['id'])
        create_check_constraint('UPDATED_COL_REP_SCOPE_NN', 'updated_col_rep', 'scope IS NOT NULL')
        create_check_constraint('UPDATED_COL_REP_NAME_NN', 'updated_col_rep', 'name IS NOT NULL')
        create_index('UPDATED_COL_REP_SNR_IDX', 'updated_col_rep', ['scope', 'name', 'rse_id'])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号