Sha256: 43b314c0bfe70972eb022e4aefc2b166b86879683e9a1ac6d8273c44cee21517
Contents?: true
Size: 1.06 KB
Versions: 44
Compression:
Stored size: 1.06 KB
Contents
require_relative "../ddl_statements/latest_triggered_webhooks" Sequel.migration do up do create_or_replace_view(:latest_triggered_webhook_creation_dates, latest_triggered_webhook_creation_dates_v2) create_or_replace_view(:latest_triggered_webhook_ids, latest_triggered_webhook_ids_v2) create_or_replace_view(:latest_triggered_webhooks, latest_triggered_webhooks_v2) end down do create_or_replace_view(:latest_triggered_webhook_ids, "select webhook_uuid, consumer_id, provider_id, max(created_at) as latest_triggered_webhook_created_at from triggered_webhooks group by webhook_uuid, consumer_id, provider_id" ) create_or_replace_view(:latest_triggered_webhooks, "select tw.* from triggered_webhooks tw inner join latest_triggered_webhook_ids ltwi on tw.consumer_id = ltwi.consumer_id and tw.provider_id = ltwi.provider_id and tw.webhook_uuid = ltwi.webhook_uuid and tw.created_at = ltwi.latest_triggered_webhook_created_at" ) drop_view(:latest_triggered_webhook_creation_dates) end end
Version data entries
44 entries across 44 versions & 1 rubygems