Skip to content

PumModel

Bases: PumCustomBaseModel

PumModel holds some PUM specifics.

Attributes:

Name Type Description
migration_table_schema Optional[str]

Name of schema for the migration table.

minimum_version Optional[Version]

Minimum required version of PUM.

Source code in pum/config_model.py
class PumModel(PumCustomBaseModel):
    """
    PumModel holds some PUM specifics.

    Attributes:
        migration_table_schema: Name of schema for the migration table.
        minimum_version: Minimum required version of PUM.
    """

    model_config = {"arbitrary_types_allowed": True}
    migration_table_schema: Optional[str] = Field(
        default="public", description="Name of schema for the migration table"
    )

    minimum_version: Optional[packaging.version.Version] = Field(
        default=None,
        description="Minimum required version of pum.",
    )

    @model_validator(mode="before")
    def parse_minimum_version(cls, values):
        min_ver = values.get("minimum_version")
        if isinstance(min_ver, str):
            values["minimum_version"] = packaging.version.Version(min_ver)
        return values