Esempio n. 1
0
def downgrade():
    network_groups_name_downgrade()
    downgrade_node_labels()
    extensions_field_downgrade()
    downgrade_cluster_ui_settings()
    extend_nic_model_downgrade()
    extend_releases_model_downgrade()
    networking_templates_downgrade()
    migrate_volumes_into_extension_downgrade()
    node_roles_as_plugin_downgrade()
    extend_plugin_model_downgrade()
    extend_node_model_downgrade()
    configurable_hostnames_downgrade()
    extend_ip_addrs_model_downgrade()
    downgrade_task_names()
    vms_conf_downgrade()
    extend_segmentation_type_downgrade()

    op.execute('UPDATE clusters SET name=LEFT(name, 50)')
    op.alter_column('clusters', 'name', type_=sa.VARCHAR(50))
    op.drop_constraint(
        'oswl_stats_cluster_id_created_date_resource_type_unique_key',
        'oswl_stats', type_='unique')
    op.alter_column(
        'oswl_stats', 'resource_checksum', existing_type=sa.TEXT(),
        nullable=True)
    op.drop_constraint('nodes_nodegroups_fk', 'nodes', type_='foreignkey')
    op.drop_constraint('network_groups_nodegroups_fk', 'network_groups',
                       type_='foreignkey')
Esempio n. 2
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('completed_tasks', 'completed_later',
               existing_type=sa.BOOLEAN(),
               nullable=False,
               existing_server_default=sa.text("'false'"))
    op.drop_table('site_administration')
def downgrade():
    if op.get_bind().dialect.name == 'sqlite':
        with op.batch_alter_table('quotes') as batch_op:
            batch_op.add_column(sa.Column('approved', sa.Integer(), nullable=True))
            batch_op.drop_column('accepted')
    else:
        op.alter_column('quotes', 'accepted', new_column_name='approved')
Esempio n. 4
0
def upgrade():
    op.create_foreign_key(
        'network_groups_nodegroups_fk', 'network_groups', 'nodegroups',
        ['group_id'], ['id'])
    op.create_foreign_key(
        'nodes_nodegroups_fk', 'nodes', 'nodegroups', ['group_id'], ['id'])
    op.alter_column(
        'oswl_stats', 'resource_checksum', existing_type=sa.TEXT(),
        nullable=False)
    op.create_unique_constraint(
        'oswl_stats_cluster_id_created_date_resource_type_unique_key',
        'oswl_stats', ['cluster_id', 'created_date', 'resource_type'])
    op.alter_column('clusters', 'name', type_=sa.TEXT())

    extend_ip_addrs_model_upgrade()
    extend_node_model_upgrade()
    configurable_hostnames_upgrade()
    extend_plugin_model_upgrade()
    upgrade_node_roles_metadata()
    node_roles_as_plugin_upgrade()
    migrate_volumes_into_extension_upgrade()
    networking_templates_upgrade()
    extend_releases_model_upgrade()
    upgrade_task_names()
    vms_conf_upgrade()
    extend_nic_model_upgrade()
    upgrade_cluster_ui_settings()
    upgrade_cluster_bond_settings()
    extensions_field_upgrade()
    set_deployable_false_for_old_releases()
    upgrade_node_labels()
    extend_segmentation_type()
    network_groups_name_upgrade()
