diff options
author | justdave%bugzilla.org <> | 2007-04-15 08:35:56 +0200 |
---|---|---|
committer | justdave%bugzilla.org <> | 2007-04-15 08:35:56 +0200 |
commit | 8da7f321aabe95470944bc23aeed9a06ef6793a5 (patch) | |
tree | b16ca05abfae22dffd3ca8f0c868cc799273f2e7 /Bugzilla/DB/Schema.pm | |
parent | b3630da125fa112e04f6e6a15328f64e13a874c5 (diff) | |
download | bugzilla-8da7f321aabe95470944bc23aeed9a06ef6793a5.tar.gz bugzilla-8da7f321aabe95470944bc23aeed9a06ef6793a5.tar.xz |
Bug 373869: Custom field names must be all lowercase or buglist.cgi sorting throws an error
Patch by mkanat and justdave
r=LpSolit,mkanat; a=mkanat
Diffstat (limited to 'Bugzilla/DB/Schema.pm')
-rw-r--r-- | Bugzilla/DB/Schema.pm | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index 15d7dd8b2..44bda1acb 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -1911,6 +1911,37 @@ sub get_rename_column_ddl { . " has not implemented a method."; } + +sub get_rename_table_sql { + +=item C<get_rename_table_sql> + +=over + +=item B<Description> + +Gets SQL to rename a table in the database. + +=item B<Params> + +=over + +=item C<$old_name> - The current name of the table. + +=item C<$new_name> - The new name of the table. + +=back + +=item B<Returns>: An array of SQL statements to rename a table. + +=back + +=cut + + my ($self, $old_name, $new_name) = @_; + return ("ALTER TABLE $old_name RENAME TO $new_name"); +} + =item C<delete_table($name)> Description: Deletes a table from this Schema object. @@ -2062,6 +2093,23 @@ sub add_table { } } + + +sub rename_table { + +=item C<rename_table> + +Renames a table from C<$old_name> to C<$new_name> in this Schema object. + +=cut + + + my ($self, $old_name, $new_name) = @_; + my $table = $self->get_table_abstract($old_name); + $self->delete_table($old_name); + $self->add_table($new_name, $table); +} + sub delete_column { =item C<delete_column($table, $column)> |