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


Python migrations.load_stored_proc函数代码示例

本文整理汇总了Python中socorrolib.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_crashes_by_user_build.sql',
        'update_home_page_graph_build.sql',
        'update_tcbs_build.sql'
    ])
开发者ID:4thAce,项目名称:socorro,代码行数:7,代码来源:122bac0f6ade_bug_917823_remove_7d.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:4thAce,项目名称:socorro,代码行数:7,代码来源:58d0dc2f6aa4_adding_adu_by_build_.py

示例3: 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:4thAce,项目名称:socorro,代码行数:7,代码来源:3a5471a358bf_adding_a_migration_f.py

示例4: upgrade

def upgrade():
    ### 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',
        'find_weekly_partition.sql'
    ])
    # Insert partitioning for device as well
    op.execute("""
        INSERT INTO report_partition_info
        (table_name, build_order, keys, indexes, fkeys, partition_column, timetype)
        VALUES (
            'signature_summary_device',
            '14',
            '{"signature_id, android_device_id, product_version_id, report_date"}',
            '{report_date}',
            '{}',
            'report_date',
            'DATE'
        )
    """)
    op.execute("""
        UPDATE report_partition_info
        SET timetype = 'DATE'
        WHERE table_name = 'missing_symbols'
    """)
开发者ID:4thAce,项目名称:socorro,代码行数:33,代码来源:3e9fd64194df_fixes_bug_1149716_update_partitioned_by_.py

示例5: 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:4thAce,项目名称:socorro,代码行数:31,代码来源:514789372d99_fixes_bug_959354_remaining_stored_proc_.py

示例6: 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:4thAce,项目名称:socorro,代码行数:7,代码来源:26521f842be2_bug_1030218_group_correlations_by_reason.py

示例7: 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:4thAce,项目名称:socorro,代码行数:8,代码来源:4d8345089e2a_fixes_bug_968493_add.py

示例8: 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:4thAce,项目名称:socorro,代码行数:8,代码来源:26521f842be2_bug_1030218_group_correlations_by_reason.py

示例9: upgrade

def upgrade():
    op.execute("""
        UPDATE product_versions
        SET sunset_date = NOW()
        WHERE
            product_name = 'MetroFirefox' AND
            sunset_date >= NOW()
    """)
    load_stored_proc(op, ['update_product_versions.sql'])
开发者ID:4thAce,项目名称:socorro,代码行数:9,代码来源:b99155654de_sunset_all_future_metrofirefox.py

示例10: upgrade

def upgrade():
    load_stored_proc(op, ["update_gccrashes.sql", "backfill_gccrashes.sql", "backfill_matviews.sql"])
    op.create_table(
        u"gccrashes",
        sa.Column(u"report_date", postgresql.TIMESTAMP(timezone=True), nullable=False),
        sa.Column(u"product_version_id", postgresql.INTEGER(), nullable=False),
        sa.Column(u"build", sa.NUMERIC(), nullable=True),
        sa.Column(u"is_gc_count", sa.INTEGER(), nullable=False),
    )
    fix_permissions(op, "gccrashes")
开发者ID:KaiRo-at,项目名称:socorro,代码行数:10,代码来源:6ef54091228_bug_967593_gc_crash_count.py

示例11: upgrade

def upgrade():
    load_stored_proc(op, ['crash_madu.sql', 'update_gccrashes.sql'])
    op.execute(""" TRUNCATE gccrashes """)
    op.alter_column(u'gccrashes', u'is_gc_count',
                    new_column_name=u'gc_count_madu', type_=sa.REAL())
    now = datetime.datetime.utcnow()
    for backfill_date in [
        (now - datetime.timedelta(days=days)).strftime("%Y-%m-%d")
            for days in range(1,30)]:
                op.execute(""" SELECT backfill_gccrashes('%s') """ % backfill_date)
                op.execute(""" COMMIT """)
开发者ID:4thAce,项目名称:socorro,代码行数:11,代码来源:c1ac31c8fea_fix_bug_972612_is_gc_count_should_be_.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:KaiRo-at,项目名称:socorro,代码行数:11,代码来源:63d05b930c3_fixes_bug_1136854_fix_permissions_.py

示例13: upgrade

def upgrade():
    # updated documentation for update_product_versions
    load_stored_proc(op, ['update_product_versions.sql'])
    # insert new fennec repos into special_product_platforms
    op.execute("""
        INSERT INTO special_product_platforms
            (platform, repository, release_channel, release_name, product_name, min_version)
        VALUES
            ('android-arm', 'mozilla-central-android-api-11', 'nightly', 'mobile', 'FennecAndroid', '37.0'),
            ('android-arm', 'mozilla-aurora-android-api-11', 'aurora', 'mobile', 'FennecAndroid', '37.0')
    """)
开发者ID:4thAce,项目名称:socorro,代码行数:11,代码来源:e4ea2ae3413_fixes_bug_1122145_update_special_.py

示例14: upgrade

def upgrade():
    load_stored_proc(op, ['update_correlations_module.sql'])
    op.execute(""" TRUNCATE correlations_module """)
    op.create_table('modules',
    sa.Column('module_id', sa.INTEGER(), nullable=False),
    sa.Column('name', sa.TEXT(), nullable=False),
    sa.Column('version', sa.TEXT(), nullable=False),
    sa.PrimaryKeyConstraint('module_id', 'name', 'version')
    )
    op.add_column(u'correlations_module', sa.Column('module_id', sa.INTEGER(), nullable=False))
    op.drop_column(u'correlations_module', 'module_name')
    op.drop_column(u'correlations_module', 'module_version')
开发者ID:4thAce,项目名称:socorro,代码行数:12,代码来源:1f235c84eaed_bug_1025987_normalize_correlations_table.py

示例15: upgrade

def upgrade():
    load_stored_proc(op, ['update_exploitability.sql'])

    # Rid ourselves of incorrect data
    op.execute(""" TRUNCATE exploitability_reports """)
    op.execute(""" COMMIT """)

    today = datetime.datetime.utcnow().strftime('%Y-%m-%d')
    # Backfill!
    for i in range(0, 7):
        op.execute(""" select backfill_exploitability(('%s'::date - '%s days'::interval)::date) """ % (today, i))
        op.execute(""" COMMIT """)
开发者ID:4thAce,项目名称:socorro,代码行数:12,代码来源:4a6b5fec10e9_bug_951825_update_exploitability.py


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