Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1941913 - Bug fixes for scripts/remove-non-public-data.pl that prepares a sanitized DB snapshot for researchers #2380

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Bug 1941913 - Bug fixes for scripts/remove-non-public-data.pl that pr…
…epares a sanitized DB snapshot for researchers
dklawren committed Jan 21, 2025

Verified

This commit was signed with the committer’s verified signature.
JonGilmore Jon Gilmore
commit 3477a2c1d0799d29ea10b348819552907fb68c6a
8 changes: 4 additions & 4 deletions scripts/remove-non-public-data.pl
Original file line number Diff line number Diff line change
@@ -127,7 +127,7 @@ BEGIN
],
longdescs_reactions => [
qw(
id comment_id user_id
id comment_id user_id reaction
)
],
longdescs_tags => [
@@ -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));
}
}

@@ -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}");
}
}