Skip to content

Migration script function signatures — Go templates + sprig #27

@AlbinoGeek

Description

@AlbinoGeek

Context

Schema DDL for schema_versions, schema_tables, and schema_tables_join approved in #25.

Migration scripts (both schema_migration_script and record_migration_script fields on schema_versions) will be implemented using Go templates + sprig (confirmed in #25).

Phase 1 — Stub function signatures

Design and document the function signatures exposed to migration templates. Topics to cover:

  • What functions are available inside a schema_migration_script template (DDL mutations, table rename, index management)
  • What functions are available inside a record_migration_script template (record read, transform, write, reject)
  • How the template context (.) is structured for each script type (input schema_tables row, source records, destination table_id, etc.)
  • Any sprig extensions planned for use (string manipulation, type coercion, etc.)
  • Error handling contract (what happens when a record migration script rejects a record)

Phase 2 — Implementation

Implementation of the above signatures in the migration runner. Tracked separately after Phase 1 sign-off.

Pending

  • Phase 1: agree on function signatures and template context shape
  • Phase 2: implement

— Bastion

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions