PhoenixKitDocumentCreator. Migrations. Schema
(PhoenixKitDocumentCreator v0.5.0)
Copy Markdown
View Source
Module-owned versioned migrations for phoenix_kit_document_creator —
the decentralized-migrations protocol core's mix phoenix_kit.update
discovers via migration_module/0 (current_version/0 +
migrated_version_runtime/1 + idempotent up/1 + version-aware
down/1). Adopted per the workspace direction of moving module tables
out of the core chain (phoenix_kit_projects is the reference
implementation; the doc TABLES themselves remain core-created — V86 +
V94 — this chain only ITERATES on them).
Versions:
- V1 —
phoenix_kit_doc_documents.project_uuid(nullable FK →phoenix_kit_projects, ON DELETE SET NULL): real per-project document linkage for the projects hub's Documents tab. The FK target is core-created (V101), present on every current install.
The migrated version is tracked as a dcr_schema:<N> COMMENT on
phoenix_kit_doc_documents (the marker convention from the projects
chain, namespaced). A marker-less table reads as version 0 — the core
baseline shape before this chain existed.
Summary
Functions
Rolls back to target (version-aware; 0 removes everything this chain added).
The chain version currently applied in the database, read OUTSIDE a
migration (the protocol shape core's update task calls — opts with
:prefix): the dcr_schema:<N> marker when present; a marker-less or
foreign-comment table reads as 0 (core-baseline shape — unlike the
projects chain there is no pre-chain content to defend, V1 is purely
additive).
Applies every chain version up to current_version/0 (idempotent).
Functions
@spec current_version() :: pos_integer()
Rolls back to target (version-aware; 0 removes everything this chain added).
The chain version currently applied in the database, read OUTSIDE a
migration (the protocol shape core's update task calls — opts with
:prefix): the dcr_schema:<N> marker when present; a marker-less or
foreign-comment table reads as 0 (core-baseline shape — unlike the
projects chain there is no pre-chain content to defend, V1 is purely
additive).
Applies every chain version up to current_version/0 (idempotent).