Sha256: c49dfb54bcaecff56b30fb3b46b3a3c1b688c4c41738f26eeda26a4852059e9a
Contents?: true
Size: 1.06 KB
Versions: 20
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
20 entries across 20 versions & 1 rubygems