Alzabo (version 0.64) - Alzabo::Create::ColumnDefinition

Index



NAME

Alzabo::Create::ColumnDefinition - Column definition object for schema creation


SYNOPSIS

  use Alzabo::Create::ColumnDefinition;


DESCRIPTION

This object holds information on a column that might need to be shared with another column. The reason this class exists is that if a column is a key in two or more tables, then some of the information related to that column should change automatically in multiple places whenever it changes at all. Right now this is only type ('VARCHAR', 'NUMBER', etc) information. This object also has an 'owner', which is the column which created it.


INHERITS FROM

Alzabo::ColumnDefinition

Note: all relevant documentation from the superclass has been merged into this document.


METHODS

new

Parameters

Returns

A new Alzabo::Create::ColumnDefinition object.

alter

This method allows you to change a column's type, length, and precision as a single operation and should be instead of calling set_type followed by set_length.

Parameters

type

Returns

The object's type as a string.

set_type ($string)

Sets the object's type.

length

Returns

The length attribute of the column, or undef if there is none.

precision

Returns

The precision attribute of the column, or undef if there is none.

set_length

Parameters

Sets the column's length and precision. The precision parameter is optional (though some column types may require it if the length is set).

owner

Returns

The Alzabo::Create::Column object that owns this definitions (the column that created it).