NAME

DBIO::PostgreSQL::Diff::Index - Diff operations for PostgreSQL indexes

VERSION

version 0.900000

DESCRIPTION

Represents an index-level diff operation: CREATE INDEX or DROP INDEX. When an index definition changes, it generates a DROP followed by a CREATE. The full definition string from pg_get_indexdef is used for comparison, so partial indexes, expression indexes, and storage parameters are all detected correctly.

ATTRIBUTES

table_key

The schema.table key for the table this index belongs to.

index_name

The index name.

index_info

Index metadata hashref (definition, access_method, columns, etc.).

METHODS

diff

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

Compares index sets across all tables. Index identity is by name; definition changes produce a drop-then-create pair.

as_sql

Returns the SQL for this operation. For create, uses the full pg_get_indexdef definition string when available, otherwise generates a basic CREATE INDEX statement. For drop, returns DROP INDEX name;.

summary

Returns a one-line description such as +index: idx_users_tags (on auth.users).

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.