X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FDB%2FResult%2FBinVer.pm;fp=Debbugs%2FDB%2FResult%2FBinVer.pm;h=30be6c2411d7827822b700411ad4be0d4cd3dc64;hb=53c435119200ab9b1c2538a96b8374c51a078855;hp=0000000000000000000000000000000000000000;hpb=0e8f07fda6e40b5967d9c6b28b3200db22766343;p=debbugs.git diff --git a/Debbugs/DB/Result/BinVer.pm b/Debbugs/DB/Result/BinVer.pm new file mode 100644 index 0000000..30be6c2 --- /dev/null +++ b/Debbugs/DB/Result/BinVer.pm @@ -0,0 +1,208 @@ +use utf8; +package Debbugs::DB::Result::BinVer; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Debbugs::DB::Result::BinVer - Binary versions + +=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("bin_ver"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + sequence: 'bin_ver_id_seq' + +Binary version id + +=head2 bin_pkg + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +Binary package id (matches bin_pkg) + +=head2 src_ver + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +Source version (matchines src_ver) + +=head2 arch + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +Architecture id (matches arch) + +=head2 ver + + data_type: 'debversion' + is_nullable: 0 + +Binary version + +=cut + +__PACKAGE__->add_columns( + "id", + { + data_type => "integer", + is_auto_increment => 1, + is_nullable => 0, + sequence => "bin_ver_id_seq", + }, + "bin_pkg", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "src_ver", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "arch", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "ver", + { data_type => "debversion", is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("bin_ver_bin_pkg_id_arch_idx", ["bin_pkg", "arch", "ver"]); + +=head1 RELATIONS + +=head2 arch + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "arch", + "Debbugs::DB::Result::Arch", + { id => "arch" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 bin_associations + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "bin_associations", + "Debbugs::DB::Result::BinAssociation", + { "foreign.bin" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 bin_pkg + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "bin_pkg", + "Debbugs::DB::Result::BinPkg", + { id => "bin_pkg" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" }, +); + +=head2 src_ver + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "src_ver", + "Debbugs::DB::Result::SrcVer", + { id => "src_ver" }, + { is_deferrable => 0, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07045 @ 2016-11-24 09:08:27 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DzTzZbPkilT8WMhXoZv9xw + + +sub sqlt_deploy_hook { + my ($self, $sqlt_table) = @_; + for my $idx (qw(ver bin_pkg src_ver)) { + $sqlt_table->add_index(name => 'bin_ver_'.$idx.'_id_idx', + fields => [$idx]); + } + $sqlt_table->add_index(name => 'bin_ver_src_ver_id_arch_idx', + fields => [qw(src_ver arch)] + ); +} + +1;