NAME
DBIO::Informix::Diff::Column - Diff operations for Informix columns
VERSION
version 0.900007
DESCRIPTION
Represents a column-level diff operation in Informix: ALTER TABLE ADD (...), ALTER TABLE ... DROP (col), or ALTER TABLE ... MODIFY (...) when a column's type, nullability, or default changes between source and target.
METHODS
diff
my @ops = DBIO::Informix::Diff::Column->diff(
$source_columns, $target_columns,
$source_tables, $target_tables,
);
Compares two column hashrefs (keyed by table name) and returns add ops for columns present only in target, drop ops for columns only in source, only for tables present in both (a created table is created whole, a dropped one dropped whole), and alter ops for columns present in both whose definition (data type, nullability, or default) differs. Change detection delegates to "changed_column_fields" in DBIO::Diff::Compare.
as_sql
Returns the SQL for this operation. add emits ALTER TABLE t ADD (col type ...) (Informix has no COLUMN keyword there; live unmeasured), drop emits ALTER TABLE t DROP (col) (Informix has no DROP COLUMN; the DROP clause takes a column or a parenthesized list, HCL OneDB/Informix SQL Syntax, ALTER TABLE, ids_sqs_0086; live unmeasured), and alter emits ALTER TABLE ... MODIFY (...) with the new column definition.
lossy
True for an alter that may alter or lose stored values, so a deploy runs it only with allow_destructive => 1 ("apply" in DBIO::Deploy::Base, ADR 0080). The answer is "column_change_lossy" in DBIO::Diff::Compare: a change of the type is lossless only for a pair of integer types of the table below, measured on Informix 15.0.1 (ALTER TABLE ... MODIFY over rows at the limits of the source type, every value read back unchanged); the same type with a size at least as big is lossless as well. Everything else, a narrowing and a change between kinds of type included, is lossy. A change of NOT NULL or of the default alone keeps every value and is not lossy; an add or drop is not a change of a column (a drop is a destructive operation of its own).
smallint -> integer, int8, bigint
integer -> int8, bigint
int8 -> bigint
bigint -> int8
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.