Take me over?
NAME
Alzabo::Create::Table - Table objects for schema creation
SYNOPSIS
use Alzabo::Create::Table;
DESCRIPTION
This class represents tables in the schema. It contains column, index, and foreign key objects.
INHERITS FROM
Alzabo::Table
METHODS
new
Parameters
schema =>
Alzabo::Create::SchemaobjectThe schema to which this table belongs.
name => $name
comment => $comment
An optional comment.
Returns
A new Alzabo::Create::Table object.
Throws
set_name ($name)
Changes the name of the table.
make_column
Creates a new Alzabo::Create::Column object and adds it to the table. This object is the function's return value.
In addition, if the before or after parameter is given, the move_column method is called to move the new column.
This method takes all of the same parameters as the Alzabo::Create::Column method except the table parameter, which is automatically added.
Additional Parameters
primary_key => 0 or 1
If this value is true, then the
add_primary_keymethod will be called after this new column is made in order to make a it a primary key for the table.after =>
Alzabo::Create::Columnobject... or ...
before =>
Alzabo::Create::Columnobject
Returns
A new Alzabo::Create::Column object.
add_column
Adds a column to the table. If a before or after parameter is given then the move_column method will be called to move the new column to the appropriate position.
Parameters
column =>
Alzabo::Create::Columnobjectafter =>
Alzabo::Create::Columnobject (optional)... or ...
before =>
Alzabo::Create::Columnobject (optional)
Throws
delete_column (Alzabo::Create::Column object)
Deletes a column from the table.
Throws
move_column
Parameters
column =>
Alzabo::Create::ColumnobjectThe column to move.
and either ...
before =>
Alzabo::Create::ColumnobjectMove the column before this column
... or ...
after =>
Alzabo::Create::ColumnobjectMove the column after this column.
Throws
add_primary_key (Alzabo::Create::Column object)
Make the given column part of the table's primary key. The primary key is an ordered list of columns. The given column will be added to the end of this list.
Throws
delete_primary_key (Alzabo::Create::Column object)
Delete the given column from the primary key.
Throws
make_foreign_key (see below)
Takes the same parameters as the Alzabo::Create::ForeignKey->new method except for the table parameter, which is automatically added. The foreign key object that is created is then added to the table.
returns
A new Alzabo::Create::ForeignKey object.
add_foreign_key (Alzabo::Create::ForeignKey object)
Adds the given foreign key to the table.
delete_foreign_key (Alzabo::Create::ForeignKey object)
Deletes the given foreign key from the table
Throws
make_index
Takes the same parameters as the Alzabo::Create::Index->new method except for the table parameter, which is automatically added. The index object that is created is then added to the table.
Returns
A new Alzabo::Create::Index object.
add_index (Alzabo::Create::Index object)
Adds the given index to the table.
Throws
delete_index (Alzabo::Create::Index object)
Deletes an index from the table.
Throws
set_comment ($comment)
Set the comment for the table object.
AUTHOR
Dave Rolsky, <autarch@urth.org>