本文整理汇总了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'
])
示例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'])
示例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 ###
示例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'
""")
示例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))
示例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')
示例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'])
示例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))
示例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'])
示例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")
示例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 """)
示例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",
],
)
示例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')
""")
示例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')
示例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 """)