GoodAnalytics.Flows.CreatePartitions (GoodAnalytics v0.1.1)

Copy Markdown View Source

pgflow Flow that creates monthly partitions for ga_events.

Ensures partitions exist for the current month and 2 months ahead. Can be triggered on demand or scheduled via cron.

Usage

Add this flow to your PgFlow configuration:

{PgFlow,
 repo: MyApp.Repo,
 flows: [GoodAnalytics.Flows.CreatePartitions]}

Then generate and run the flow migration:

mix pgflow.gen.flow GoodAnalytics.Flows.CreatePartitions
mix ecto.migrate

To trigger manually:

PgFlow.start_flow(GoodAnalytics.Flows.CreatePartitions, %{})

Summary

Functions

Returns the cron expression, or nil if not scheduled.

Returns the static cron input map.

Returns the flow definition struct.

Pattern-matched handler function for each step.

Returns the flow slug.

Returns the raw step definitions.

Functions

__pgflow_cron_expression__()

Returns the cron expression, or nil if not scheduled.

__pgflow_cron_input__()

Returns the static cron input map.

__pgflow_definition__()

Returns the flow definition struct.

__pgflow_handler__(slug)

Pattern-matched handler function for each step.

__pgflow_slug__()

Returns the flow slug.

__pgflow_steps__()

Returns the raw step definitions.