aboutsummaryrefslogtreecommitdiff
path: root/perl/lib/Wallet/Admin.pm
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2020-05-17 22:17:36 -0700
committerRuss Allbery <eagle@eyrie.org>2020-05-17 22:17:36 -0700
commit4338488b0410a87b553bfa7ae54b16837b108487 (patch)
tree19ffae4753e8f216a03244a695e48e910c82a754 /perl/lib/Wallet/Admin.pm
parent47c722846ece5eb460d91c243e4358eb31e4614b (diff)
Fix table drop order when destroying the database
Fix the table drop order for wallet-admin destroy to avoid violating foreign key constraints. Patch from macrotex.
Diffstat (limited to 'perl/lib/Wallet/Admin.pm')
-rw-r--r--perl/lib/Wallet/Admin.pm10
1 files changed, 6 insertions, 4 deletions
diff --git a/perl/lib/Wallet/Admin.pm b/perl/lib/Wallet/Admin.pm
index 630ac81..2b1a2f8 100644
--- a/perl/lib/Wallet/Admin.pm
+++ b/perl/lib/Wallet/Admin.pm
@@ -1,7 +1,7 @@
# Wallet::Admin -- Wallet system administrative interface
#
# Written by Russ Allbery <eagle@eyrie.org>
-# Copyright 2016 Russ Allbery <eagle@eyrie.org>
+# Copyright 2016, 2020 Russ Allbery <eagle@eyrie.org>
# Copyright 2008-2014
# The Board of Trustees of the Leland Stanford Junior University
#
@@ -165,9 +165,11 @@ sub destroy {
# Get an actual DBI handle and use it to delete all tables.
my $dbh = $self->dbh;
- my @tables = qw/acl_entries object_history objects acls acl_history
- acl_schemes enctypes flags keytab_enctypes keytab_sync sync_targets
- duo types dbix_class_schema_versions/;
+ my @tables = qw(
+ acl_entries duo object_history objects acls acl_history acl_schemes
+ enctypes flags keytab_enctypes keytab_sync sync_targets types
+ dbix_class_schema_versions
+ );
for my $table (@tables) {
my $sql = "DROP TABLE IF EXISTS $table";
$dbh->do ($sql);