Skip to content

Updates CiPlatformMetrics to do bulk insertions

Amy Troschinetz requested to merge ci-platform-metrics-bulk-insert into master

What does this MR do?

Resolves #245321 (closed)

migrate up:

$ bin/rake db:migrate:up VERSION=20200908183231
== 20200908183231 AddCheckPositiveConstraintToCiPlatformMetrics: migrating ====
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE ci_platform_metrics\nADD CONSTRAINT ci_platform_metrics_check_count_positive\nCHECK ( count > 0 )\nNOT VALID;\n")
   -> 0.0008s
-- execute("ALTER TABLE ci_platform_metrics VALIDATE CONSTRAINT ci_platform_metrics_check_count_positive;")
   -> 0.0005s
== 20200908183231 AddCheckPositiveConstraintToCiPlatformMetrics: migrated (0.0065s)

migrate down:

$ bin/rake db:migrate:down VERSION=20200908183231
-- execute("ALTER TABLE ci_platform_metrics\nDROP CONSTRAINT IF EXISTS ci_platform_metrics_check_count_positive\n")
   -> 0.0058s
== 20200908183231 AddCheckPositiveConstraintToCiPlatformMetrics: reverted (0.0092s)
Edited by Amy Troschinetz

Merge request reports