DBIx-Class-Schema-Diff

 view release on metacpan or  search on metacpan

t/lib/TestSchema/Sakila2/Result/Rental.pm  view on Meta::CPAN

  "rental_id",
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
  "rental_date",
  {
    data_type => "datetime",
    datetime_undef_if_invalid => 1,
    is_nullable => 0,
  },
  "inventory_id",
  {
    data_type => "mediumint",
    extra => { unsigned => 1 },
    is_foreign_key => 1,
    is_nullable => 0,
  },
  "customer_id",
  {
    data_type => "smallint",
    extra => { unsigned => 1 },
    is_foreign_key => 1,
    is_nullable => 0,
  },
  "return_date",
  {
    data_type => "datetime",
    datetime_undef_if_invalid => 1,
    is_nullable => 1,
  },
  "staff_id",
  {
    data_type => "tinyint",
    extra => { unsigned => 1 },
    is_foreign_key => 1,
    is_nullable => 0,
  },
  "last_update",
  {
    data_type => "timestamp",
    datetime_undef_if_invalid => 1,
    default_value => \"current_timestamp",
    is_nullable => 0,
  },
);
__PACKAGE__->set_primary_key("rental_id");
__PACKAGE__->add_unique_constraint("rental_date", ["rental_date", "inventory_id", "customer_id"]);

=head1 RELATIONS

=head2 payments

Type: has_many

Related object: L<TestSchema::Sakila2::Result::Payment>

=cut

__PACKAGE__->has_many(
  "payments",
  "TestSchema::Sakila2::Result::Payment",
  { "foreign.rental_id" => "self.rental_id" },
  { cascade_copy => 0, cascade_delete => 0 },
);

=head2 staff

Type: belongs_to

Related object: L<TestSchema::Sakila2::Result::Staff>

=cut

__PACKAGE__->belongs_to(
  "staff",
  "TestSchema::Sakila2::Result::Staff",
  { staff_id => "staff_id" },
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);

=head2 inventory

Type: belongs_to

Related object: L<TestSchema::Sakila2::Result::Inventory>

=cut

__PACKAGE__->belongs_to(
  "inventory",
  "TestSchema::Sakila2::Result::Inventory",
  { inventory_id => "inventory_id" },
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);

=head2 customer

Type: belongs_to

Related object: L<TestSchema::Sakila2::Result::Customer>

=cut

__PACKAGE__->belongs_to(
  "customer",
  "TestSchema::Sakila2::Result::Customer",
  { customer_id => "customer_id" },
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);


# Created by DBIx::Class::Schema::Loader v0.07010 @ 2013-02-17 16:15:04
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:H4r+TEHIc8Lvr4uYT+Sr/g


# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;



( run in 0.432 second using v1.01-cache-2.11-cpan-e93a5daba3e )