Skip to content

Commit

Permalink
Bug 1941913 - Bug fixes for scripts/remove-non-public-data.pl that pr…
Browse files Browse the repository at this point in the history
…epares a sanitized DB snapshot for researchers
  • Loading branch information
dklawren committed Jan 21, 2025
1 parent 172618f commit 3477a2c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/remove-non-public-data.pl
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ BEGIN
],
longdescs_reactions => [
qw(
id comment_id user_id
id comment_id user_id reaction
)
],
longdescs_tags => [
Expand Down Expand Up @@ -248,7 +248,7 @@ BEGIN
else {
print "dropping $table\n";
drop_referencing($table);
$dbh->do("DROP TABLE IF EXISTS $table");
$dbh->do('DROP TABLE IF EXISTS ' . $dbh->quote_identifier($table));
}
}

Expand Down Expand Up @@ -320,12 +320,12 @@ sub drop_referencing {

# drop the index
my $rows
= $dbh->selectall_arrayref("SHOW INDEX FROM $table WHERE Column_name = ?",
= $dbh->selectall_arrayref('SHOW INDEX FROM ' . $dbh->quote_identifier($table) . ' WHERE Column_name = ?',
{Slice => {}}, $column);
foreach my $fk (@$rows) {
print " dropping index $fk->{Table}.$fk->{Key_name}\n";
$dbh->do("ALTER TABLE "
. $dbh->quote_identifier($fk->{table})
. $dbh->quote_identifier($fk->{Table})
. " DROP INDEX $fk->{Key_name}");
}
}
Expand Down

0 comments on commit 3477a2c

Please sign in to comment.