def upgrade():
'''
upgrade method
'''
if context.get_context().dialect.name not in ('sqlite', 'mysql'):
create_check_constraint(name='BAD_REPLICAS_STATE_CHK', source='bad_replicas',
condition="state in ('B', 'D', 'L', 'R', 'S')")
python类get_context()的实例源码
3d9813fab443_add_a_new_state_lost_in_badfilesstatus.py 文件源码
项目:rucio
作者: rucio01
项目源码
文件源码
阅读 18
收藏 0
点赞 0
评论 0
3d9813fab443_add_a_new_state_lost_in_badfilesstatus.py 文件源码
项目:rucio
作者: rucio01
项目源码
文件源码
阅读 18
收藏 0
点赞 0
评论 0
def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name not in ('sqlite', 'mysql'):
drop_constraint('BAD_REPLICAS_STATE_CHK', 'bad_replicas', type_='check')
436827b13f82_added_column_activity_to_table_requests.py 文件源码
项目:rucio
作者: rucio01
项目源码
文件源码
阅读 17
收藏 0
点赞 0
评论 0
def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name != 'sqlite':
drop_column('requests', 'activity')
def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name != 'sqlite':
drop_constraint('heartbeats_pk', 'configs', type_='primary')
drop_index('heartbeats_updated_at', 'heartbeats')
if context.get_context().dialect.name != 'mysql':
drop_constraint('heartbeats_created_nn', 'heartbeats', type_='check')
drop_constraint('heartbeats_updated_nn', 'heartbeats', type_='check')
drop_table('heartbeats')
49a21b4d4357_create_index_on_table_tokens.py 文件源码
项目:rucio
作者: rucio01
项目源码
文件源码
阅读 17
收藏 0
点赞 0
评论 0
def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name != 'sqlite':
drop_constraint('tokens_account_fk', 'tokens', type_='foreignkey')
drop_index('TOKENS_ACCOUNT_EXPIRED_AT_IDX', 'tokens')
create_foreign_key('tokens_account_fk', 'tokens', 'accounts', ['account'], ['account'])
21d6b9dc9961_add_mismatch_scheme_state_to_requests.py 文件源码
项目:rucio
作者: rucio01
项目源码
文件源码
阅读 19
收藏 0
点赞 0
评论 0
def upgrade():
'''
upgrade method
'''
if context.get_context().dialect.name not in ('sqlite', 'mysql'):
drop_constraint('REQUESTS_STATE_CHK', 'requests', type_='check')
create_check_constraint(name='REQUESTS_STATE_CHK', source='requests', condition="state in ('Q', 'G', 'S', 'D', 'F', 'L', 'N', 'O', 'A', 'U', 'W', 'M')")
21d6b9dc9961_add_mismatch_scheme_state_to_requests.py 文件源码
项目:rucio
作者: rucio01
项目源码
文件源码
阅读 15
收藏 0
点赞 0
评论 0
def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name not in ('sqlite', 'mysql'):
drop_constraint('REQUESTS_STATE_CHK', 'requests', type_='check')
create_check_constraint(name='REQUESTS_STATE_CHK', source='requests', condition="state in ('Q', 'G', 'S', 'D', 'F', 'L', 'N', 'O', 'A', 'U', 'W')")
40ad39ce3160_add_transferred_at_to_requests_table.py 文件源码
项目:rucio
作者: rucio01
项目源码
文件源码
阅读 19
收藏 0
点赞 0
评论 0
def upgrade():
'''
upgrade method
'''
if context.get_context().dialect.name not in ('sqlite'):
add_column('requests', sa.Column('transferred_at', sa.DateTime()))
40ad39ce3160_add_transferred_at_to_requests_table.py 文件源码
项目:rucio
作者: rucio01
项目源码
文件源码
阅读 19
收藏 0
点赞 0
评论 0
def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name not in ('sqlite'):
drop_column('requests', 'transferred_at')
4a7182d9578b_added_bytes_length_accessed_at_columns.py 文件源码
项目:rucio
作者: rucio01
项目源码
文件源码
阅读 23
收藏 0
点赞 0
评论 0
def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name != 'sqlite':
drop_column('dataset_locks', 'length')
drop_column('dataset_locks', 'bytes')
drop_column('dataset_locks', 'accessed_at')
drop_column('dids', 'accessed_at')
271a46ea6244_add_ignore_availability_column_to_rules.py 文件源码
项目:rucio
作者: rucio01
项目源码
文件源码
阅读 17
收藏 0
点赞 0
评论 0
def upgrade():
'''
upgrade method
'''
if context.get_context().dialect.name not in ['sqlite']:
add_column('rules', sa.Column('ignore_availability', sa.Boolean(name='RULES_IGNORE_AVAILABILITY_CHK'), default=False))
271a46ea6244_add_ignore_availability_column_to_rules.py 文件源码
项目:rucio
作者: rucio01
项目源码
文件源码
阅读 16
收藏 0
点赞 0
评论 0
def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name not in ['sqlite']:
drop_column('rules', 'ignore_availability')
def upgrade():
'''
upgrade method
'''
if context.get_context().dialect.name != 'sqlite':
add_column('dids', sa.Column('transient', sa.Boolean(name='DID_TRANSIENT_CHK'), server_default='0'))
def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name != 'sqlite':
drop_column('dids', 'transient')
def upgrade():
'''
upgrade method
'''
if context.get_context().dialect.name != 'sqlite':
add_column('requests', sa.Column('started_at', sa.DateTime))
add_column('requests_history', sa.Column('started_at', sa.DateTime))
def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name != 'sqlite':
drop_column('requests', 'started_at')
drop_column('requests_history', 'started_at')
def downgrade():
'''
downgrade method
'''
drop_table('archive_contents')
drop_table('archive_contents_history')
if context.get_context().dialect.name != 'sqlite':
drop_column('dids', 'is_archive')
drop_column('dids', 'constituent')
drop_column('deleted_dids', 'is_archive')
drop_column('deleted_dids', 'constituent')
1803333ac20f_adding_provenance_and_phys_group.py 文件源码
项目:rucio
作者: rucio01
项目源码
文件源码
阅读 21
收藏 0
点赞 0
评论 0
def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name != 'sqlite':
drop_column('dids', 'provenance')
drop_column('dids', 'phys_group')
45378a1e76a8_create_collection_replica_table.py 文件源码
项目:rucio
作者: rucio01
项目源码
文件源码
阅读 23
收藏 0
点赞 0
评论 0
def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name == 'postgresql':
drop_constraint('COLLECTION_REPLICAS_PK', 'collection_replicas', type_='primary')
drop_constraint('COLLECTION_REPLICAS_TYPE_CHK', 'collection_replicas')
drop_constraint('COLLECTION_REPLICAS_STATE_CHK', 'collection_replicas')
drop_constraint('COLLECTION_REPLICAS_LFN_FK', 'collection_replicas')
drop_constraint('COLLECTION_REPLICAS_RSE_ID_FK', 'collection_replicas')
drop_constraint('COLLECTION_REPLICAS_SIZE_NN', 'collection_replicas')
drop_constraint('COLLECTION_REPLICAS_STATE_NN', 'collection_replicas')
drop_index('COLLECTION_REPLICAS_RSE_ID_IDX', 'collection_replicas')
drop_table('collection_replicas')
def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name != 'sqlite':
drop_column('distances', 'packet_loss')
drop_column('distances', 'latency')
drop_column('distances', 'mbps_file')
drop_column('distances', 'mbps_link')
drop_column('distances', 'queued_total')
drop_column('distances', 'done_1h')
drop_column('distances', 'done_6h')