NAME

DBIO::PostgreSQL::Diff::Type - Diff operations for PostgreSQL types (enums, composites, ranges)

VERSION

version 0.900000

DESCRIPTION

Represents a type-level diff operation: CREATE TYPE, DROP TYPE CASCADE, or ALTER TYPE ... ADD VALUE (for enum value additions). Handles enum, composite, and range types. Note that enum value removal is not supported by PostgreSQL -- only addition is possible without recreating the type.

ATTRIBUTES

type_key

The schema.type_name key.

type_key

The schema.type_name key.

type_info

Type metadata hashref from introspection (type_kind, values, attributes, or subtype depending on kind).

METHODS

diff

my @ops = DBIO::PostgreSQL::Diff::Type->diff($source, $target);

Compares two type hashrefs. Produces create operations for new types, drop for removed types, and add_value for enum types that have gained new values.

as_sql

Returns the SQL for this operation. For add_value, returns one ALTER TYPE ... ADD VALUE statement per new enum value.

summary

Returns a one-line description such as +type: auth.role_type (enum) or ~type auth.role_type: +1 value(s) (superadmin).

AUTHOR

DBIO & DBIx::Class Authors

COPYRIGHT AND LICENSE

Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.