当前位置: 首页>>代码示例>>Python>>正文


Python migrations.load_stored_proc函数代码示例

本文整理汇总了Python中socorro.lib.migrations.load_stored_proc函数的典型用法代码示例。如果您正苦于以下问题:Python load_stored_proc函数的具体用法?Python load_stored_proc怎么用?Python load_stored_proc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了load_stored_proc函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: downgrade

def downgrade():
    load_stored_proc(op, ['update_correlations_addon.sql',
                          'update_correlations_core.sql',
                          'update_correlations_module.sql'])
    op.drop_column(u'correlations_module', 'reason_id')
    op.drop_column(u'correlations_core', 'reason_id')
    op.drop_column(u'correlations_addon', 'reason_id')
开发者ID:Earth4,项目名称:socorro,代码行数:7,代码来源:26521f842be2_bug_1030218_group_correlations_by_reason.py

示例2: downgrade

def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_table(u'adu_by_build')
    ### end Alembic commands ###
    load_stored_proc(op, ['backfill_crash_adu_by_build_signature.sql',
                          'backfill_matviews.sql',
                          'update_crash_adu_by_build_signature.sql'])
开发者ID:Krispy2009,项目名称:socorro,代码行数:7,代码来源:58d0dc2f6aa4_adding_adu_by_build_.py

示例3: upgrade

def upgrade():
    # Get a list of ALL tables that start with 'processed_crashes'
    connection = op.get_bind()
    cursor = connection.connection.cursor()
    cursor.execute("""
        SELECT table_name
        FROM information_schema.tables
        WHERE table_name like 'processed_crashes%'
    """)
    all_table_names = []
    for records in cursor.fetchall():
        all_table_names.append(records[0])

    # Sort table names so 'processed_crashes' is last since the others depend
    # on it and delete them in that order
    all_table_names.sort(reverse=True)
    for table_name in all_table_names:
        op.execute('DROP TABLE IF EXISTS {}'.format(table_name))

    # Now remove the entry from report_partition_info so the crontabber job
    # doesn't try to create a new partition
    op.execute("""
        DELETE FROM report_partition_info WHERE table_name = 'processed_crashes'
    """)

    # Now update the stored procedure
    load_stored_proc(op, ['truncate_partitions.sql'])
开发者ID:stephendonner,项目名称:socorro,代码行数:27,代码来源:1feab2fbed4c_bug_1435551_processed_crashes.py

示例4: upgrade

def upgrade():
    load_stored_proc(op, ['add_new_product.sql',
                          'edit_product_info.sql',
                          'reports_clean_weekly_partition.sql',
                          'update_crash_adu_by_build_signature.sql',
                          'update_crashes_by_user.sql',
                          'update_crashes_by_user_build.sql',
                          'update_home_page_graph.sql',
                          'update_home_page_graph_build.sql',
                          'update_nightly_builds.sql',
                          'update_signatures.sql',
                          'update_tcbs.sql',
                          '001_reports_clean.sql'])

    op.execute(""" DROP FUNCTION backfill_one_day(date) """)

    op.execute("""
        insert into product_build_types (
            SELECT product_name, lower(release_channel)::build_type, throttle
            FROM product_release_channels
        )
    """)
    op.execute(""" COMMIT """)

    today = datetime.datetime.utcnow().strftime('%Y-%m-%d')

    # Backfill reports_clean so that we don't have inconsistent build_type data
    op.execute("""
        SELECT backfill_reports_clean('%s 00:00:00'::timestamptz,
            '%s 00:00:00'::timestamptz + '1 day'::interval)
        """ % (today, today))
开发者ID:Earth4,项目名称:socorro,代码行数:31,代码来源:514789372d99_fixes_bug_959354_remaining_stored_proc_.py

示例5: downgrade

def downgrade():
    load_stored_proc(
        op, [
        'update_crashes_by_user_build.sql',
        'update_home_page_graph_build.sql',
        'update_tcbs_build.sql'
    ])
开发者ID:Earth4,项目名称:socorro,代码行数:7,代码来源:122bac0f6ade_bug_917823_remove_7d.py

示例6: downgrade

