PhoenixKitOG.Schemas.Assignment (PhoenixKitOG v0.3.7)

Copy Markdown View Source

Binds a template to a scope inside a consumer module's hierarchy.

module_key is the consumer's PhoenixKit.Module.module_key/0 (e.g. "publishing"). scope_type is the consumer-defined tier ("default", "group", "post"). scope_uuid is the row uuid at that tier, or nil for the module-wide "default" tier.

Uniqueness is enforced at the DB level via a partial index pair:

(module_key, scope_type) WHERE scope_uuid IS NULL
(module_key, scope_type, scope_uuid) WHERE scope_uuid IS NOT NULL

(See core migration V154.)

Summary

Functions

character varying column widths for phoenix_kit_og_assignments, keyed by field name.

Types

t()

@type t() :: %PhoenixKitOG.Schemas.Assignment{
  __meta__: term(),
  inserted_at: DateTime.t() | nil,
  module_key: String.t() | nil,
  scope_type: String.t() | nil,
  scope_uuid: binary() | nil,
  slot_mapping: map(),
  template:
    PhoenixKitOG.Schemas.Template.t() | Ecto.Association.NotLoaded.t() | nil,
  template_uuid: binary() | nil,
  updated_at: DateTime.t() | nil,
  uuid: binary() | nil
}

Functions

column_widths()

@spec column_widths() :: %{required(atom()) => pos_integer()}

character varying column widths for phoenix_kit_og_assignments, keyed by field name.

The single source of truth PhoenixKitOG.Migrations' V1 DDL interpolates, so the migration chain and core's ExpectedSchema manifest can never independently disagree on a number.