From adf5bbdb40ef7695a33ec9ca4565182a99b83dea Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Tue, 5 Apr 2005 04:30:15 +0000 Subject: Bug 286527: Cross-DB bz_rename_column and bz_drop_column (Part of Bug 285111) Patch By Max Kanat-Alexander r=Tomas.Kopal, a=myk --- Bugzilla/DB/Schema/Mysql.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'Bugzilla/DB/Schema/Mysql.pm') diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm index 6340998b7..07d7036e4 100644 --- a/Bugzilla/DB/Schema/Mysql.pm +++ b/Bugzilla/DB/Schema/Mysql.pm @@ -100,11 +100,8 @@ sub _get_create_index_ddl { # MySQL has a simpler ALTER TABLE syntax than ANSI. sub get_alter_column_ddl { - my ($self, $table, $column, $new_def) = @_; - my $new_ddl = $self->get_type_ddl($new_def); - return (("ALTER TABLE $table CHANGE COLUMN $column $column $new_ddl")); } @@ -113,4 +110,10 @@ sub get_drop_index_ddl { return ("DROP INDEX $name ON $table"); } +sub get_rename_column_ddl { + my ($self, $table, $old_name, $new_name) = @_; + my $def = $self->get_type_ddl($self->get_column($table, $old_name)); + return ("ALTER TABLE $table CHANGE COLUMN $old_name $new_name $def"); +} + 1; -- cgit v1.2.3-24-g4f1b