]> git.donarmstrong.com Git - debbugs.git/commitdiff
Update DB Schema version to 6
authorDon Armstrong <don@donarmstrong.com>
Fri, 14 Apr 2017 16:11:26 +0000 (09:11 -0700)
committerDon Armstrong <don@donarmstrong.com>
Fri, 14 Apr 2017 16:11:26 +0000 (09:11 -0700)
 + Add all of the missing indexes to sqlt_deploy_hooks
 + Remake bug_package view to include affects
 + dd missing asof index on bug_status_cache

20 files changed:
Debbugs/DB.pm
Debbugs/DB/Result/BinVer.pm
Debbugs/DB/Result/Bug.pm
Debbugs/DB/Result/BugBinpackage.pm
Debbugs/DB/Result/BugBlock.pm
Debbugs/DB/Result/BugMerged.pm
Debbugs/DB/Result/BugMessage.pm
Debbugs/DB/Result/BugPackage.pm
Debbugs/DB/Result/BugSrcpackage.pm
Debbugs/DB/Result/BugTag.pm
Debbugs/DB/Result/BugUserTag.pm
Debbugs/DB/Result/BugVer.pm
Debbugs/DB/Result/CorrespondentFullName.pm
Debbugs/DB/Result/Maintainer.pm
Debbugs/DB/Result/Message.pm
Debbugs/DB/Result/MessageRef.pm
Debbugs/DB/Result/Severity.pm
Debbugs/DB/Result/SrcPkg.pm
Debbugs/DB/Result/UserTag.pm
sql/debbugs_schema.sql

index 656ff00ca581fe44097d0d9299439ba805e46eb2..29abb21efac8f6ee686f2e3ea26c831bfcd8185a 100644 (file)
@@ -17,7 +17,7 @@ __PACKAGE__->load_namespaces;
 
 # This version must be incremented any time the schema changes so that
 # DBIx::Class::DeploymentHandler can do its work
-our $VERSION=5;
+our $VERSION=6;
 
 # You can replace this text with custom code or comments, and it will be preserved on regeneration
 
