本文整理匯總了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 ###