Esempio n. 5
0
def upgrade():
    ''' Add the artifact field to the Package table, fill it and adjust
    the unique key constraints.
    '''

    op.add_column(
        'Package',
        sa.Column(
            'namespace',
            sa.String(50),
            sa.ForeignKey(
                'namespaces.namespace',
                onupdate='CASCADE',
                ondelete='CASCADE',
            ),
            default='rpms',
        )
    )

    op.execute('''UPDATE "Package" SET namespace='rpms';''')

    op.alter_column(
        'Package',
        column_name='namespace',
        nullable=False,
        existing_nullable=True)

    op.execute("""
DROP INDEX IF EXISTS "ix_Package_name";
ALTER TABLE "Package"
  ADD CONSTRAINT "ix_package_name_namespace" UNIQUE (name, namespace);
""")
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('investments', 'value',
                    type_=mysql.FLOAT(display_width=11),
                    )
    op.create_table('industries',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_industries_name'), 'industries', ['name'], unique=True)
    op.create_table('involvements',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_involvements_name'), 'involvements', ['name'], unique=True)
    op.create_table('value_units',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=50), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_value_units_name'), 'value_units', ['name'], unique=True)
    op.add_column(u'investments', sa.Column('fdi_notes', sa.String(length=1024), nullable=True))
    op.add_column(u'investments', sa.Column('industry_id', sa.Integer(), nullable=True))
    op.add_column(u'investments', sa.Column('involvement_id', sa.Integer(), nullable=True))
    op.add_column(u'investments', sa.Column('value_unit_id', sa.Integer(), nullable=True))
    op.create_index(op.f('ix_investments_industry_id'), 'investments', ['industry_id'], unique=False)
    op.create_index(op.f('ix_investments_involvement_id'), 'investments', ['involvement_id'], unique=False)
    op.create_index(op.f('ix_investments_value_unit_id'), 'investments', ['value_unit_id'], unique=False)
    op.create_foreign_key(None, 'investments', 'industries', ['industry_id'], ['id'])
    op.create_foreign_key(None, 'investments', 'involvements', ['involvement_id'], ['id'])
    op.create_foreign_key(None, 'investments', 'value_units', ['value_unit_id'], ['id'])
    op.drop_column(u'investments', 'government')
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('statistic_visitor', 'referred',
               existing_type=mysql.VARCHAR(collation=u'utf8_unicode_ci', length=128),
               nullable=False,
               existing_server_default=sa.text(u"''"))
    op.drop_column('machine_statistic', 'version')
def upgrade(active_plugins=None, options=None):
    if not migration.should_run(active_plugins, migration_for_plugins):
        return

    op.alter_column('packetfilters', 'network_id',
                    existing_type=sa.String(length=36),
                    nullable=False)
Esempio n. 9
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('product', sa.Column('create_date', sa.DateTime(), nullable=True))

    results = op.get_bind().execute(text("""
    select prd.id, min(po.order_date) from purchase_order po, product prd, purchase_order_line pol
    where pol.product_id = prd.id and po.id = pol.purchase_order_id
    group by prd.id
    """)).fetchall()
    for r in results:
        sup_id = r[0]
        po_date = r[1]
        sql = "update product set create_date = '{0}' where id={1}".format(po_date, sup_id)
        op.get_bind().execute(text(sql))

    results = op.get_bind().execute(text("""
    select p.id, min(so.order_date) from sales_order so, sales_order_line sol,
    product p where so.id = sol.sales_order_id and
    sol.product_id = p.id group by p.id;
    """)).fetchall()
    for r in results:
        sup_id = r[0]
        so_date = r[1]
        sql = "update product set create_date = '{0}' where id={1} and create_date is null".format(so_date, sup_id)
        op.get_bind().execute(text(sql))

    op.get_bind().execute(text("update product set create_date = '{0}' where create_date is null".format(datetime.now())))
    op.alter_column('product', 'create_date', existing_type=sa.DateTime(), nullable=False)
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    #op.drop_table(u'radio_content_type')
    op.alter_column(u'content_podcast', 'description',
               existing_type=sa.VARCHAR(length=100),
               type_=sa.String(length=1000),
               existing_nullable=True)
def upgrade():

    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('work_experience', 'country_iso',
               existing_type=sa.VARCHAR(length=2),
               nullable=True,
               existing_server_default="DE'::character varying")
def upgrade():
    op.alter_column(
        'users', 'node',
        nullable=True,
        existing_type=sa.String(64),
        existing_server_default=None,
    )
def upgrade_table(table_name):
  """Add audit foreign key to a table."""

  op.add_column(
      table_name,
      sa.Column("audit_id", sa.Integer(), nullable=True)
  )
  op.execute("""
      UPDATE {table_name} AS t
      JOIN contexts AS c ON
          c.id = t.context_id AND
          c.related_object_type = "Audit"
      JOIN audits AS au ON
          c.related_object_id = au.id
      SET
        t.audit_id = au.id
  """.format(
      table_name=table_name,
  ))

  op.alter_column(
      table_name,
      "audit_id",
      existing_type=sa.Integer(),
      nullable=False
  )

  op.create_foreign_key(
      "fk_{}_audits".format(table_name),
      table_name,
      "audits",
      ["audit_id"],
      ["id"],
      ondelete="RESTRICT"
  )
def upgrade():
    resource_type = op.create_table(
        'resource_type',
        sa.Column('name', sa.String(length=255), nullable=False),
        sa.PrimaryKeyConstraint('name'),
        mysql_charset='utf8',
        mysql_engine='InnoDB'
    )

    resource = sa.Table('resource', sa.MetaData(),
                        type_string_col("type", "resource"))
    op.execute(resource_type.insert().from_select(
        ['name'], sa.select([resource.c.type]).distinct()))

    for table in ["resource", "resource_history"]:
        op.alter_column(table, "type", new_column_name="old_type",
                        existing_type=type_enum)
        op.add_column(table, type_string_col("type", table))
        sa_table = sa.Table(table, sa.MetaData(),
                            type_string_col("type", table),
                            type_enum_col('old_type'))
        op.execute(sa_table.update().values(
            {sa_table.c.type: sa_table.c.old_type}))
        op.drop_column(table, "old_type")
        op.alter_column(table, "type", nullable=False,
                        existing_type=type_string)
Esempio n. 15
0
def upgrade():

  op.alter_column(
      'cycle_task_group_object_tasks',
      'cycle_task_group_object_id',
      existing_type=sa.Integer(),
      nullable=True
  )

  op.add_column(
      'cycle_task_group_object_tasks',
      sa.Column('cycle_task_group_id', sa.Integer(), nullable=False)
  )

  op.execute("""
    UPDATE cycle_task_group_object_tasks
    SET cycle_task_group_id=(
      SELECT cycle_task_group_id
      FROM cycle_task_group_objects
      WHERE id=cycle_task_group_object_tasks.cycle_task_group_object_id
    )
  """)

  op.create_foreign_key(
      "cycle_task_group_id", "cycle_task_group_object_tasks",
      "cycle_task_groups", ["cycle_task_group_id"], ["id"]
  )
Esempio n. 16
0
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_index(op.f('ix_games_api_key'), 'games', ['api_key'], unique=True)
    op.drop_constraint(u'games_api_key_key', 'games', type_='unique')
    op.alter_column('users', 'game_id',
               existing_type=sa.INTEGER(),
               nullable=True)
Esempio n. 17
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('users', 'game_id',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.create_unique_constraint(u'games_api_key_key', 'games', ['api_key'])
    op.drop_index(op.f('ix_games_api_key'), table_name='games')
Esempio n. 18
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('use_of_force_incidents', sa.Column('status', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('day_of_week', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('received_date', postgresql.TIMESTAMP(), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('citizen_injured', sa.BOOLEAN(), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('citizen_weapon', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('citizen_hospitalized', sa.BOOLEAN(), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('year', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('hour', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('month', sa.INTEGER(), autoincrement=False, nullable=True))
    op.alter_column('use_of_force_incidents', 'department_id',
               existing_type=sa.INTEGER(),
               nullable=True)
    op.drop_column('use_of_force_incidents', 'shift')
    op.drop_column('use_of_force_incidents', 'resident_weapon_used')
    op.drop_column('use_of_force_incidents', 'resident_resist_type')
    op.drop_column('use_of_force_incidents', 'resident_race')
    op.drop_column('use_of_force_incidents', 'resident_injured')
    op.drop_column('use_of_force_incidents', 'resident_hospitalized')
    op.drop_column('use_of_force_incidents', 'precinct')
    op.drop_column('use_of_force_incidents', 'officer_race')
    op.drop_column('use_of_force_incidents', 'officer_force_type')
    op.drop_column('use_of_force_incidents', 'office_weapon_used')
    op.drop_column('use_of_force_incidents', 'division')
    op.drop_column('use_of_force_incidents', 'beat')
Esempio n. 19
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    drop_table('skills')
    drop_column(u'items', 'hon_name')
    drop_column(u'items', 'order')
    alter_column(u'items', 'vendor', name='category')
    drop_column(u'heroes', 'day_site_range')
    drop_column(u'heroes', 'min_damage')
    drop_column(u'heroes', 'intelligence')
    drop_column(u'heroes', 'agility')
    drop_column(u'heroes', 'night_site_range')
    drop_column(u'heroes', 'min_attack_animation')
    drop_column(u'heroes', 'attack_range')
    drop_column(u'heroes', 'strength_gain')
    drop_column(u'heroes', 'strength')
    drop_column(u'heroes', 'min_hp')
    drop_column(u'heroes', 'armor')
    drop_column(u'heroes', 'intelligence_gain')
    drop_column(u'heroes', 'movespeed')
    drop_column(u'heroes', 'max_hp')
    drop_column(u'heroes', 'max_cast_animation')
    drop_column(u'heroes', 'stat')
    drop_column(u'heroes', 'faction')
    drop_column(u'heroes', 'missile_speed')
    drop_column(u'heroes', 'max_damage')
    drop_column(u'heroes', 'min_cast_animation')
    drop_column(u'heroes', 'max_mana')
    drop_column(u'heroes', 'roles')
    drop_column(u'heroes', 'base_attack_time')
    drop_column(u'heroes', 'agility_gain')
    drop_column(u'heroes', 'min_mana')
    drop_column(u'heroes', 'max_attack_animation')
    drop_column(u'heroes', 'order')
Esempio n. 20
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('user', 'mobile',
               existing_type=mysql.VARCHAR(length=11),
               nullable=False,
               existing_server_default=sa.text(u"''"))
    op.drop_column('order', 'is_quick')
Esempio n. 21
0
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('use_of_force_incidents', sa.Column('beat', sa.String(length=255), nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('division', sa.String(length=255), nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('office_weapon_used', sa.String(length=255), nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('officer_force_type', sa.String(length=255), nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('officer_race', sa.String(length=255), nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('precinct', sa.String(length=255), nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('resident_hospitalized', sa.Boolean(), nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('resident_injured', sa.Boolean(), nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('resident_race', sa.String(length=255), nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('resident_resist_type', sa.String(length=255), nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('resident_weapon_used', sa.String(length=255), nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('shift', sa.String(length=255), nullable=True))
    op.alter_column('use_of_force_incidents', 'department_id',
               existing_type=sa.INTEGER(),
               nullable=False)
    op.drop_column('use_of_force_incidents', 'month')
    op.drop_column('use_of_force_incidents', 'hour')
    op.drop_column('use_of_force_incidents', 'year')
    op.drop_column('use_of_force_incidents', 'citizen_hospitalized')
    op.drop_column('use_of_force_incidents', 'citizen_weapon')
    op.drop_column('use_of_force_incidents', 'citizen_injured')
    op.drop_column('use_of_force_incidents', 'received_date')
    op.drop_column('use_of_force_incidents', 'day_of_week')
    op.drop_column('use_of_force_incidents', 'status')
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('series', 'analytic_context_key')
    op.drop_index('ix_homepath_census_block', table_name='homepath_listing')
    op.drop_index(op.f('ix_craigslist_listing_subdomain'), table_name='craigslist_listing')
    op.create_table('census_block_series',
    sa.Column('state_fp', sa.VARCHAR(length=2), autoincrement=False, nullable=False),
    sa.Column('county_fp', sa.VARCHAR(length=3), autoincrement=False, nullable=False),
    sa.Column('tract_ce', sa.VARCHAR(length=6), autoincrement=False, nullable=False),
    sa.Column('block_ce', sa.VARCHAR(length=1), autoincrement=False, nullable=False),
    sa.Column('series_key', sa.VARCHAR(length=40), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['series_key'], [u'series.key'], name=u'fk_census_block_series_series_key_series'),
    sa.ForeignKeyConstraint(['state_fp', 'county_fp', 'tract_ce', 'block_ce'], [u'census_block.state_fp', u'census_block.county_fp', u'census_block.tract_ce', u'census_block.block_ce'], name=u'fk_census_block_series'),
    sa.PrimaryKeyConstraint('state_fp', 'county_fp', 'tract_ce', 'block_ce', 'series_key', name=u'pk_census_block_series')
    )
    op.create_table('series_segment',
    sa.Column('series_key', sa.VARCHAR(length=40), autoincrement=False, nullable=False),
    sa.Column('dimension_id', sa.VARCHAR(length=20), autoincrement=False, nullable=False),
    sa.Column('segment_id', sa.VARCHAR(length=20), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['dimension_id', 'segment_id'], [u'segment.dimension_id', u'segment.id'], name=u'fk_series_segment'),
    sa.ForeignKeyConstraint(['dimension_id'], [u'dimension.id'], name=u'fk_series_segment_dimension_id_dimension'),
    sa.ForeignKeyConstraint(['series_key'], [u'series.key'], name=u'fk_series_segment_series_key_series'),
    sa.PrimaryKeyConstraint('series_key', 'dimension_id', 'segment_id', name=u'pk_series_segment')
    )
    op.drop_index('ix_census_block_segment_census_block', table_name='census_block_segment')
    op.drop_table('census_block_segment')
    op.drop_index(op.f('ix_analytic_context_segment_analytic_context_key'), table_name='analytic_context_segment')
    op.drop_index('ix_analytic_context_segment', table_name='analytic_context_segment')
    op.drop_table('analytic_context_segment')
    op.drop_table('analytic_context')

    op.execute(segment.delete(segment.c.dimension_id == 'census_block'))
    op.alter_column('segment', 'sort_value', type_=sa.Unicode(10))
Esempio n. 23
0
def _add_parent_id_nn_column():
  """Add parent_id_nn column and make it non nullable.

  The creation of the column and making it non nullable are done in separate
  steps to avoid mysql warnings for missing values.
  """
  op.add_column(
      'access_control_list',
      sa.Column(
          'parent_id_nn',
          sa.Integer(),
          server_default="0",
          nullable=True,
      ),
  )

  op.execute("update access_control_list set parent_id_nn = parent_id")
  op.execute("""
      update access_control_list
      set parent_id_nn = 0
      where parent_id_nn is null
  """)

  op.alter_column(
      'access_control_list',
      'parent_id_nn',
      existing_type=sa.Integer(),
      server_default="0",
      nullable=False,
  )
Esempio n. 24
0
def upgrade():
    sa.orm.events.MapperEvents._clear()  # avoids filedepot magic

    from depot.manager import DepotManager
    from depot.fields.upload import UploadedFile
    from depot.fields.sqlalchemy import UploadedFileField

    from kotti import DBSession, metadata
    from kotti.resources import File

    t = sa.Table("files", metadata)
    t.c.data.type = sa.LargeBinary()
    dn = DepotManager.get_default()

    for obj in DBSession.query(File):
        uploaded_file = UploadedFile({"depot_name": dn, "files": []})
        uploaded_file._thaw()
        uploaded_file.process_content(obj.data, filename=obj.filename, content_type=obj.mimetype)
        stored_file = DepotManager.get().get(uploaded_file["file_id"])
        obj.data = uploaded_file.encode()
        stored_file.last_modified = obj.modification_date

        log.info(
            "Migrated {} bytes for File with pk {} to {}/{}".format(len(obj.data), obj.id, dn, uploaded_file["file_id"])
        )

    DBSession.flush()
    if DBSession.get_bind().name != "sqlite":  # not supported by sqlite
        op.alter_column("files", "data", type_=UploadedFileField())
def downgrade(pyramid_env):
    if using_virtuoso():
        with context.begin_transaction():
            op.create_table('social_auth_account_temp',
                sa.Column('id', sa.Integer, primary_key=True),
                sa.Column('username', sa.String(200)))
            # Do stuff with the app's models here.
        from assembl import models as m
        db = m.get_session_maker()()
        with transaction.manager:
            db.execute("""INSERT INTO social_auth_account_temp
                       SELECT id, username FROM social_auth_account
                       WHERE username IS NOT NULL""")
            mark_changed()
        with context.begin_transaction():
            op.drop_column('social_auth_account', 'username')
            op.add_column(
                'social_auth_account', sa.Column('username', sa.String(200)))
        with transaction.manager:
            db.execute("""UPDATE social_auth_account
                       SET username = (
                       SELECT username FROM social_auth_account_temp
                       WHERE social_auth_account_temp.id = social_auth_account.id)""")
            mark_changed()
        with context.begin_transaction():
            op.drop_table('social_auth_account_temp')
    else:
        with context.begin_transaction():
            op.alter_column('social_auth_account', 'username', type_=sa.Unicode(200))
def upgrade():
    op.alter_column(
        'app_definitions',
        'distribution',
        nullable=False,
        type_=VARCHAR(20)
    )
Esempio n. 27
0
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('yt_match',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('espn_id', sa.Integer(), nullable=True),
    sa.Column('league_id', sa.Integer(), nullable=True),
    sa.Column('finish', sa.SmallInteger(), nullable=True),
    sa.Column('home_score', sa.SmallInteger(), nullable=True),
    sa.Column('away_score', sa.SmallInteger(), nullable=True),
    sa.Column('home_id', sa.Integer(), nullable=True),
    sa.Column('away_id', sa.Integer(), nullable=True),
    sa.Column('date', sa.Date(), nullable=True),
    sa.ForeignKeyConstraint(['away_id'], ['yt_team.id'], ),
    sa.ForeignKeyConstraint(['home_id'], ['yt_team.id'], ),
    sa.ForeignKeyConstraint(['league_id'], ['yt_league.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.alter_column(u'league_team', 'league_id',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=True,
               existing_server_default=sa.text(u"'0'"))
    op.alter_column(u'league_team', 'team_id',
               existing_type=mysql.INTEGER(display_width=11),
               nullable=True,
               existing_server_default=sa.text(u"'0'"))
def upgrade():
    op.add_column(
        'environments',
        sa.Column(
            'zone_id',
            INTEGER(),
            info={'after': 'prefix'}
        )
    )
    op.execute(
        'update environments join zones on environments.domain = '
        'zones.zoneName set environments.zone_id = zones.ZoneID'
    )
    op.alter_column(
        'environments',
        'zone_id',
        nullable=False,
        existing_type=INTEGER()
    )
    op.create_foreign_key(
        'fk_environments_zone_id_zones',
        'environments',
        'zones',
        ['zone_id'],
        ['zoneID']
    )
Esempio n. 29
0
def parse_modify_command(command):
    # From arguments of command is created op.alter_column() that has the
    # following syntax:
    # alter_column(table_name, column_name, nullable=None,
    #              server_default=False, new_column_name=None, type_=None,
    #              autoincrement=None, existing_type=None,
    #              existing_server_default=False, existing_nullable=None,
    #              existing_autoincrement=None, schema=None, **kw)
    for modified, schema, table, column, existing, old, new in command:
        if modified.endswith("type"):
            modified = "type_"
        elif modified.endswith("nullable"):
            modified = "nullable"
            bind = op.get_bind()
            insp = sqlalchemy.engine.reflection.Inspector.from_engine(bind)
            if column in insp.get_primary_keys(table) and new:
                return
        elif modified.endswith("default"):
            modified = "server_default"
        if isinstance(new, basestring):
            new = text(new)
        kwargs = {modified: new, "schema": schema}
        default = existing.get("existing_server_default")
        if default and isinstance(default, sa_schema.DefaultClause):
            if isinstance(default.arg, basestring):
                existing["existing_server_default"] = default.arg
            else:
                existing["existing_server_default"] = default.arg.compile(dialect=bind.engine.name)
        kwargs.update(existing)
        op.alter_column(table, column, **kwargs)
Esempio n. 30
0
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('order', sa.Column('is_quick', sa.Boolean(), nullable=True))
    op.alter_column('user', 'mobile',
               existing_type=mysql.VARCHAR(length=11),
               nullable=True,
               existing_server_default=sa.text(u"''"))
def downgrade():
    op.alter_column(table_name='comments',
                    column_name='content_id',
                    new_column_name='article_id',
                    existing_type=sa.Integer())
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('pin_data', 'bookmark', new_column_name='pins_copied')
def downgrade():
    op.alter_column('pgpkey', 'key', type_=sa.String(16384))
def upgrade():
    op.alter_column('pgpkey', 'key', type_=sa.String(32768))
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column("users",
                    "active",
                    existing_type=mysql.TINYINT(display_width=1),
                    nullable=True)
Esempio n. 36
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('Artist', 'seeking_venue',
               existing_type=sa.BOOLEAN(),
               nullable=True)
def downgrade():
    op.add_column('users', sa.Column('is_ready', sa.Boolean(), nullable=True))
    op.execute("UPDATE users SET is_ready = true")
    op.alter_column('users', 'is_ready', nullable=False)
Esempio n. 38
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('artists',
                    'genres',
                    existing_type=sa.VARCHAR(length=120),
                    nullable=False)
Esempio n. 39
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('Cource_Data',
                    'Cource_Time',
                    existing_type=sa.VARCHAR(length=64),
                    nullable=True)
Esempio n. 40
0
def upgrade():
    op.alter_column('subnets',
                    'network_id',
                    nullable=False,
                    existing_type=sa.String(36))
Esempio n. 41
0
def upgrade():
    query = 'UPDATE "user" SET locale=\'en\';'
    op.execute(query)
    op.alter_column('user', 'locale', nullable=False)
    op.alter_column('user', 'privacy_mode', nullable=False)
Esempio n. 42
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('admin', sa.Boolean(), nullable=True))
    op.execute('UPDATE users SET admin=FALSE')
    op.alter_column('users', 'admin', nullable=False)
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('member', sa.Column('group_admin', sa.Boolean(), nullable=True))
    op.execute("UPDATE \"member\" SET group_admin=FALSE WHERE group_admin IS NULL")
    op.alter_column('member', 'group_admin', nullable=False)
Esempio n. 44
0
def downgrade():
    op.alter_column('user', 'locale', nullable=True)
    op.alter_column('user', 'privacy_mode', nullable=True)
Esempio n. 45
0
 def test_col_nullable(self):
     context = op_fixture("mysql")
     op.alter_column("t1", "c1", nullable=True, existing_type=Integer)
     context.assert_("ALTER TABLE t1 MODIFY c1 INTEGER NULL")
Esempio n. 46
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###

    op.alter_column('events',
                    'original_image_url',
                    new_column_name='background_url')
    op.alter_column('events', 'logo_url', new_column_name='logo')
    op.alter_column('events', 'large_image_url', new_column_name='large')
    op.alter_column('events',
                    'thumbnail_image_url',
                    new_column_name='thumbnail')
    op.alter_column('events', 'icon_image_url', new_column_name='icon')

    op.alter_column('events_version',
                    'original_image_url',
                    new_column_name='background_url')
    op.alter_column('events_version', 'logo_url', new_column_name='logo')
    op.alter_column('events_version',
                    'large_image_url',
                    new_column_name='large')
    op.alter_column('events_version',
                    'thumbnail_image_url',
                    new_column_name='thumbnail')
    op.alter_column('events_version', 'icon_image_url', new_column_name='icon')
Esempio n. 47
0
 def test_alter_column_drop_default(self):
     context = op_fixture("mysql")
     op.alter_column("t", "c", existing_type=Integer, server_default=None)
     context.assert_("ALTER TABLE t ALTER COLUMN c DROP DEFAULT")
def upgrade():
    conversions = [('slope_lt_30', 'slope_lt_30'),
                   ('slope_30_32', 'slope_30_35'),
                   ('slope_33_35', 'slope_30_35'),
                   ('slope_36_38', 'slope_35_40'),
                   ('slope_39_41', 'slope_35_40'),
                   ('slope_42_44', 'slope_40_45'),
                   ('slope_45_47', 'slope_gt_45'),
                   ('slope_gt_47', 'slope_gt_45')]

    old_options = ('slope_lt_30', 'slope_30_32', 'slope_33_35', 'slope_36_38',
                   'slope_39_41', 'slope_42_44', 'slope_45_47', 'slope_gt_47')
    new_options = ('slope_lt_30', 'slope_30_35', 'slope_35_40', 'slope_40_45',
                   'slope_gt_45')

    old_type = sa.Enum(*old_options,
                       name='avalanche_slope',
                       schema='guidebook')
    new_type = sa.Enum(*new_options,
                       name='avalanche_slope_',
                       schema='guidebook')
    new_type.create(op.get_bind(), checkfirst=False)

    # Create new column with temporary name
    op.add_column('xreports',
                  sa.Column('avalanche_slope_', new_type, nullable=True),
                  schema='guidebook')

    op.add_column('xreports_archives',
                  sa.Column('avalanche_slope_', new_type, nullable=True),
                  schema='guidebook')

    # Fill new column using the old 'avalanche_slope' column values
    xreports = Table('xreports',
                     MetaData(),
                     sa.Column('avalanche_slope', old_type, nullable=True),
                     sa.Column('avalanche_slope_', new_type, nullable=True),
                     schema='guidebook')
    for (old_value, new_value) in conversions:
        op.execute(
            xreports.update(). \
            where(xreports.c.avalanche_slope==op.inline_literal(old_value)). \
            values({'avalanche_slope_':op.inline_literal(new_value)})
        )

    archives = Table('xreports_archives',
                     MetaData(),
                     sa.Column('avalanche_slope', old_type, nullable=True),
                     sa.Column('avalanche_slope_', new_type, nullable=True),
                     schema='guidebook')
    for (old_value, new_value) in conversions:
        op.execute(
            archives.update(). \
            where(archives.c.avalanche_slope==op.inline_literal(old_value)). \
            values({'avalanche_slope_':op.inline_literal(new_value)})
        )

    # Drop old column and enum
    op.drop_column('xreports', 'avalanche_slope', schema='guidebook')
    op.drop_column('xreports_archives', 'avalanche_slope', schema='guidebook')
    drop_enum('avalanche_slope', schema='guidebook')

    # Rename enum
    op.execute(
        'ALTER TYPE guidebook.avalanche_slope_ RENAME TO avalanche_slope')

    # Rename column
    op.alter_column('xreports',
                    'avalanche_slope_',
                    new_column_name='avalanche_slope',
                    schema='guidebook')

    op.alter_column('xreports_archives',
                    'avalanche_slope_',
                    new_column_name='avalanche_slope',
                    schema='guidebook')
def upgrade():
    op.add_column(u'report_partition_info',
                  sa.Column(u'partition_column', sa.TEXT()))

    # Drop FK constraints on parent tables
    op.drop_constraint(
        'signature_summary_architecture_product_version_id_fkey',
        'signature_summary_architecture')
    op.drop_constraint('signature_summary_architecture_signature_id_fkey',
                       'signature_summary_architecture')
    op.drop_constraint(
        'signature_summary_flash_version_product_version_id_fkey',
        'signature_summary_flash_version')
    op.drop_constraint('signature_summary_flash_version_signature_id_fkey',
                       'signature_summary_flash_version')
    op.drop_constraint('signature_summary_installations_signature_id_fkey',
                       'signature_summary_installations')
    op.drop_constraint('signature_summary_os_product_version_id_fkey',
                       'signature_summary_os')
    op.drop_constraint('signature_summary_os_signature_id_fkey',
                       'signature_summary_os')
    op.drop_constraint(
        'signature_summary_process_type_product_version_id_fkey',
        'signature_summary_process_type')
    op.drop_constraint('signature_summary_process_type_signature_id_fkey',
                       'signature_summary_process_type')
    op.drop_constraint('signature_summary_products_product_version_id_fkey',
                       'signature_summary_products')
    op.drop_constraint('signature_summary_products_signature_id_fkey',
                       'signature_summary_products')
    op.drop_constraint('signature_summary_uptime_product_version_id_fkey',
                       'signature_summary_uptime')
    op.drop_constraint('signature_summary_uptime_signature_id_fkey',
                       'signature_summary_uptime')

    app_path = os.getcwd()
    procs = [
        'weekly_report_partitions.sql', 'backfill_weekly_report_partitions.sql'
    ]
    for myfile in [
            app_path + '/socorro/external/postgresql/raw_sql/procs/' + line
            for line in procs
    ]:
        proc = open(myfile, 'r').read()
        op.execute(proc)
    # Now run this against the raw_crashes table
    op.execute("""
        UPDATE report_partition_info
        SET partition_column = 'date_processed'
    """)

    report_partition_info = table(
        u'report_partition_info',
        column(u'build_order', sa.INTEGER()),
        column(u'fkeys', postgresql.ARRAY(sa.TEXT())),
        column(u'indexes', postgresql.ARRAY(sa.TEXT())),
        column(u'keys', postgresql.ARRAY(sa.TEXT())),
        column(u'table_name', CITEXT()),
        column(u'partition_column', sa.TEXT()),
    )
    op.bulk_insert(report_partition_info, [
        {
            'table_name': u'signature_summary_installations',
            'build_order': 5,
            'fkeys': ["(signature_id) REFERENCES signatures(signature_id)"],
            'partition_column': 'report_date',
            'keys': ["signature_id,product_name,version_string,report_date"],
            'indexes': ["report_date"],
        },
        {
            'table_name':
            u'signature_summary_architecture',
            'build_order':
            6,
            'fkeys': [
                "(signature_id) REFERENCES signatures(signature_id)",
                "(product_version_id) REFERENCES product_versions(product_version_id)"
            ],
            'partition_column':
            'report_date',
            'keys':
            ["signature_id, architecture, product_version_id, report_date"],
            'indexes': ["report_date"],
        },
        {
            'table_name':
            u'signature_summary_flash_version',
            'build_order':
            7,
            'fkeys': [
                "(signature_id) REFERENCES signatures(signature_id)",
                "(product_version_id) REFERENCES product_versions(product_version_id)"
            ],
            'partition_column':
            'report_date',
            'keys':
            ["signature_id, flash_version, product_version_id, report_date"],
            'indexes': ["report_date"],
        },
        {
            'table_name':
            u'signature_summary_os',
            'build_order':
            8,
            'fkeys': [
                "(signature_id) REFERENCES signatures(signature_id)",
                "(product_version_id) REFERENCES product_versions(product_version_id)"
            ],
            'partition_column':
            'report_date',
            'keys': [
                "signature_id, os_version_string, product_version_id, report_date"
            ],
            'indexes': ["report_date"],
        },
        {
            'table_name':
            u'signature_summary_process_type',
            'build_order':
            9,
            'fkeys': [
                "(signature_id) REFERENCES signatures(signature_id)",
                "(product_version_id) REFERENCES product_versions(product_version_id)"
            ],
            'partition_column':
            'report_date',
            'keys':
            ["signature_id, process_type, product_version_id, report_date"],
            'indexes': ["report_date"],
        },
        {
            'table_name':
            u'signature_summary_products',
            'build_order':
            10,
            'fkeys': [
                "(signature_id) REFERENCES signatures(signature_id)",
                "(product_version_id) REFERENCES product_versions(product_version_id)"
            ],
            'partition_column':
            'report_date',
            'keys': ["signature_id, product_version_id, report_date"],
            'indexes': ["report_date"],
        },
        {
            'table_name':
            u'signature_summary_uptime',
            'build_order':
            11,
            'fkeys': [
                "(signature_id) REFERENCES signatures(signature_id)",
                "(product_version_id) REFERENCES product_versions(product_version_id)"
            ],
            'partition_column':
            'report_date',
            'keys':
            ["signature_id, uptime_string, product_version_id, report_date"],
            'indexes': ["report_date"],
        },
    ])

    op.alter_column(u'report_partition_info',
                    u'partition_column',
                    existing_type=sa.TEXT(),
                    nullable=False)

    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_architecture')
    """)
    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_flash_version')
    """)
    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_installations')
    """)
    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_os')
    """)
    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_process_type')
    """)
    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_products')
    """)
    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_uptime')
    """)
Esempio n. 50
0
 def test_alter_column_modify_default(self):
     context = op_fixture("mysql")
     # notice we dont need the existing type on this one...
     op.alter_column("t", "c", server_default="1")
     context.assert_("ALTER TABLE t ALTER COLUMN c SET DEFAULT '1'")
Esempio n. 51
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        'venue',
        sa.Column('facebook',
                  sa.VARCHAR(length=120),
                  autoincrement=False,
                  nullable=True))
    op.alter_column('venue',
                    'state',
                    existing_type=sa.VARCHAR(length=120),
                    nullable=True)
    op.alter_column('venue',
                    'phone',
                    existing_type=sa.VARCHAR(length=120),
                    nullable=True)
    op.alter_column('venue', 'name', existing_type=sa.VARCHAR(), nullable=True)
    op.alter_column('venue',
                    'image_link',
                    existing_type=sa.VARCHAR(length=500),
                    nullable=True)
    op.alter_column('venue',
                    'city',
                    existing_type=sa.VARCHAR(length=120),
                    nullable=True)
    op.alter_column('venue',
                    'address',
                    existing_type=sa.VARCHAR(length=120),
                    nullable=True)
Esempio n. 52
0
 def test_col_add_autoincrement(self):
     context = op_fixture("mysql")
     op.alter_column("t1", "c1", existing_type=Integer, autoincrement=True)
     context.assert_("ALTER TABLE t1 MODIFY c1 INTEGER NULL AUTO_INCREMENT")
Esempio n. 53
0
def downgrade():
    op.alter_column('mock_obm',
                    'id',
                    existing_type=sa.BigInteger(),
                    type_=sa.INTEGER())
Esempio n. 54
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('person',
                    'username',
                    existing_type=mysql.VARCHAR(length=80),
                    nullable=False)
Esempio n. 55
0
def downgrade():
    op.alter_column('users',
                    'default_alias_custom_domain_id',
                    new_column_name='default_random_alias_domain_id')
Esempio n. 56
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('venue',
                    'address',
                    existing_type=sa.VARCHAR(length=120),
                    nullable=False)
    op.alter_column('venue',
                    'city',
                    existing_type=sa.VARCHAR(length=120),
                    nullable=False)
    op.alter_column('venue',
                    'image_link',
                    existing_type=sa.VARCHAR(length=500),
                    nullable=False)
    op.alter_column('venue',
                    'name',
                    existing_type=sa.VARCHAR(),
                    nullable=False)
    op.alter_column('venue',
                    'phone',
                    existing_type=sa.VARCHAR(length=120),
                    nullable=False)
    op.alter_column('venue',
                    'state',
                    existing_type=sa.VARCHAR(length=120),
                    nullable=False)
    op.drop_column('venue', 'facebook')
Esempio n. 57
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('user',
                    'active',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.add_column(
        'loan_return_order_version',
        sa.Column('instoreCategory', mysql.VARCHAR(length=255), nullable=True))
    op.drop_column('loan_return_order_version', 'loanCategory')
    op.add_column(
        'loan_return_order',
        sa.Column('instoreCategory', mysql.VARCHAR(length=255), nullable=True))
    op.drop_column('loan_return_order', 'loanCategory')
    op.alter_column('file_resource_version',
                    'addTime',
                    existing_type=sa.TIMESTAMP(timezone=True),
                    type_=mysql.TIMESTAMP(),
                    existing_nullable=True,
                    autoincrement=False)
    op.alter_column('file_resource',
                    'addTime',
                    existing_type=sa.TIMESTAMP(timezone=True),
                    server_default=sa.text(
                        u'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'),
                    type_=mysql.TIMESTAMP(),
                    existing_nullable=False)
    op.alter_column('examine_repair_record_version',
                    'Soluted',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True,
                    autoincrement=False)
    op.alter_column('examine_repair_record',
                    'Soluted',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'view',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'upload_meeting_file',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'upload_contract_file',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'submit_review',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'submit',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'stored',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'sent',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'send',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'second_approved',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'second_approve_refuse',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'review_refuse',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'review_approve',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'review_again',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'review',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'reserve_again',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'receive',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'put_in_store',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'purchase_application',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'out_store_part',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'out_store_finish',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'in_store_part',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'in_store_finish',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'finish',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'edit_bound_status',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'edit',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'delete',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create_st',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create_scrap',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create_rw',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create_rp_rt',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create_rf',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create_out',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create_mr',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create_lr',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create_in',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create_er',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create_eo',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create_br',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create_as',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'create',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'check_complete',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'cancel',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'borrowing_in_return',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'borrow_application',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'approved',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'approve_refuse',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('basic_action',
                    'approve',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
Esempio n. 58
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('todos',
                    'list_id',
                    existing_type=sa.INTEGER(),
                    nullable=True)
Esempio n. 59
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('show', 'start_date', new_column_name='starte_date')
Esempio n. 60
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('server',
                    'manufacturers',
                    existing_type=mysql.VARCHAR(length=50),
                    nullable=False)