def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column(u'exploitability_reports', u'product_version_id')
    op.drop_column(u'exploitability_reports', u'product_name')
    op.drop_column(u'exploitability_reports', u'version_string')
    load_stored_proc(op, ['update_exploitability.sql'])
    ### end Alembic commands ###
开发者ID:Earth4,项目名称:socorro,代码行数:7,代码来源:3a5471a358bf_adding_a_migration_f.py

示例7: downgrade

def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    load_stored_proc(
        op,
        [
            "update_signature_summary_architecture.sql",
            "update_signature_summary_device.sql",
            "update_signature_summary_flash_version.sql",
            "update_signature_summary_graphics.sql",
            "update_signature_summary_installations.sql",
            "update_signature_summary_os.sql",
            "update_signature_summary_process_type.sql",
            "update_signature_summary_products.sql",
            "update_signature_summary_uptime.sql",
        ],
    )
    op.execute(""" DROP FUNCTION find_weekly_partition(date, text) """)
    op.execute(""" delete from report_partition_info where table_name = 'signature_summary_device' """)
    op.execute(
        """
        UPDATE report_partition_info
        SET timetype = 'TIMESTAMPTZ'
        WHERE table_name = 'missing_symbols'
    """
    )
开发者ID:snorp,项目名称:socorro,代码行数:25,代码来源:3e9fd64194df_fixes_bug_1149716_update_partitioned_by_.py

示例8: upgrade

def upgrade():
    # Bug 1398200
    op.execute('DROP TABLE IF EXISTS plugins')

    # Bug 1457484
    op.execute('DROP TABLE IF EXISTS release_channel_matches')
    op.execute('DROP TABLE IF EXISTS replication_test')
    op.execute('DROP TABLE IF EXISTS sessions')
    op.execute('DROP TABLE IF EXISTS socorro_db_version')
    op.execute('DROP TABLE IF EXISTS socorro_db_version_history')
    op.execute('DROP TABLE IF EXISTS transform_rules')
    op.execute('DROP TABLE IF EXISTS crashes_by_user')
    op.execute('DROP TABLE IF EXISTS crashes_by_user_build')
    op.execute('DROP TABLE IF EXISTS uptime_levels')
    op.execute('DROP TABLE IF EXISTS modules')
    op.execute('DROP TABLE IF EXISTS crash_types')
    op.execute('DROP TABLE IF EXISTS process_types')
    op.execute('DROP TABLE IF EXISTS rank_compare')

    op.execute('DROP FUNCTION IF EXISTS backfill_rank_compare(date)')
    op.execute('DROP FUNCTION IF EXISTS update_rank_compare(date, boolean, interval)')

    # Load the new version of backfill_matviews
    load_stored_proc(op, ['backfill_matviews.sql'])

    # Bug 1440474
    op.execute('DROP TABLE IF EXISTS android_devices')

    op.execute('DROP FUNCTION IF EXISTS update_android_devices(date, boolean)')
    op.execute('DROP FUNCTION IF EXISTS backfill_android_devices(date)')
开发者ID:stephendonner,项目名称:socorro,代码行数:30,代码来源:1e188109fc6b_bug_1398200_1457484_remove_plugins.py

示例9: upgrade

def upgrade():
    # Delete the stored procedures
    op.execute('DROP FUNCTION IF EXISTS update_signatures(date, boolean)')
    op.execute('DROP FUNCTION IF EXISTS update_signatures_hourly(timestamp, interval, boolean)')

    # Load the new version of backfill_matviews
    load_stored_proc(op, ['backfill_matviews.sql'])
开发者ID:stephendonner,项目名称:socorro,代码行数:7,代码来源:68b29ca0e06d_bug_1375434_update_signatures.py

示例10: downgrade

def downgrade():
    op.execute("""
        CREATE TABLE suspicious_crash_signatures (
            suspicious_crash_signature_id integer NOT NULL,
            signature_id integer,
            report_date timestamp with time zone
        )
    """)
    # This doesn't actually have to be the real function. Just something so the
    # downgrade works in alembic integration testing in Travis.
    op.execute("""
        CREATE OR REPLACE FUNCTION backfill_explosiveness(updateday date)
        RETURNS boolean
        LANGUAGE plpgsql
            AS $$
        BEGIN
        RETURN TRUE;
        END; $$;
    """)
    op.execute("""
        CREATE OR REPLACE FUNCTION update_explosiveness(updateday date)
        RETURNS boolean
        LANGUAGE plpgsql
            AS $$
        BEGIN
        RETURN TRUE;
        END; $$;
    """)
    op.execute('COMMIT')

    load_stored_proc(op, ['backfill_matviews.sql'])
