How to use the databases.alembic_post_utils.write_revision_post_alembic function in databases

To help you get started, we’ve selected a few databases examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kizniche / Mycodo / databases / alembic / versions / 545744b31813_add_conditional_data_schema.py View on Github external
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))
github kizniche / Mycodo / databases / alembic / versions / ef49f6644e0c_save_user_code.py View on Github external
def upgrade():
    write_revision_post_alembic(revision)

    try:
        os.remove(ID_FILE)
        os.remove(STATS_CSV)
    except:
        pass
github kizniche / Mycodo / databases / alembic / versions / 0ce53d526f13_rename_measure_to_condition.py View on Github external
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
github kizniche / Mycodo / databases / alembic / versions / 802cc65f734e_ensure_pyro5_is_installed.py View on Github external
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)
github kizniche / Mycodo / databases / alembic / versions / 2e416233221b_add_daemon_debug_mode_config_option.py View on Github external
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