DBIx-Class-EasyFixture
view release on metacpan or search on metacpan
t/lib/Sample/Schema/Result/Customer.pm view on Meta::CPAN
data_type: 'integer'
is_foreign_key: 1
is_nullable: 0
=head2 first_purchase
data_type: 'datetime'
is_nullable: 0
=cut
__PACKAGE__->add_columns(
"customer_id",
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"person_id",
{ data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
"first_purchase",
{ data_type => "datetime", is_nullable => 0 },
);
=head1 PRIMARY KEY
=over 4
=item * L</customer_id>
=back
=cut
__PACKAGE__->set_primary_key("customer_id");
=head1 UNIQUE CONSTRAINTS
=head2 C<person_id_unique>
=over 4
=item * L</person_id>
=back
=cut
__PACKAGE__->add_unique_constraint("person_id_unique", ["person_id"]);
=head1 RELATIONS
=head2 orders
Type: has_many
Related object: L<Sample::Schema::Result::Order>
=cut
__PACKAGE__->has_many(
"orders",
"Sample::Schema::Result::Order",
{ "foreign.customer_id" => "self.customer_id" },
{ cascade_copy => 0, cascade_delete => 0 },
);
=head2 person
Type: belongs_to
Related object: L<Sample::Schema::Result::Person>
=cut
__PACKAGE__->belongs_to(
"person",
"Sample::Schema::Result::Person",
{ person_id => "person_id" },
{ is_deferrable => 0, on_delete => "NO ACTION", on_update => "NO ACTION" },
);
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-02-13 13:30:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wNacrNooUc4dy8uzG9LjcQ
# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;
( run in 0.579 second using v1.01-cache-2.11-cpan-39bf76dae61 )