index df90ebfbe24305a8096ebffe8c212ea0c31b8bee..5c113da0e43387c320e38424037ec0d354027d15 100644 (file)
@@ -194,5 +194,15 @@ __PACKAGE__->belongs_to(
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:DzTzZbPkilT8WMhXoZv9xw
 
 
-# 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) = @_;
+    for my $idx (qw(var 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;
index d6e0f3d6e9cdb30910b5913b1a2b9a695be501ae..1cb210de8c667bc301d6e84e72210d76d2c879f7 100644 (file)
@@ -526,6 +526,24 @@ __PACKAGE__->many_to_many(affects_binpackages => 'bug_affects_binpackages','bin_
 __PACKAGE__->many_to_many(affects_srcpackages => 'bug_affects_srcpackages','src_pkg');
 __PACKAGE__->many_to_many(messages => 'bug_messages','message');
 
+sub sqlt_deploy_hook {
+    my ($self, $sqlt_table) = @_;
+    # CREATE INDEX bug_idx_owner ON bug(owner);
+    # CREATE INDEX bug_idx_submitter ON bug(submitter);
+    # CREATE INDEX bug_idx_done ON bug(done);
+    # CREATE INDEX bug_idx_forwarded ON bug(forwarded);
+    # CREATE INDEX bug_idx_last_modified ON bug(last_modified);
+    # CREATE INDEX bug_idx_severity ON bug(severity);
+    # CREATE INDEX bug_idx_creation ON bug(creation);
+    # CREATE INDEX bug_idx_log_modified ON bug(log_modified);
+    for my $idx (qw(owner submitter done forwarded last_modified),
+                qw(severity creation log_modified),
+               ) {
+       $sqlt_table->add_index(name => 'bug_idx'.$idx,
+                              fields => [$idx]);
+    }
+}
+
 sub set_related_packages {
     my ($self,$relationship,$pkgs,$pkg_cache) = @_;
 
index 869ce26d81913c16b05a4903fa3bf176adf55a93..d57299494a925efdbd25a5fe46be0a00c957fec1 100644 (file)
@@ -115,5 +115,11 @@ __PACKAGE__->belongs_to(
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wL+pwSCfWe/mMQOjziKSeg
 
 
-# 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 => 'bug_binpackage_bin_pkg_idx',
+                          fields => [qw(bin_pkg)],
+                         );
+}
+
 1;
index 467ab6846db7496e4e3a13c40ea869368083096b..0200a313657d0fe0c4996ddf8960039aa9c91f8a 100644 (file)
@@ -141,5 +141,12 @@ __PACKAGE__->belongs_to(
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Rkt0XlA4r2YFX0KnUZmS6A
 
 
-# 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) = @_;
+    for my $idx (qw(bug blocks)) {
+       $sqlt_table->add_index(name => 'bug_blocks_'.$idx.'_idx',
+                              fields => [$idx]);
+    }
+}
+
 1;
index 405b44823ac5b715b8c0d18386e6be04fb71200b..477919bc30b6ae809103afcf0b04085fa1b01021 100644 (file)
@@ -140,6 +140,12 @@ __PACKAGE__->belongs_to(
 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-11-30 21:56:51
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HdGeCb1Fh2cU08+TTQVi/Q
 
+sub sqlt_deploy_hook {
+    my ($self, $sqlt_table) = @_;
+    for my $idx (qw(bug merged)) {
+       $sqlt_table->add_index(name => 'bug_merged_'.$idx.'_idx',
+                              fields => [$idx]);
+    }
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;
index cf5b193a1bd12f4d75424c9db2a426594ca604fd..b5fccc558984ef1c1f641dbbfdadaa0bccee1e8e 100644 (file)
@@ -141,6 +141,10 @@ __PACKAGE__->belongs_to(
 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-03-04 10:59:03
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:BRbN9C6P/wvWWmSmjNGjLA
 
-
-# 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 => 'bug_message_idx_bug_message_number',
+                          fields => [qw(bug message_number)],
+                         );
+}
 1;
index 9019fcae9c727d7e350f0646946d5656665f5486..db6f2005595dc8f76fed552dd8ada6c243089156 100644 (file)
@@ -35,7 +35,7 @@ __PACKAGE__->table_class("DBIx::Class::ResultSource::View");
 =cut
 
 __PACKAGE__->table("bug_package");
-__PACKAGE__->result_source_instance->view_definition(" SELECT b.bug,\n    b.bin_pkg AS pkg_id,\n    'binary'::text AS pkg_type,\n    bp.pkg AS package\n   FROM (bug_binpackage b\n     JOIN bin_pkg bp ON ((bp.id = b.bin_pkg)))\nUNION\n SELECT s.bug,\n    s.src_pkg AS pkg_id,\n    'source'::text AS pkg_type,\n    sp.pkg AS package\n   FROM (bug_srcpackage s\n     JOIN src_pkg sp ON ((sp.id = s.src_pkg)))");
+__PACKAGE__->result_source_instance->view_definition(" SELECT b.bug,\n    b.bin_pkg AS pkg_id,\n    'binary'::text AS pkg_type,\n    bp.pkg AS package\n   FROM (bug_binpackage b\n     JOIN bin_pkg bp ON ((bp.id = b.bin_pkg)))\nUNION\n SELECT s.bug,\n    s.src_pkg AS pkg_id,\n    'source'::text AS pkg_type,\n    sp.pkg AS package\n   FROM (bug_srcpackage s\n     JOIN src_pkg sp ON ((sp.id = s.src_pkg)))\nUNION\n SELECT b.bug,\n    b.bin_pkg AS pkg_id,\n    'binary_affects'::text AS pkg_type,\n    bp.pkg AS package\n   FROM (bug_affects_binpackage b\n     JOIN bin_pkg bp ON ((bp.id = b.bin_pkg)))\nUNION\n SELECT s.bug,\n    s.src_pkg AS pkg_id,\n    'source_affects'::text AS pkg_type,\n    sp.pkg AS package\n   FROM (bug_affects_srcpackage s\n     JOIN src_pkg sp ON ((sp.id = s.src_pkg)))");
 
 =head1 ACCESSORS
 
@@ -73,8 +73,8 @@ __PACKAGE__->add_columns(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-03-04 10:59:03
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+zeVIVZOYSZjTkD+1N2sdw
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-04-13 11:30:02
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2Nrl+KO8b94gK5GcCkdNcw
 
 __PACKAGE__->result_source_instance->view_definition(<<EOF);
 SELECT b.bug,b.bin_pkg,'binary',bp.pkg FROM bug_binpackage b JOIN bin_pkg bp ON bp.id=b.bin_pkg UNION
index 2bccb2918a09a9e4416bbe7d536bd4bbbc9dfff3..d5b6540923921333a8350ec522d15f6db719cf97 100644 (file)
@@ -114,6 +114,11 @@ __PACKAGE__->belongs_to(
 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-03-04 10:59:03
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5SduyMaGHABDrX19Cxg4fg
 
+sub sqlt_deploy_hook {
+    my ($self, $sqlt_table) = @_;
+    $sqlt_table->add_index(name => 'bug_srcpackage_src_pkg_idx',
+                          fields => [qw(src_pkg)],
+                         );
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;
index 15e5c3a438957265d338872a07c2a85d0a61b6f7..f5c6c24f4037e16eead8a07860408f5f21f2a4eb 100644 (file)
@@ -115,5 +115,11 @@ __PACKAGE__->belongs_to(
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:yyHP5f8zAxn/AdjOCr8WAg
 
 
-# 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 => 'bug_tag_tag',
+                          fields => [qw(tag)],
+                         );
+}
+
 1;
index 113a36a1bccc98372cf72b1f0f9edbc9097726f8..6d83c63aac94b8d88794dbae1cbb41bdf747bf43 100644 (file)
@@ -113,5 +113,11 @@ __PACKAGE__->belongs_to(
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jZngUCQ1eBBcfXd/jWCKGA
 
 
-# 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 => 'bug_user_tag_tag',
+                          fields => [qw(user_tag)],
+                         );
+}
+
 1;
index 3de7f4cf32b0ee7f2ccfa4f4373d44c11742f16f..f50cf623d2048fe6c090332ee95752ece3e47eac 100644 (file)
@@ -234,5 +234,14 @@ __PACKAGE__->belongs_to(
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cvdjFL2o+rBg2PfcintuNA
 
 
-# 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) = @_;
+    for my $idx (qw(src_pkg src_ver)) {
+       $sqlt_table->add_index(name => 'bug_ver_'.$idx.'_id_idx',
+                              fields => [$idx]);
+    }
+    $sqlt_table->add_index(name => 'bug_ver_src_pkg_id_src_ver_id_idx',
+                          fields => [qw(src_pkg src_var)],
+                         );
+}
 1;
index 107e10b88e8ad4e601b4f7f8656007070370bb34..c5a28ec5599b2d396fa145fe2128a4910178471c 100644 (file)
@@ -115,6 +115,12 @@ __PACKAGE__->belongs_to(
 # 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(correspondent message)) {
+       $sqlt_table->add_index(name => 'message_correspondent_idx'.$idx,
+                              fields => [$idx]);
+    }
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;
index 9157653cc6f320ab3cdf7b930737b9d6537db9b1..d8c04ec8660c94ae5294e383090bee24c3394abd 100644 (file)
@@ -171,6 +171,11 @@ __PACKAGE__->has_many(
 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-11-30 21:56:51
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:rkpgeXltH2wiC1Us7FIijw
 
+sub sqlt_deploy_hook {
+    my ($self, $sqlt_table) = @_;
+    $sqlt_table->add_index(name => 'maintainer_idx_correspondent',
+                          fields => [qw(correspondent)],
+                         );
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;
index 0ac17aa525472f18669564a10d3c9f228723c7b8..cd42f48efef4bbabd3a8cb46de904e722b01c2f7 100644 (file)
@@ -243,5 +243,13 @@ __PACKAGE__->many_to_many(correspondents => 'message_correspondents','correspond
 __PACKAGE__->many_to_many(references => 'message_refs_message','message');
 __PACKAGE__->many_to_many(referenced_by => 'message_refs_refs','message');
 
-# 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) = @_;
+    for my $idx (qw(msgid subject)) {
+       $sqlt_table->add_index(name => 'message_'.$idx.'_idx',
+                              fields => [$idx]);
+    }
+}
+
 1;
index 8d695b7793ed52d45166fa8fcfffce07a2e06831..98e2a2d8e41d84c042872aad224cdf7f3e9e6ac3 100644 (file)
@@ -134,6 +134,12 @@ __PACKAGE__->belongs_to(
 # Created by DBIx::Class::Schema::Loader v0.07046 @ 2017-03-04 10:59:03
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:0YaAP/sB5N2Xr2rAFNK1lg
 
+sub sqlt_deploy_hook {
+    my ($self, $sqlt_table) = @_;
+    for my $idx (qw(refs message)) {
+       $sqlt_table->add_index(name => 'message_refs_idx_'.$idx,
+                              fields => [$idx]);
+    }
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;
index c31b6e6d175b198492218aa93c1251e9444c0218..edea9a968e5429f815f117b2c46e6b190d74f7f7 100644 (file)
@@ -144,6 +144,11 @@ __PACKAGE__->has_many(
 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2014-11-30 21:56:51
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nI4ZqWa6IW7LgWuG7S1Gog
 
+sub sqlt_deploy_hook {
+    my ($self, $sqlt_table) = @_;
+    $sqlt_table->add_index(name => 'severity_ordering_idx',
+                          fields => [qw(ordering)],
+                         );
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;
index 10266fa5c724c4832d2f25072b3613248165ab46..fc6b2e1a24ce65af6a5bfffcb1922b9ae1e066b4 100644 (file)
@@ -263,5 +263,10 @@ __PACKAGE__->has_many(
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:j8LGu4eUfNUNxM/jkHUG2A
 
 
-# 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;
index 2ced7917182f3904b54173e4f9b9e2f3dd1b240f..0883a2e5fe4a8f124b9634a1d76dc070ad4f2c55 100644 (file)
@@ -141,6 +141,11 @@ __PACKAGE__->belongs_to(
 # Created by DBIx::Class::Schema::Loader v0.07045 @ 2016-09-24 14:51:07
 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZPmTBeTue62dG2NdQdPrQg
 
+sub sqlt_deploy_hook {
+    my ($self, $sqlt_table) = @_;
+    $sqlt_table->add_index(name => 'user_tag_correspondent',
+                          fields => [qw(correspondent)],
+                         );
+}
 
-# You can replace this text with custom code or comments, and it will be preserved on regeneration
 1;
index 7badd7720ce0de990b7545afe3edccc1acd7271e..a9d2232563713615accd6fe68f4006fde8eb1883 100644 (file)
@@ -350,10 +350,6 @@ INSERT INTO table_comments VALUES ('bug_srcpackage','Bug <-> source package mapp
 INSERT INTO column_comments VALUES ('bug_srcpackage','bug','Bug id (matches bug)');
 INSERT INTO column_comments VALUES ('bug_srcpackage','src_pkg','Source package id (matches src_pkg)');
 
-CREATE VIEW bug_package (bug,pkg_id,pkg_type,package) AS
-       SELECT b.bug,b.bin_pkg,'binary',bp.pkg FROM bug_binpackage b JOIN bin_pkg bp ON bp.id=b.bin_pkg UNION
-              SELECT s.bug,s.src_pkg,'source',sp.pkg FROM bug_srcpackage s JOIN src_pkg sp ON sp.id=s.src_pkg;
-
 CREATE TABLE bug_affects_binpackage (
        bug INT NOT NULL REFERENCES bug,
        bin_pkg INT NOT NULL REFERENCES bin_pkg ON UPDATE CASCADE ON DELETE CASCADE
@@ -372,6 +368,12 @@ INSERT INTO table_comments VALUES ('bug_affects_srcpackage','Bug <-> source pack
 INSERT INTO column_comments VALUES ('bug_affects_srcpackage','bug','Bug id (matches bug)');
 INSERT INTO column_comments VALUES ('bug_affects_srcpackage','src_pkg','Source package id (matches src_pkg)');
 
+CREATE VIEW bug_package (bug,pkg_id,pkg_type,package) AS
+       SELECT b.bug,b.bin_pkg,'binary',bp.pkg FROM bug_binpackage b JOIN bin_pkg bp ON bp.id=b.bin_pkg UNION
+              SELECT s.bug,s.src_pkg,'source',sp.pkg FROM bug_srcpackage s JOIN src_pkg sp ON sp.id=s.src_pkg UNION
+       SELECT b.bug,b.bin_pkg,'binary_affects',bp.pkg FROM bug_affects_binpackage b JOIN bin_pkg bp ON bp.id=b.bin_pkg UNION
+              SELECT s.bug,s.src_pkg,'source_affects',sp.pkg FROM bug_affects_srcpackage s JOIN src_pkg sp ON sp.id=s.src_pkg;
+
 CREATE VIEW binary_versions (src_pkg, src_ver, bin_pkg, arch, bin_ver) AS
        SELECT sp.pkg AS src_pkg, sv.ver AS src_ver, bp.pkg AS bin_pkg, a.arch AS arch, b.ver AS bin_ver,
        svb.ver AS src_ver_based_on, spb.pkg AS src_pkg_based_on
@@ -443,6 +445,7 @@ CREATE INDEX bug_status_cache_idx_bug ON bug_status_cache(bug);
 CREATE INDEX bug_status_cache_idx_status ON bug_status_cache(status);
 CREATE INDEX bug_status_cache_idx_arch ON bug_status_cache(arch);
 CREATE INDEX bug_status_cache_idx_suite ON bug_status_cache(suite);
+CREATE INDEX bug_status_cache_idx_asof ON bug_status_cache(asof);
 INSERT INTO table_comments  VALUES ('bug_status_cache','Bug Status Cache');
 INSERT INTO column_comments VALUES ('bug_status_cache','bug','Bug number (matches bug)');
 INSERT INTO column_comments VALUES ('bug_status_cache','suite','Suite id (matches suite)');