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

NAME

Alzabo::Create::ForeignKey - Foreign key objects for schema creation.

SYNOPSIS

  use Alzabo::Create::ForeignKey;

INHERITS FROM

Alzabo::ForeignKey

METHODS

new

Parameters:

  • columns_from => Alzabo::Create::Column object(s)

  • columns_to => Alzabo::Create::Column object(s)

    These two parameters may be either a single column or a reference to an array columns. The number of columns in the two parameters must match.

  • cardinality => [1, 1], [1, 'n'], or ['n', 1]

  • from_is_dependent => $boolean

  • to_is_dependent => $boolean

Returns

A new Alzabo::Create::ForeignKey object.

set_columns_from (Alzabo::Create::Column object(s))

Set the column(s) that the relation is from. This can be either a single a column object or a reference to an array of column objects.

set_columns_to (Alzabo::Create::Column object(s))

Set the column(s) that the relation is to. This can be either a single a column object or a reference to an array of column objects.

set_cardinality (\@cardinality) see above for details

Sets the cardinality value of the relation.

set_from_is_dependent ($boolean)

Indicates whether or not the first table in the relationship is dependent on the other (i.e. whether the 'from' table is dependent on the 'to' table).

set_to_is_dependent ($boolean)

Indicates whether or not the second table in the relationship is dependent on the other (i.e. whether the 'to' table is dependent on the 'from' table).

AUTHOR

Dave Rolsky, <autarch@urth.org>