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

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

项目:metaseek    作者:ahoarfrost    | 项目源码 | 文件源码
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('dataset', 'collection_date',
               existing_type=mysql.DATETIME(),
               type_=sa.Text(),
               existing_nullable=True)
    op.alter_column('dataset', 'latitude',
               existing_type=mysql.FLOAT(),
               type_=sa.Text(),
               existing_nullable=True)
    op.alter_column('dataset', 'longitude',
               existing_type=mysql.FLOAT(),
               type_=sa.Text(),
               existing_nullable=True)
    op.alter_column('user', 'admin',
               existing_type=mysql.TINYINT(display_width=1),
               type_=sa.Boolean(),
               existing_nullable=True)
    # ### end Alembic commands ###
项目:metaseek    作者:ahoarfrost    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('user', 'admin',
               existing_type=sa.Boolean(),
               type_=mysql.TINYINT(display_width=1),
               existing_nullable=True)
    op.alter_column('dataset', 'longitude',
               existing_type=sa.Text(),
               type_=mysql.FLOAT(),
               existing_nullable=True)
    op.alter_column('dataset', 'latitude',
               existing_type=sa.Text(),
               type_=mysql.FLOAT(),
               existing_nullable=True)
    op.alter_column('dataset', 'collection_date',
               existing_type=sa.Text(),
               type_=mysql.DATETIME(),
               existing_nullable=True)
    # ### end Alembic commands ###
项目:TypingSystem    作者:TrustMe5    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('roles',
    sa.Column('id', mysql.INTEGER(display_width=11), nullable=False),
    sa.Column('name', mysql.VARCHAR(collation=u'utf8_unicode_ci', length=64), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate=u'utf8_unicode_ci',
    mysql_default_charset=u'utf8',
    mysql_engine=u'InnoDB'
    )
    op.create_table('users',
    sa.Column('id', mysql.INTEGER(display_width=11), nullable=False),
    sa.Column('username', mysql.VARCHAR(collation=u'utf8_unicode_ci', length=64), nullable=True),
    sa.Column('role_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
    sa.Column('email', mysql.VARCHAR(collation=u'utf8_unicode_ci', length=64), nullable=True),
    sa.Column('password_hash', mysql.VARCHAR(collation=u'utf8_unicode_ci', length=128), nullable=True),
    sa.Column('confirmed', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['role_id'], [u'roles.id'], name=u'users_ibfk_1'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate=u'utf8_unicode_ci',
    mysql_default_charset=u'utf8',
    mysql_engine=u'InnoDB'
    )
    op.drop_table('context_show')
    ### end Alembic commands ###
项目:BookCloud    作者:livro-aberto    | 项目源码 | 文件源码
def column_reflect(inspector, table, column_info):
    if type(column_info['type']) is mysql.TINYINT:
        column_info['type'] = Boolean()

#from application import User, Project, Branch, Thread, Comment, Likes, User_Tag, File_Tag, Named_Tag, Custom_Tag, Free_Tag, limiter, mail

# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
项目:metaseek    作者:ahoarfrost    | 项目源码 | 文件源码
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('dataset', sa.Column('meta_latitude', sa.Float(), nullable=True))
    op.add_column('dataset', sa.Column('meta_longitude', sa.Float(), nullable=True))
    op.alter_column('user', 'admin',
               existing_type=mysql.TINYINT(display_width=1),
               type_=sa.Boolean(),
               existing_nullable=True)
    # ### end Alembic commands ###
项目:metaseek    作者:ahoarfrost    | 项目源码 | 文件源码
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('user', 'admin',
               existing_type=sa.Boolean(),
               type_=mysql.TINYINT(display_width=1),
               existing_nullable=True)
    op.drop_column('dataset', 'meta_longitude')
    op.drop_column('dataset', 'meta_latitude')
    # ### end Alembic commands ###
项目:get5-web    作者:splewis    | 项目源码 | 文件源码
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('match', sa.Column('playout_enabled', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True))
    op.add_column('match', sa.Column('overtime_enabled', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True))
    ### end Alembic commands ###