开发者ID:Krispy2009,项目名称:socorro,代码行数:31,代码来源:9371b45451b_remove_explosiveness_and_suspicious.py

示例11: upgrade

def upgrade():
    load_stored_proc(op, [
        'backfill_named_table.sql',
        'update_signature_summary_architecture.sql',
        'update_signature_summary_device.sql',
        'update_signature_summary_flash_version.sql',
        'update_signature_summary_installations.sql',
        'update_signature_summary_os.sql',
        'update_signature_summary_process_type.sql',
        'update_signature_summary_products.sql',
        'update_signature_summary_uptime.sql'
    ])

    op.execute("""
        DROP FUNCTION IF EXISTS update_signature_summary_devices(date, boolean)
    """)
    op.execute("""
        DROP FUNCTION IF EXISTS backfill_signature_summary_devices(date, boolean)
    """)
    op.execute("""
        DROP FUNCTION IF EXISTS backfill_signature_summary_graphics(date, boolean)
    """)
    op.execute("""
        DROP FUNCTION IF EXISTS update_signature_summary(date, boolean)
    """)
    op.execute("""
        DROP FUNCTION IF EXISTS backfill_signature_summary(date, boolean)
    """)
开发者ID:Earth4,项目名称:socorro,代码行数:28,代码来源:477e1c6e6df3_fixes_bug_933963_spl.py

示例12: downgrade

def downgrade():
    load_stored_proc(op, [
        'create_weekly_partition.sql',
        'nonzero_string.sql',
        'reports_clean_weekly_partition.sql',
        'pg_stat_statements.sql',
        'pg_stat_statements_reset.sql',
    ])
开发者ID:Krispy2009,项目名称:socorro,代码行数:8,代码来源:63d05b930c3_fixes_bug_1136854_fix_permissions_.py

示例13: upgrade

def upgrade():
    load_stored_proc(op, ['update_correlations_addon.sql',
                          'update_correlations_core.sql',
                          'update_correlations_module.sql'])
    op.execute(""" TRUNCATE correlations_addon, correlations_core, correlations_module""")
    op.add_column(u'correlations_addon', sa.Column('reason_id', sa.INTEGER(), nullable=False))
    op.add_column(u'correlations_core', sa.Column('reason_id', sa.INTEGER(), nullable=False))
    op.add_column(u'correlations_module', sa.Column('reason_id', sa.INTEGER(), nullable=False))
开发者ID:Earth4,项目名称:socorro,代码行数:8,代码来源:26521f842be2_bug_1030218_group_correlations_by_reason.py

示例14: downgrade

def downgrade():
    op.drop_column(u'reports_clean', u'update_channel')
    op.drop_table(u'update_channel_map')
    op.drop_table(u'raw_update_channels')

    op.execute(""" DROP FUNCTION backfill_raw_update_channel(timestamptz, timestamptz) """)
    op.execute(""" DROP FUNCTION update_raw_update_channel(timestamptz, interval, boolean, boolean, text) """)
    load_stored_proc(op, ['backfill_matviews.sql'])
开发者ID:Earth4,项目名称:socorro,代码行数:8,代码来源:4d8345089e2a_fixes_bug_968493_add.py

示例15: upgrade

def upgrade():
    op.execute(
        'DROP FUNCTION update_gccrashes(date, boolean, interval)'
    )
    op.execute(
        'DROP FUNCTION backfill_gccrashes(date, interval)'
    )
    op.execute('DROP TABLE IF EXISTS gccrashes')
    load_stored_proc(op, ['backfill_matviews.sql'])
开发者ID:m8ttyB,项目名称:socorro,代码行数:9,代码来源:afc2f95a298b_remove_gccrashes.py


注:本文中的socorro.lib.migrations.load_stored_proc函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。