NAME

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

VERSION

version 0.900000

DESCRIPTION

Represents a column-level diff operation in SQLite. Only ADD COLUMN is supported as a true ALTER -- SQLite has very limited ALTER TABLE: since 3.25 it can rename columns and since 3.35 it can drop columns, but type changes still require the create-new-table-and-copy dance.

For now this module emits:

  • ALTER TABLE ... ADD COLUMN ... for added columns

  • ALTER TABLE ... DROP COLUMN ... for dropped columns (3.35+)

  • A descriptive comment for type / nullability changes -- a true in-place ALTER is impossible. When the target table's original CREATE statement is known, DBIO::SQLite::Diff hoists such a column into a whole-table DBIO::SQLite::Diff::Rebuild instead, and this comment is never emitted; it only stands as a fallback when no captured DDL is available (the compiled-model path).

Brand-new tables get their columns inline via DBIO::SQLite::Diff::Table -- this module only sees columns of tables that exist in both source and target.

METHODS

diff

my @ops = DBIO::SQLite::Diff::Column->diff(
    $source_columns, $target_columns,
    $source_tables,  $target_tables,
);

Compares column lists for tables that exist in both source and target.

as_sql

Returns the ALTER TABLE statement for this operation, or a comment for unsupported alterations.

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.