PhoenixKit.Modules.Legal.Migrations.ConsentLogs (PhoenixKitLegal v0.1.5)

Copy Markdown View Source

Consolidated migration for the Legal module.

Creates the phoenix_kit_consent_logs table. All statements use IF NOT EXISTS guards — safe to run multiple times.

Implements the versioned-migration protocol expected by PhoenixKit Core (mix phoenix_kit.update): current_version/0 and migrated_version_runtime/1. Reference implementation — PhoenixKit.Migrations.Postgres in Core.

Summary

Functions

Target schema version of the Legal module.

Rolls back the Legal module migration.

Currently applied schema version, read from the database.

Applies the Legal module migration.

Functions

current_version()

Target schema version of the Legal module.

down(opts \\ [])

Rolls back the Legal module migration.

Accepts a keyword list (the form Core passes) or a map, for backward compatibility.

migrated_version_runtime(opts \\ [])

Currently applied schema version, read from the database.

Returns 0 when the phoenix_kit_consent_logs table does not yet exist, and 1 once it has been created. opts is a keyword list with an optional :prefix.

up(opts \\ [])

Applies the Legal module migration.

Accepts a keyword list (the form Core passes) or a map, for backward compatibility.