本文整理汇总了Python中sqlalchemy.BLOB属性的典型用法代码示例。如果您正苦于以下问题:Python sqlalchemy.BLOB属性的具体用法?Python sqlalchemy.BLOB怎么用?Python sqlalchemy.BLOB使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类sqlalchemy
的用法示例。
在下文中一共展示了sqlalchemy.BLOB属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: upgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BLOB [as 别名]
def upgrade():
# SECRETS TABLE:
# Can just drop this, was't really used before
op.drop_column('secret', 'acl_id')
op.alter_column('secret', 'type', type_=sa.Enum('password', 'token'),
existing_server_default=None,
existing_nullable=False)
op.add_column('secret', sa.Column('encryption_scheme', sa.Integer(),
server_default='0', nullable=False))
op.add_column('secret', sa.Column('_secret', sa.BLOB(),
nullable=False))
# Account tables:
# Don't need to change column types for password_id, refresh_token_id;
# only add foreign key indices.
op.create_foreign_key('genericaccount_ibfk_2', 'genericaccount', 'secret',
['password_id'], ['id'])
op.create_foreign_key('gmailaccount_ibfk_2', 'gmailaccount', 'secret',
['refresh_token_id'], ['id'])
op.create_foreign_key('outlookaccount_ibfk_2', 'outlookaccount', 'secret',
['refresh_token_id'], ['id'])
示例2: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BLOB [as 别名]
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('bridge', sa.Column('settings', sa.BLOB(), nullable=True))
# ### end Alembic commands ###