• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python migrations.load_stored_proc函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: downgrade

def downgrade():
    load_stored_proc(op, ["backfill_matviews.sql"])
    op.execute(
        """
        DROP FUNCTION update_gccrashes(date, boolean, interval)
    """
    )
    op.execute(
        """
        DROP FUNCTION backfill_gccrashes(date, boolean, interval)
    """
    )
    op.drop_table(u"gccrashes")
开发者ID:KaiRo-at,项目名称:socorro,代码行数:13,代码来源:6ef54091228_bug_967593_gc_crash_count.py


示例17: upgrade

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

    op.execute("""
        TRUNCATE crash_adu_by_build_signature
    """)

    today = datetime.datetime.utcnow().strftime('%Y-%m-%d')
    for i in range(0,7):
        op.execute("""
            SELECT backfill_crash_adu_by_build_signature(
                ('%s'::date - '%s days'::interval)::date
            )
        """  % (today, i))
开发者ID:4thAce,项目名称:socorro,代码行数:14,代码来源:433adca8a14c_bug_1007379_adu_by_sig_should_show_.py


示例18: upgrade

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.execute('TRUNCATE exploitability_reports CASCADE');
    op.add_column(u'exploitability_reports', sa.Column(u'version_string', sa.TEXT(), nullable=True))
    op.add_column(u'exploitability_reports', sa.Column(u'product_name', sa.TEXT(), nullable=True))
    op.add_column(u'exploitability_reports', sa.Column(u'product_version_id', sa.INTEGER(), nullable=False))
    ### end Alembic commands ###
    load_stored_proc(op, ['update_exploitability.sql'])
        
    for i in range(15, 30):
        backfill_date = '2013-11-%s' % i
        op.execute("""
            SELECT backfill_exploitability('%s')
        """ % backfill_date)
    op.execute(""" COMMIT """)
开发者ID:4thAce,项目名称:socorro,代码行数:15,代码来源:3a5471a358bf_adding_a_migration_f.py


示例19: upgrade

def upgrade():
    op.execute('TRUNCATE signature_summary_device, signature_summary_graphics CASCADE')
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column(u'signature_summary_device', sa.Column(u'version_string', sa.TEXT(), nullable=True))
    op.add_column(u'signature_summary_device', sa.Column(u'product_name', sa.TEXT(), nullable=True))
    op.add_column(u'signature_summary_device', sa.Column(u'product_version_id', sa.INTEGER(), nullable=False))
    op.add_column(u'signature_summary_graphics', sa.Column(u'version_string', sa.TEXT(), nullable=True))
    op.add_column(u'signature_summary_graphics', sa.Column(u'product_name', sa.TEXT(), nullable=True))
    op.add_column(u'signature_summary_graphics', sa.Column(u'product_version_id', sa.INTEGER(), nullable=False))
    op.execute('ALTER TABLE signature_summary_graphics DROP CONSTRAINT signature_summary_graphics_pkey')
    op.execute('ALTER TABLE signature_summary_graphics ADD PRIMARY KEY (report_date, product_version_id, signature_id, graphics_device_id)')
    op.execute('ALTER TABLE signature_summary_device DROP CONSTRAINT signature_summary_device_pkey')
    op.execute('ALTER TABLE signature_summary_device ADD PRIMARY KEY (report_date, product_version_id, signature_id, android_device_id)')
    ### end Alembic commands ###
    load_stored_proc(op, ['update_signature_summary.sql',])
开发者ID:4thAce,项目名称:socorro,代码行数:15,代码来源:191d0453cc07_making_reports_honor.py


示例20: downgrade

def downgrade():
    op.drop_column(u'tcbs_build', 'build_type')
    op.drop_column(u'tcbs', 'build_type')
    op.drop_column(u'special_product_platforms', 'build_type')
    op.drop_column(u'reports_clean', 'build_type')
    op.drop_column(u'reports', u'update_channel')
    op.drop_column(u'releases_raw', u'update_channel')
    op.drop_column(u'raw_adu', u'update_channel')
    op.drop_column(u'product_versions', 'build_type_enum')
    op.drop_table(u'product_build_types')

    op.execute(""" DROP TYPE build_type """)
    op.execute(""" DROP TYPE build_type_enum """)

    load_stored_proc(op, ['001_update_reports_clean.sql'])
开发者ID:4thAce,项目名称:socorro,代码行数:15,代码来源:3c5882fb7e3e_bug_956436_new_build.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python util.DotDict类代码示例发布时间:2022-05-27
下一篇:
Python external_common.parse_arguments函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap