pgc-db/lib/Book/Schema/Result/Author.pm

126 lines
2.1 KiB
Perl

use utf8;
package Book::Schema::Result::Author;
# Created by DBIx::Class::Schema::Loader
# DO NOT MODIFY THE FIRST PART OF THIS FILE
=head1 NAME
Book::Schema::Result::Author
=cut
use strict;
use warnings;
use base 'DBIx::Class::Core';
=head1 COMPONENTS LOADED
=over 4
=item * L<DBIx::Class::InflateColumn::DateTime>
=back
=cut
__PACKAGE__->load_components("InflateColumn::DateTime");
=head1 TABLE: C<author>
=cut
__PACKAGE__->table("author");
=head1 ACCESSORS
=head2 id
data_type: 'integer'
is_nullable: 0
=head2 when_created
data_type: 'timestamp with time zone'
default_value: current_timestamp
is_nullable: 0
=head2 name
data_type: 'varchar'
is_nullable: 0
size: 128
=cut
__PACKAGE__->add_columns(
"id",
{ data_type => "integer", is_nullable => 0 },
"when_created",
{
data_type => "timestamp with time zone",
default_value => \"current_timestamp",
is_nullable => 0,
},
"name",
{ data_type => "varchar", is_nullable => 0, size => 128 },
);
=head1 PRIMARY KEY
=over 4
=item * L</id>
=back
=cut
__PACKAGE__->set_primary_key("id");
=head1 UNIQUE CONSTRAINTS
=head2 C<author_name_unique>
=over 4
=item * L</name>
=back
=cut
__PACKAGE__->add_unique_constraint("author_name_unique", ["name"]);
=head1 RELATIONS
=head2 books
Type: has_many
Related object: L<Book::Schema::Result::Book>
=cut
__PACKAGE__->has_many(
"books",
"Book::Schema::Result::Book",
{ "foreign.author_id" => "self.id" },
{ cascade_copy => 0, cascade_delete => 0 },
);
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-10-13 19:14:12
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:vwoWLTIl4qS7hd6gY1VPqw
# These lines were loaded from '/home/nick/.local/lib/perl5/Book/Schema/Result/Author.pm' found in @INC.
# They are now part of the custom portion of this file
# for you to hand-edit. If you do not either delete
# this section or remove that file from @INC, this section
# will be repeated redundantly when you re-create this
# file again via Loader! See skip_load_external to disable
# this feature.
# You can replace this text with custom code or comments, and it will be preserved on regeneration
1;