¡@

Home 

OpenStack Study: 511471cc46b_agent_ext_model_supp.py

OpenStack Index

**** CubicPower OpenStack Study ****

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

    if not migration.should_run(active_plugins, migration_for_plugins):

        return

    ### commands auto generated by Alembic - please adjust! ###

    op.create_table(

        'agents',

        sa.Column('id', sa.String(length=36), nullable=False),

        sa.Column('agent_type', sa.String(length=255), nullable=False),

        sa.Column('binary', sa.String(length=255), nullable=False),

        sa.Column('topic', sa.String(length=255), nullable=False),

        sa.Column('host', sa.String(length=255), nullable=False),

        sa.Column('admin_state_up', sa.Boolean(), nullable=False),

        sa.Column('created_at', sa.DateTime(), nullable=False),

        sa.Column('started_at', sa.DateTime(), nullable=False),

        sa.Column('heartbeat_timestamp', sa.DateTime(), nullable=False),

        sa.Column('description', sa.String(length=255), nullable=True),

        sa.Column('configurations', sa.String(length=4095), nullable=False),

        sa.PrimaryKeyConstraint('id')

    )

    ### end Alembic commands ###

**** CubicPower OpenStack Study ****

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

    if not migration.should_run(active_plugins, migration_for_plugins):

        return

    ### commands auto generated by Alembic - please adjust! ###

    op.drop_table('agents')

    ### end Alembic commands ###