def upgrade(): # No database schema changes, just need to execute post-alembic code import sys import os sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) from databases.alembic_post_utils import write_revision_post_alembic write_revision_post_alembic(revision)
def upgrade(): import sys import os sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) from databases.alembic_post_utils import write_revision_post_alembic write_revision_post_alembic(revision) with op.batch_alter_table("widget") as batch_op: batch_op.add_column(sa.Column('period', sa.Float)) batch_op.add_column(sa.Column('custom_options', sa.String)) batch_op.add_column(sa.Column('log_level_debug', sa.Boolean)) with op.batch_alter_table("misc") as batch_op: batch_op.add_column( sa.Column('sample_rate_controller_widget', sa.Float)) op.execute(''' UPDATE widget SET period=30 ''') op.execute(''' UPDATE widget SET custom_options='' ''') op.execute(''' UPDATE widget SET log_level_debug=0 ''') op.execute(''' UPDATE misc SET sample_rate_controller_widget=0.25 ''')
def upgrade(): import sys import os sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) from databases.alembic_post_utils import write_revision_post_alembic write_revision_post_alembic(revision) with op.batch_alter_table("output") as batch_op: batch_op.add_column(sa.Column('position_y', sa.Integer)) batch_op.add_column(sa.Column('size_y', sa.Integer)) with op.batch_alter_table("conditional") as batch_op: batch_op.add_column(sa.Column('position_y', sa.Integer)) with op.batch_alter_table("custom_controller") as batch_op: batch_op.add_column(sa.Column('position_y', sa.Integer)) with op.batch_alter_table("function") as batch_op: batch_op.add_column(sa.Column('position_y', sa.Integer)) with op.batch_alter_table("trigger") as batch_op: batch_op.add_column(sa.Column('position_y', sa.Integer)) with op.batch_alter_table("pid") as batch_op: batch_op.add_column(sa.Column('position_y', sa.Integer))
def upgrade(): write_revision_post_alembic(revision) try: os.remove(ID_FILE) os.remove(STATS_CSV) except: pass
def upgrade(): import sys import os sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) from databases.alembic_post_utils import write_revision_post_alembic write_revision_post_alembic(revision) pass
def upgrade(): import sys import os sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) from databases.alembic_post_utils import write_revision_post_alembic write_revision_post_alembic(revision) with op.batch_alter_table("conditional_data") as batch_op: batch_op.add_column(sa.Column('controller_id', sa.Text))
def upgrade(): write_revision_post_alembic(revision) with op.batch_alter_table("misc") as batch_op: batch_op.add_column(sa.Column('daemon_debug_mode', sa.Boolean)) op.execute( ''' UPDATE misc SET daemon_debug_mode=0 ''' )
def upgrade(): import sys import os sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) from databases.alembic_post_utils import write_revision_post_alembic write_revision_post_alembic(revision) with op.batch_alter_table("lcd") as batch_op: batch_op.add_column(sa.Column('interface', sa.String)) batch_op.add_column(sa.Column('pin_dc', sa.Integer)) batch_op.add_column(sa.Column('spi_device', sa.Integer)) batch_op.add_column(sa.Column('spi_bus', sa.Integer))
def upgrade(): import sys import os sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) from databases.alembic_post_utils import write_revision_post_alembic write_revision_post_alembic(revision) with op.batch_alter_table("function_actions") as batch_op: batch_op.add_column(sa.Column('do_output_amount', sa.Float)) with op.batch_alter_table("pid") as batch_op: batch_op.add_column(sa.Column('raise_output_type', sa.String)) batch_op.add_column(sa.Column('lower_output_type', sa.String))
def upgrade(): import sys import os sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) from databases.alembic_post_utils import write_revision_post_alembic write_revision_post_alembic(revision) op.create_table( 'dashboard_layout', sa.Column('id', sa.Integer, nullable=False, unique=True), sa.Column('unique_id', sa.String, nullable=False, unique=True), sa.Column('name', sa.Text), sa.PrimaryKeyConstraint('id'), keep_existing=True) with op.batch_alter_table("dashboard") as batch_op: batch_op.add_column(sa.Column('dashboard_id', sa.String))
def upgrade(): import sys import os sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) from databases.alembic_post_utils import write_revision_post_alembic write_revision_post_alembic(revision) op.create_table( 'input_channel', sa.Column('id', sa.Integer, nullable=False, unique=True), sa.Column('unique_id', sa.String, nullable=False, unique=True), sa.Column('input_id', sa.Text), sa.Column('channel', sa.Integer), sa.Column('name', sa.Text), sa.Column('custom_options', sa.Text), sa.PrimaryKeyConstraint('id'), keep_existing=True)
def upgrade(): import sys import os sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) from databases.alembic_post_utils import write_revision_post_alembic write_revision_post_alembic(revision) with op.batch_alter_table("users") as batch_op: batch_op.add_column(sa.Column('password_reset_code', sa.Text)) batch_op.add_column( sa.Column('password_reset_code_expiration', sa.DateTime)) batch_op.add_column( sa.Column('password_reset_last_request', sa.DateTime)) with op.batch_alter_table("roles") as batch_op: batch_op.add_column( sa.Column('reset_password', sa.Boolean, default=False))
def upgrade(): import sys import os sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) from databases.alembic_post_utils import write_revision_post_alembic write_revision_post_alembic(revision) with op.batch_alter_table("input") as batch_op: batch_op.add_column(sa.Column('start_offset', sa.Float)) with op.batch_alter_table("dashboard") as batch_op: batch_op.add_column(sa.Column('disable_data_grouping', sa.Text)) op.execute(''' UPDATE input SET start_offset=0 ''') op.execute(''' UPDATE dashboard SET disable_data_grouping='' ''')
def upgrade(): import sys import os sys.path.append(os.path.abspath(os.path.join(__file__, "../../../.."))) from databases.alembic_post_utils import write_revision_post_alembic write_revision_post_alembic(revision) with op.batch_alter_table("pid") as batch_op: batch_op.add_column(sa.Column('setpoint_tracking_type', sa.Text)) batch_op.add_column(sa.Column('setpoint_tracking_id', sa.Text)) batch_op.add_column(sa.Column('setpoint_tracking_max_age', sa.Float)) op.execute( ''' UPDATE pid SET setpoint_tracking_id=method_id ''' ) with op.batch_alter_table("pid") as batch_op: batch_op.drop_column('method_id')
def upgrade(): write_revision_post_alembic(revision)