Python sqlalchemy.dialects.mysql 模块,TEXT 实例源码

我们从Python开源项目中,提取了以下10个代码示例,用于说明如何使用sqlalchemy.dialects.mysql.TEXT

项目:metaseek    作者:ahoarfrost    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('nuccore',
    sa.Column('id', mysql.INTEGER(display_width=11), nullable=False),
    sa.Column('nuccore_uid', mysql.VARCHAR(length=50), nullable=True),
    sa.Column('nuccore_link', mysql.TEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset=u'utf8',
    mysql_engine=u'InnoDB'
    )
    op.create_table('dataset_to_nuccore',
    sa.Column('dataset_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
    sa.Column('nuccore_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['dataset_id'], [u'dataset.id'], name=u'dataset_to_nuccore_ibfk_1'),
    sa.ForeignKeyConstraint(['nuccore_id'], [u'nuccore.id'], name=u'dataset_to_nuccore_ibfk_2'),
    mysql_default_charset=u'utf8',
    mysql_engine=u'InnoDB'
    )
    # ### end Alembic commands ###
项目:incubator-airflow-old    作者:apache    | 项目源码 | 文件源码
def downgrade():
    if context.config.get_main_option('sqlalchemy.url').startswith('mysql'):
        op.alter_column(table_name='variable', column_name='val', type_=mysql.TEXT)
项目:chihu    作者:yelongyu    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('posts', sa.Column('body_html', mysql.TEXT(collation=u'utf8_unicode_ci'), nullable=True))
    op.drop_column('posts', 'view_count')
    ### end Alembic commands ###
项目:metaseek    作者:ahoarfrost    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('dataset', sa.Column('nuccore_link', mysql.TEXT(), nullable=True))
    # ### end Alembic commands ###
项目:metaseek    作者:ahoarfrost    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(u'dataset', sa.Column('nuccore_uids', mysql.TEXT(), nullable=True))
    op.drop_table('nuccore')
    # ### end Alembic commands ###
项目:flask_api    作者:nullcc    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('id', mysql.INTEGER(display_width=11), nullable=False),
    sa.Column('username', mysql.VARCHAR(length=100), nullable=False),
    sa.Column('password_hash', mysql.TEXT(), nullable=False),
    sa.Column('email', mysql.VARCHAR(length=200), nullable=False),
    sa.Column('gender', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('desc', mysql.TEXT(), nullable=False),
    sa.Column('credit', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('role', mysql.VARCHAR(length=20), nullable=False),
    sa.Column('status', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('created_time', mysql.DATETIME(), nullable=False),
    sa.Column('updated_time', mysql.DATETIME(), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='utf8',
    mysql_engine='InnoDB'
    )
    op.create_table('posts',
    sa.Column('id', mysql.INTEGER(display_width=11), nullable=False),
    sa.Column('user_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
    sa.Column('title', mysql.VARCHAR(length=100), nullable=False),
    sa.Column('content', mysql.TEXT(), nullable=False),
    sa.Column('views', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('status', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('created_time', mysql.DATETIME(), nullable=False),
    sa.Column('updated_time', mysql.DATETIME(), nullable=False),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], name='posts_ibfk_1'),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='utf8',
    mysql_engine='InnoDB'
    )
    # ### end Alembic commands ###
项目:nyaa    作者:nyaadevs    | 项目源码 | 文件源码
def upgrade():
    for prefix in TABLE_PREFIXES:
        op.alter_column(prefix + '_comments', 'text',
                   existing_type=mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_bin', length=255),
                   type_=mysql.TEXT(collation='utf8mb4_bin'),
                   existing_nullable=False)
项目:nyaa    作者:nyaadevs    | 项目源码 | 文件源码
def downgrade():
    for prefix in TABLE_PREFIXES:
        op.alter_column(prefix + '_comments', 'text',
                   existing_type=mysql.TEXT(collation='utf8mb4_bin'),
                   type_=mysql.VARCHAR(charset='utf8mb4', collation='utf8mb4_bin', length=255),
                   existing_nullable=False)
项目:metaseek    作者:ahoarfrost    | 项目源码 | 文件源码
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('dataset', 'library_construction_method',
               existing_type=mysql.TEXT(charset=u'utf8', collation=u'utf8_bin'),
               type_=sa.String(length=20),
               existing_nullable=True)
    op.alter_column('dataset', 'library_screening_strategy',
               existing_type=mysql.TEXT(charset=u'utf8', collation=u'utf8_bin'),
               type_=sa.String(length=80),
               existing_nullable=True)
    op.alter_column('dataset', 'library_source',
               existing_type=mysql.TEXT(),
               type_=sa.String(length=50),
               existing_nullable=True)
    op.alter_column('dataset', 'library_strategy',
               existing_type=mysql.TEXT(charset=u'utf8', collation=u'utf8_bin'),
               type_=sa.String(length=50),
               existing_nullable=True)
    op.alter_column('dataset', 'sequencing_method',
               existing_type=mysql.TEXT(charset=u'utf8', collation=u'utf8_bin'),
               type_=sa.String(length=50),
               existing_nullable=True)
    op.alter_column('dataset', 'env_biome',
               existing_type=mysql.TEXT(),
               type_=sa.String(length=100),
               existing_nullable=True)
    op.alter_column('dataset', 'env_feature',
               existing_type=mysql.TEXT(),
               type_=sa.String(length=200),
               existing_nullable=True)
    op.alter_column('dataset', 'env_material',
               existing_type=mysql.TEXT(),
               type_=sa.String(length=150),
               existing_nullable=True)
    op.alter_column('dataset', 'env_package',
               existing_type=mysql.TEXT(),
               type_=sa.String(length=100),
               existing_nullable=True)
    op.alter_column('dataset', 'geo_loc_name',
               existing_type=mysql.TEXT(),
               type_=sa.String(length=100),
               existing_nullable=True)
    op.alter_column('dataset', 'instrument_model',
               existing_type=mysql.TEXT(),
               type_=sa.String(length=50),
               existing_nullable=True)
    op.alter_column('dataset', 'investigation_type',
               existing_type=mysql.TEXT(),
               type_=sa.String(length=80),
               existing_nullable=True)
    op.alter_column('dataset', 'study_type',
               existing_type=mysql.TEXT(),
               type_=sa.String(length=50),
               existing_nullable=True)
    # ### end Alembic commands ###
项目:metaseek    作者:ahoarfrost    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('dataset', 'sequencing_method',
               existing_type=sa.String(length=50),
               type_=mysql.TEXT(charset=u'utf8', collation=u'utf8_bin'),
               existing_nullable=True)
    op.alter_column('dataset', 'library_strategy',
               existing_type=sa.String(length=50),
               type_=mysql.TEXT(charset=u'utf8', collation=u'utf8_bin'),
               existing_nullable=True)
    op.alter_column('dataset', 'library_source',
               existing_type=sa.String(length=50),
               type_=mysql.TEXT(),
               existing_nullable=True)
    op.alter_column('dataset', 'library_screening_strategy',
               existing_type=sa.String(length=80),
               type_=mysql.TEXT(charset=u'utf8', collation=u'utf8_bin'),
               existing_nullable=True)
    op.alter_column('dataset', 'library_construction_method',
               existing_type=sa.String(length=20),
               type_=mysql.TEXT(charset=u'utf8', collation=u'utf8_bin'),
               existing_nullable=True)
    op.alter_column('dataset', 'study_type',
               existing_type=sa.String(length=50),
               type_=mysql.TEXT(),
               existing_nullable=True)
    op.alter_column('dataset', 'investigation_type',
               existing_type=sa.String(length=80),
               type_=mysql.TEXT(),
               existing_nullable=True)
    op.alter_column('dataset', 'instrument_model',
               existing_type=sa.String(length=50),
               type_=mysql.TEXT(),
               existing_nullable=True)
    op.alter_column('dataset', 'geo_loc_name',
               existing_type=sa.String(length=100),
               type_=mysql.TEXT(),
               existing_nullable=True)
    op.alter_column('dataset', 'env_package',
               existing_type=sa.String(length=100),
               type_=mysql.TEXT(),
               existing_nullable=True)
    op.alter_column('dataset', 'env_material',
               existing_type=sa.String(length=150),
               type_=mysql.TEXT(),
               existing_nullable=True)
    op.alter_column('dataset', 'env_feature',
               existing_type=sa.String(length=200),
               type_=mysql.TEXT(),
               existing_nullable=True)
    op.alter_column('dataset', 'env_biome',
               existing_type=sa.String(length=100),
               type_=mysql.TEXT(),
               existing_nullable=True)
    # ### end Alembic commands ###