我们从Python开源项目中,提取了以下12个代码示例,用于说明如何使用sqlalchemy.dialects.mysql.LONGTEXT。
def load_dialect_impl(self, dialect): if dialect.name == 'mysql': return dialect.type_descriptor(mysql.LONGTEXT()) else: return self.impl
def LongText(): # TODO(rakhmerov): Need to do for postgres. return sa.Text().with_variant(mysql.LONGTEXT(), 'mysql')
def upgrade_development(): ### commands auto generated by Alembic - please adjust! ### op.add_column('posts', sa.Column('comment_data', mysql.LONGTEXT(), nullable=True)) op.add_column('posts', sa.Column('comments_queried_at', sa.DateTime(), nullable=True)) op.add_column('posts', sa.Column('created_at', sa.DateTime(), nullable=True)) ### end Alembic commands ###
def upgrade_test(): ### commands auto generated by Alembic - please adjust! ### op.add_column('posts', sa.Column('comment_data', mysql.LONGTEXT(), nullable=True)) op.add_column('posts', sa.Column('comments_queried_at', sa.DateTime(), nullable=True)) op.add_column('posts', sa.Column('created_at', sa.DateTime(), nullable=True)) ### end Alembic commands ###
def upgrade_production(): ### commands auto generated by Alembic - please adjust! ### op.add_column('posts', sa.Column('comment_data', mysql.LONGTEXT(), nullable=True)) op.add_column('posts', sa.Column('comments_queried_at', sa.DateTime(), nullable=True)) op.add_column('posts', sa.Column('created_at', sa.DateTime(), nullable=True)) ### end Alembic commands ###
def upgrade(): op.alter_column('instance', 'contents', existing_type=mysql.MEDIUMTEXT(collation='utf8_bin'), type_=mysql.LONGTEXT(collation='utf8_bin'), existing_nullable=False)
def downgrade(): op.alter_column('instance', 'contents', existing_type=mysql.LONGTEXT(collation='utf8_bin'), type_=mysql.MEDIUMTEXT(collation='utf8_bin'), existing_nullable=False)