NAME

DBIO::MySQL::Diff::Index - Diff operations for MySQL/MariaDB indexes

VERSION

version 0.900001

DESCRIPTION

Represents an index-level diff operation: CREATE INDEX or DROP INDEX. Auto-generated indexes (PRIMARY KEY and UNIQUE constraint indexes from inline column definitions) are skipped -- they belong to the table itself.

METHODS

diff

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

The optional $source_tables / $target_tables hashrefs are the tables sections of the two models (threaded in by DBIO::MySQL::Diff, the same way it already threads them into Diff::Column / Diff::ForeignKey). They are used to detect tables that are being dropped in this same diff pass: DROP TABLE already removes that table's own indexes, so emitting a later standalone DROP INDEX ... ON <table> for one of them would fail against the server (the ON <table> target no longer exists), aborting the deploy (karr #23). When these arguments are absent (e.g. direct unit-test calls) the set is empty and no drops are suppressed, preserving the original two-argument behaviour.

as_sql

summary

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.