X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FDB%2FResult%2FCorrespondentFullName.pm;fp=Debbugs%2FDB%2FResult%2FCorrespondentFullName.pm;h=a5be28391424693094157a86ad4076eb594485d5;hb=53c435119200ab9b1c2538a96b8374c51a078855;hp=0000000000000000000000000000000000000000;hpb=0e8f07fda6e40b5967d9c6b28b3200db22766343;p=debbugs.git diff --git a/Debbugs/DB/Result/CorrespondentFullName.pm b/Debbugs/DB/Result/CorrespondentFullName.pm new file mode 100644 index 0000000..a5be283 --- /dev/null +++ b/Debbugs/DB/Result/CorrespondentFullName.pm @@ -0,0 +1,126 @@ +use utf8; +package Debbugs::DB::Result::CorrespondentFullName; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Debbugs::DB::Result::CorrespondentFullName - Full names of BTS correspondents + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 COMPONENTS LOADED + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->load_components("InflateColumn::DateTime", "TimeStamp"); + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("correspondent_full_name"); + +=head1 ACCESSORS + +=head2 correspondent + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +Correspondent ID (matches correspondent) + +=head2 full_name + + data_type: 'text' + is_nullable: 0 + +Correspondent full name (includes e-mail address) + +=head2 last_seen + + data_type: 'timestamp' + default_value: current_timestamp + is_nullable: 0 + original: {default_value => \"now()"} + +=cut + +__PACKAGE__->add_columns( + "correspondent", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "full_name", + { data_type => "text", is_nullable => 0 }, + "last_seen", + { + data_type => "timestamp", + default_value => \"current_timestamp", + is_nullable => 0, + original => { default_value => \"now()" }, + }, +); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint( + "correspondent_full_name_correspondent_full_name_idx", + ["correspondent", "full_name"], +); + +=head1 RELATIONS + +=head2 correspondent + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "correspondent", + "Debbugs::DB::Result::Correspondent", + { id => "correspondent" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-03-04 10:59:03 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2Ac8mrDV2IsE/11YsYoqQQ + +sub sqlt_deploy_hook { + my ($self, $sqlt_table) = @_; + for my $idx (qw(full_name last_seen)) { + $sqlt_table->add_index(name => 'correspondent_full_name_idx_'.$idx, + fields => [$idx]); + } +} + +1;