def upgrade(active_plugins=None, options=None):

    pk_id_tables = ('vims', 'vimauths', 'devices', 'deviceattributes',
                  'servicetypes', 'devicetemplates',
                  'devicetemplateattributes')
    for table in pk_id_tables:
        with migration.modify_foreign_keys_constraint(FK_MAP.get(table, [])):
                op.alter_column(table, 'id', type_=types.Uuid,
                nullable=False)

    fk_template_id_tables = ('devices', 'servicetypes',
                             'devicetemplateattributes')
    for table in fk_template_id_tables:
        with migration.modify_foreign_keys_constraint(fk_template_id_tables):
            op.alter_column(table, 'template_id', type_=types.Uuid,
                            nullable=False)

    fk_vim_id_tables = ('devices', 'vimauths')
    for table in fk_vim_id_tables:
        with migration.modify_foreign_keys_constraint(fk_vim_id_tables):
            op.alter_column(table, 'vim_id', type_=types.Uuid,
                            nullable=False)

    fk_device_id_tables = ('deviceattributes', 'proxymgmtports')
    for table in fk_device_id_tables:
        with migration.modify_foreign_keys_constraint(fk_device_id_tables):
            op.alter_column(table, 'device_id', type_=types.Uuid,
                            nullable=False)
def upgrade(active_plugins=None, options=None):

    pk_id_tables = ('vims', 'vimauths', 'devices', 'deviceattributes',
                  'servicetypes', 'devicetemplates',
                  'devicetemplateattributes')
    for table in pk_id_tables:
        with migration.modify_foreign_keys_constraint(FK_MAP.get(table, [])):
            op.alter_column(table, 'id', type_=types.Uuid,
                            nullable=False)

    fk_template_id_tables = ('devices', 'servicetypes',
                             'devicetemplateattributes')
    for table in fk_template_id_tables:
        with migration.modify_foreign_keys_constraint(fk_template_id_tables):
            op.alter_column(table, 'template_id', type_=types.Uuid,
                            nullable=False)

    fk_vim_id_tables = ('devices', 'vimauths')
    for table in fk_vim_id_tables:
        with migration.modify_foreign_keys_constraint(fk_vim_id_tables):
            op.alter_column(table, 'vim_id', type_=types.Uuid,
                            nullable=False)

    fk_device_id_tables = ('deviceattributes', 'proxymgmtports')
    for table in fk_device_id_tables:
        with migration.modify_foreign_keys_constraint(fk_device_id_tables):
            op.alter_column(table, 'device_id', type_=types.Uuid,
                            nullable=False)
def upgrade(active_plugins=None, options=None):
    # commands auto generated by Alembic - please adjust! #
    fk_constraint = ('deviceattributes', )
    with migration.modify_foreign_keys_constraint(fk_constraint):
        op.alter_column(u'deviceattributes', 'device_id',
                        existing_type=mysql.VARCHAR(length=255),
                        nullable=False)
    op.alter_column(u'devices', 'status', existing_type=mysql.VARCHAR(
        length=255), nullable=False)
Example #4
0
def upgrade(active_plugins=None, options=None):
    # commands auto generated by Alembic - please adjust! #
    fk_constraint = ('deviceattributes', )
    with migration.modify_foreign_keys_constraint(fk_constraint):
        op.alter_column(u'deviceattributes', 'device_id',
                        existing_type=mysql.VARCHAR(length=255),
                        nullable=False)
    op.alter_column(u'devices', 'status', existing_type=mysql.VARCHAR(
        length=255), nullable=False)