NAME

DBIO::PostgreSQL::Diff::Column - Diff operations for PostgreSQL columns

VERSION

version 0.900000

DESCRIPTION

Represents a column-level diff operation: ADD COLUMN, DROP COLUMN, or ALTER COLUMN (type change, nullability change, or default change). Only columns on tables that exist in both source and target are compared.

ATTRIBUTES

table_key

The schema.table key identifying which table the column belongs to.

column_name

The column name.

old_info

The source column metadata hashref (present for drop and alter).

new_info

The target column metadata hashref (present for add and alter).

METHODS

diff

my @ops = DBIO::PostgreSQL::Diff::Column->diff(
    $source_cols, $target_cols, $source_tables, $target_tables,
);

Compares column lists for tables that exist in both source and target. Detects added columns, dropped columns, and altered columns (data type, NOT NULL, default value, or identity kind).

as_sql

Returns one or more ALTER TABLE statements for this operation. For alter, may return multiple statements (one per changed attribute).

summary

Returns a one-line description such as +column: auth.users.avatar (text).

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.