def downgrade(pyramid_env):
with context.begin_transaction():
from assembl import models as m
db = m.get_session_maker()()
with transaction.manager:
# Undo correcting of the spelling mistake in attachment model.
a = m.Attachment.__table__
db.execute(
a.update().where(a.c.attachmentPurpose == op.inline_literal(
'EMBED_ATTACHMENT')).
values(attachmentPurpose=op.inline_literal(
"EMBEEDED_ATTACHMENT"))
)
op.drop_column('facebook_source', 'upper_bound')
op.drop_column('facebook_source', 'lower_bound')
op.drop_column('facebook_post', 'attachment_blob')
op.add_column('facebook_post', sa.Column('post_type', sa.String(20)))
op.add_column('facebook_post', sa.Column('link_name',
sa.Unicode(1024)))
op.add_column('facebook_post', sa.Column('attachment',
sa.String(1024)))
e5d1484442b_facebook_attachment.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录