This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Limit (cost=75619.09..75619.14 rows=1 width=84) (actual time=101099.589..101099.594 rows=1 loops=1) | |
| Output: ((m.inserted_at)::date), c.updated_by_id, c.organization_id, (count(c.id)), ((sum((COALESCE(sum(m.segments) FILTER (WHERE ((m.type)::text = 'sms'::text)), '0'::bigint))))::integer), ((sum((COALESCE(sum(m.segments) FILTER (WHERE ((m.type)::text = 'mms'::text)), '0'::bigint))))::integer), (sum(a.sent_messages)), (sum(a.failed_deliveries)), (sum(a.unsubscribes)), (sum(a.responses)), (sum(a.link_clicks)) | |
| Buffers: shared hit=3268301 | |
| -> GroupAggregate (cost=75619.09..75619.19 rows=2 width=84) (actual time=101099.587..101099.592 rows=1 loops=1) | |
| Output: ((m.inserted_at)::date), c.updated_by_id, c.organization_id, count(c.id), (sum((COALESCE(sum(m.segments) FILTER (WHERE ((m.type)::text = 'sms'::text)), '0'::bigint))))::integer, (sum((COALESCE(sum(m.segments) FILTER (WHERE ((m.type)::text = 'mms'::text)), '0'::bigint))))::integer, sum(a.sent_messages), sum(a.failed_deliveries), sum(a.unsubscribe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| iex(6)> DashboardApi.Workers.MessageDetailsBackfill.enqueue | |
| {:ok, | |
| %Oban.Job{ | |
| __meta__: #Ecto.Schema.Metadata<:loaded, "public", "oban_jobs">, | |
| id: 9, | |
| state: "available", | |
| queue: "message_details_backfill", | |
| worker: "DashboardApi.Workers.MessageDetailsBackfill", | |
| args: %{}, | |
| meta: %{}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| defmodule Truely.EventsRepo.Migrations.AddSessionUsageProjection do | |
| use Ecto.Migration | |
| def up do | |
| cluster_name = System.get_env("CLICKHOUSE_CLUSTER") || nil | |
| cluster_stmt = if cluster_name, do: "ON CLUSTER #{cluster_name}", else: "" | |
| execute """ | |
| ALTER TABLE core_subscriptions_events_local #{cluster_stmt} | |
| ADD PROJECTION session_usage_by_esim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def list_plan_types_paginated( | |
| search, | |
| order_by \\ "id", | |
| direction \\ "desc", | |
| limit \\ 50, | |
| cursor_after \\ nil, | |
| cursor_before \\ nil, | |
| opts \\ [] | |
| ) do | |
| from(p in PlanType, as: :plan_type) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def list_plan_types_paginated( | |
| search, | |
| order_by \\ "id", | |
| direction \\ "desc", | |
| limit \\ 50, | |
| cursor_after \\ nil, | |
| cursor_before \\ nil, | |
| opts \\ [] | |
| ) do | |
| from(p in PlanType, as: :plan_type) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH active_enforcement AS ( | |
| SELECT DISTINCT ON (en.company_id, en.store_id, en.created_at) | |
| en.id, | |
| en.company_id, | |
| en.store_id, | |
| en.enforcement_statuses_id | |
| FROM enforcements en | |
| WHERE en.enforcement_statuses_id IN (1, 2, 3, 4) | |
| ORDER BY en.company_id, en.store_id, en.created_at DESC | |
| ), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH active_enforcement AS ( | |
| SELECT DISTINCT ON (en.company_id, en.store_id, en.created_at) | |
| en.* | |
| FROM enforcements en | |
| WHERE en.enforcement_statuses_id IN (1, 2, 3, 4) | |
| ORDER BY en.created_at DESC | |
| ), | |
| active_test_purchase AS ( | |
| SELECT DISTINCT ON (tp.company_id, tp.store_id, tp.created_at) | |
| tp.* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT s0."age_id", | |
| Count(s0."id"), | |
| s0."age_bucket" | |
| FROM ( | |
| SELECT sm0."id" AS "id", | |
| CASE | |
| WHEN age < 1 THEN 1 | |
| WHEN age < 7 THEN 7 | |
| WHEN age < 31 THEN 31 | |
| ELSE NULL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT s0."age_id", | |
| Count(s0."id"), | |
| s0."age_bucket" | |
| FROM ( | |
| SELECT sm0."id" AS "id", | |
| CASE | |
| WHEN age < 1 THEN 1 | |
| WHEN age < 7 THEN 7 | |
| WHEN age < 31 THEN 31 | |
| ELSE NULL |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "attributes": { | |
| "referrals": null, | |
| "miscarriages": 19, | |
| "notes": [], | |
| "form": { | |
| "id": "9b5716fd-a0bb-47d6-bf23-68b18acc0195", | |
| "type": "medical:form" | |
| }, | |
| "room": null, |
NewerOlder