def downgrade():
'''
downgrade method
'''
if context.get_context().dialect.name not in ('sqlite', 'mysql'):
drop_constraint('messages_event_type_nn', 'messages', type_='check')
drop_constraint('messages_payload_nn', 'messages', type_='check')
drop_constraint('messages_created_nn', 'messages', type_='check')
drop_constraint('messages_updated_nn', 'messages', type_='check')
if context.get_context().dialect.name != 'sqlite':
drop_constraint('messages_pk', 'messages', type_='primary')
rename_table('messages', 'callbacks')
if context.get_context().dialect.name != 'sqlite':
create_primary_key('callbacks_pk', 'callbacks', ['id'])
create_check_constraint('callbacks_event_type_nn', 'callbacks', 'event_type is not null')
create_check_constraint('callbacks_payload_nn', 'callbacks', 'payload is not null')
create_check_constraint('callbacks_created_nn', 'callbacks', 'created_at is not null')
create_check_constraint('callbacks_updated_nn', 'callbacks', 'updated_at is not null')
58c8b78301ab_rename_callback_to_message.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录