The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Alzabo::Create::Index - Index objects for schema creation

SYNOPSIS

  use Alzabo::Create::Index;

INHERITS FROM

Alzabo::Index

METHODS

new

The constructor takes the following parameters:

  • table => Alzabo::Create::Table object

    The table that this index is indexing.

  • columns => [ Alzabo::Create::Column object, .. ]

  • columns => [ { column => Alzabo::Create::Column object, prefix => $prefix }, repeat as needed ... ]

    This parameter indicates which columns that are being indexed. It can either be an array reference of column objects, or an array reference of hash references, each with a key called column and one called prefix.

    The prefix key is optional.

  • unique => $boolean

    Indicates whether or not this is a unique index.

  • fulltext => $boolean

    Indicates whether or not this is a fulltext index.

Returns a new Alzabo::Create::Index object.

Throws: Alzabo::Exception::Params, Alzabo::Exception::RDBMSRules

add_column

Adds a column to the index.

This method takes the following parameters:

  • column => Alzabo::Create::Column object

  • prefix => $prefix (optional)

Throws: Alzabo::Exception::Params, Alzabo::Exception::RDBMSRules

delete_column (Alzabo::Create::Column object)

Deletes the given column from the index.

Throws: Alzabo::Exception::Params, Alzabo::Exception::RDBMSRules

set_prefix

This method takes the following parameters:

  • column => Alzabo::Create::Column object

  • prefix => $prefix

Throws: Alzabo::Exception::Params, Alzabo::Exception::RDBMSRules

set_unique ($boolean)

Sets whether or not the index is a unique index.

set_fulltext ($boolean)

Set whether or not the index is a fulltext index.

Throws: Alzabo::Exception::Params, Alzabo::Exception::RDBMSRules

register_column_name_change

This method takes the following parameters:

  • column => Alzabo::Create::Column object

    The column (with the new name already set).

  • old_name => $old_name

This method is called by the table object which owns the index when a column name changes. You should never need to call this yourself.

Throws: Alzabo::Exception::Params

AUTHOR

Dave Rolsky, <autarch@urth.org>