#[cfg(test)]
mod tests {
    use dbnexus::migration::column_changes::{ColumnChange, ColumnChangeType};

    #[test]
    fn test_rename_column() {
        let change = ColumnChange::new(
            ColumnChangeType::RenameColumn,
            "users".to_string(),
            "old_name".to_string(),
            "new_name".to_string(),
        );
        assert_eq!(change.table_name, "users");
        assert_eq!(change.column_name, "old_name");
        assert_eq!(change.new_column_name, Some("new_name".to_string()));
    }

    #[test]
    fn test_modify_column() {
        let change = ColumnChange::new(
            ColumnChangeType::ModifyColumn,
            "users".to_string(),
            "age".to_string(),
            "INT".to_string(),
        );
        assert_eq!(change.change_type, ColumnChangeType::ModifyColumn);
    }

    #[test]
    fn test_with_nullable() {
        let change = ColumnChange::new(
            ColumnChangeType::NullabilityChanged,
            "users".to_string(),
            "email".to_string(),
            "".to_string(),
        )
        .with_nullable(true);
        assert_eq!(change.nullable, Some(true));
    }

    #[test]
    fn test_with_default() {
        let change = ColumnChange::new(
            ColumnChangeType::DefaultChanged,
            "users".to_string(),
            "status".to_string(),
            "".to_string(),
        )
        .with_default("active".to_string());
        assert_eq!(change.default_value, Some("active".to_string()));
    }
}
