X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FDB%2FResult%2FSrcPkg.pm;h=acd5a0dc82f0651b9012eb92659e3ea7edf4e7b3;hb=18d62e8d681fb4d9e9e8a233f3994c30923aafce;hp=01d61f076e63079d144276c545beef4bc1c7dc59;hpb=0543095981356edd47de6a30981740c0d2d2a7ac;p=debbugs.git diff --git a/Debbugs/DB/Result/SrcPkg.pm b/Debbugs/DB/Result/SrcPkg.pm index 01d61f0..acd5a0d 100644 --- a/Debbugs/DB/Result/SrcPkg.pm +++ b/Debbugs/DB/Result/SrcPkg.pm @@ -21,11 +21,13 @@ use base 'DBIx::Class::Core'; =item * L +=item * L + =back =cut -__PACKAGE__->load_components("InflateColumn::DateTime"); +__PACKAGE__->load_components("InflateColumn::DateTime", "TimeStamp"); =head1 TABLE: C @@ -55,7 +57,7 @@ Source package name data_type: 'boolean' default_value: false - is_nullable: 1 + is_nullable: 0 =head2 alias_of @@ -65,6 +67,32 @@ Source package name Source package id which this source package is an alias of +=head2 creation + + data_type: 'timestamp with time zone' + default_value: current_timestamp + is_nullable: 0 + original: {default_value => \"now()"} + +=head2 disabled + + data_type: 'timestamp with time zone' + default_value: infinity + is_nullable: 0 + +=head2 last_modified + + data_type: 'timestamp with time zone' + default_value: current_timestamp + is_nullable: 0 + original: {default_value => \"now()"} + +=head2 obsolete + + data_type: 'boolean' + default_value: false + is_nullable: 0 + =cut __PACKAGE__->add_columns( @@ -78,9 +106,31 @@ __PACKAGE__->add_columns( "pkg", { data_type => "text", is_nullable => 0 }, "pseduopkg", - { data_type => "boolean", default_value => \"false", is_nullable => 1 }, + { data_type => "boolean", default_value => \"false", is_nullable => 0 }, "alias_of", { data_type => "integer", is_foreign_key => 1, is_nullable => 1 }, + "creation", + { + data_type => "timestamp with time zone", + default_value => \"current_timestamp", + is_nullable => 0, + original => { default_value => \"now()" }, + }, + "disabled", + { + data_type => "timestamp with time zone", + default_value => "infinity", + is_nullable => 0, + }, + "last_modified", + { + data_type => "timestamp with time zone", + default_value => \"current_timestamp", + is_nullable => 0, + original => { default_value => \"now()" }, + }, + "obsolete", + { data_type => "boolean", default_value => \"false", is_nullable => 0 }, ); =head1 PRIMARY KEY @@ -97,17 +147,19 @@ __PACKAGE__->set_primary_key("id"); =head1 UNIQUE CONSTRAINTS -=head2 C +=head2 C =over 4 =item * L +=item * L + =back =cut -__PACKAGE__->add_unique_constraint("src_pkg_pkg_key", ["pkg"]); +__PACKAGE__->add_unique_constraint("src_pkg_pkg_disabled", ["pkg", "disabled"]); =head1 RELATIONS @@ -124,13 +176,43 @@ __PACKAGE__->belongs_to( "Debbugs::DB::Result::SrcPkg", { id => "alias_of" }, { - is_deferrable => 1, + is_deferrable => 0, join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE", }, ); +=head2 bin_pkg_src_pkgs + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "bin_pkg_src_pkgs", + "Debbugs::DB::Result::BinPkgSrcPkg", + { "foreign.src_pkg" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + +=head2 bug_affects_srcpackages + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "bug_affects_srcpackages", + "Debbugs::DB::Result::BugAffectsSrcpackage", + { "foreign.src_pkg" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + =head2 bug_srcpackages Type: has_many @@ -142,7 +224,7 @@ Related object: L __PACKAGE__->has_many( "bug_srcpackages", "Debbugs::DB::Result::BugSrcpackage", - { "foreign.src_pkg_id" => "self.id" }, + { "foreign.src_pkg" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -157,7 +239,7 @@ Related object: L __PACKAGE__->has_many( "bug_vers", "Debbugs::DB::Result::BugVer", - { "foreign.src_pkg_id" => "self.id" }, + { "foreign.src_pkg" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); @@ -187,14 +269,19 @@ Related object: L __PACKAGE__->has_many( "src_vers", "Debbugs::DB::Result::SrcVer", - { "foreign.src_pkg_id" => "self.id" }, + { "foreign.src_pkg" => "self.id" }, { cascade_copy => 0, cascade_delete => 0 }, ); -# Created by DBIx::Class::Schema::Loader v0.07025 @ 2012-12-03 15:57:07 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:zKfk7AmIYswUAYKBbBGQaQ +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2019-01-01 17:29:32 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yiCFtO7j409+ZPBejeWitQ -# You can replace this text with custom code or comments, and it will be preserved on regeneration +sub sqlt_deploy_hook { + my ($self, $sqlt_table) = @_; + $sqlt_table->add_index(name => 'src_pkg_pkg', + fields => 'pkg', + ); +} 1;