projects
/
DBIx-DBSchema.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ff1bacd
)
Add IF EXISTS to DROP INDEX (except under MySQL)
author
Ivan Kohler
<ivan@freeside.biz>
Thu, 4 Feb 2016 00:43:45 +0000
(16:43 -0800)
committer
Ivan Kohler
<ivan@freeside.biz>
Thu, 4 Feb 2016 00:43:45 +0000
(16:43 -0800)
DBSchema/Table.pm
patch
|
blob
|
history
diff --git
a/DBSchema/Table.pm
b/DBSchema/Table.pm
index
081841a
..
0ef679a
100644
(file)
--- a/
DBSchema/Table.pm
+++ b/
DBSchema/Table.pm
@@
-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 ) {