diff options
author | mkanat%kerio.com <> | 2005-04-06 09:18:03 +0200 |
---|---|---|
committer | mkanat%kerio.com <> | 2005-04-06 09:18:03 +0200 |
commit | 3541f13ea528fa84bbbf5270376044266c18d763 (patch) | |
tree | 30ba2f64c3395424e3fc69fd915c81201b1b0db3 /Bugzilla/DB.pm | |
parent | af00161996a15e545573c29ccac52185eeb9b9dd (diff) | |
download | bugzilla-3541f13ea528fa84bbbf5270376044266c18d763.tar.gz bugzilla-3541f13ea528fa84bbbf5270376044266c18d763.tar.xz |
Bug 284850: checksetup should rename indexes to conform to the new standard
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=jouni, a=myk
Diffstat (limited to 'Bugzilla/DB.pm')
-rw-r--r-- | Bugzilla/DB.pm | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 28eb9eed9..b0106314e 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -305,10 +305,7 @@ sub bz_setup_database { my ($self) = @_; # Get a list of the existing tables (if any) in the database - my $table_sth = $self->table_info(undef, undef, undef, "TABLE"); - my @current_tables = - @{$self->selectcol_arrayref($table_sth, { Columns => [3] })}; - + my @current_tables = $self->bz_table_list_real(); my @desired_tables = $self->_bz_schema->get_table_list(); foreach my $table_name (@desired_tables) { @@ -650,6 +647,39 @@ sub bz_table_exists ($) { } ##################################################################### +# Protected "Real Database" Schema Information Methods +##################################################################### + +# Only Bugzilla::DB and subclasses should use these methods. +# If you need a method that does the same thing as one of these +# methods, use the version without _real on the end. + +# bz_table_columns_real($table) +# +# Description: Returns a list of columns on a given table +# as the table actually is, on the disk. +# Params: $table - Name of the table. +# Returns: An array of column names. +# +sub bz_table_columns_real { + my ($self, $table) = @_; + my $sth = $self->column_info(undef, undef, $table, '%'); + return @{ $self->selectcol_arrayref($sth, {Columns => [4]}) }; +} + +# bz_table_list_real() +# +# Description: Gets a list of tables in the current +# database, directly from the disk. +# Params: none +# Returns: An array containing table names. +sub bz_table_list_real { + my ($self) = @_; + my $table_sth = $self->table_info(undef, undef, undef, "TABLE"); + return @{$self->selectcol_arrayref($table_sth, { Columns => [3] })}; +} + +##################################################################### # Transaction Methods ##################################################################### |