Add IF EXISTS to DROP INDEX (except under MySQL)
[DBIx-DBSchema.git] / DBSchema / Table.pm
index 081841a..0ef679a 100644 (file)
@@ -631,10 +631,8 @@ sub sql_alter_table {
     warn "removing obsolete index $table.$old ON ( ".
          $old_indices{$old}->columns_sql. " )\n"
       if $DEBUG > 1;
-    push @r, 'DROP INDEX '.
-             ( $driver ne 'mysql' ? ' IF EXISTS ' : '');
-             " $old ".
-             ( $driver eq 'mysql' ? " ON $table " : '');
+    push @r, 'DROP INDEX '.  ( $driver ne 'mysql' ? ' IF EXISTS ' : '').
+             " $old ".       ( $driver eq 'mysql' ? " ON $table " : '');
   }
 
   foreach my $new ( keys %new_indices ) {