本文整理汇总了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')
示例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: 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'])
示例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))
示例5: downgrade
def downgrade():
load_stored_proc(
op, [
'update_crashes_by_user_build.sql',
'update_home_page_graph_build.sql',
'update_tcbs_build.sql'
])
示例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 ###
示例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'
"""
)
示例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)')
示例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'])
示例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'])
示例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)
""")
示例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():
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))
示例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'])
示例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'])