summaryrefslogtreecommitdiff
path: root/FS/FS/password_history.pm
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2016-08-30 12:55:54 -0700
committerMark Wells <mark@freeside.biz>2016-08-30 12:56:15 -0700
commit368b06f9e1934e791f9fe9391bd803f9e4e43348 (patch)
tree1785ba1b2ceb86c75f44d5cbebf86368587040a0 /FS/FS/password_history.pm
parent92be841652923a8817bbadb37f26847764d923dd (diff)
fix password_history schema upgrade from pre-3.8 versions, #72265
Diffstat (limited to 'FS/FS/password_history.pm')
-rw-r--r--FS/FS/password_history.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/FS/FS/password_history.pm b/FS/FS/password_history.pm
index a34f616..13d1601 100644
--- a/FS/FS/password_history.pm
+++ b/FS/FS/password_history.pm
@@ -161,9 +161,14 @@ sub password_equals {
}
sub _upgrade_schema {
+ my $class = shift;
+ # if the table doesn't exist yet then nothing needs to happen here
+ my $dbdef_table = $class->dbdef_table
+ or return;
+
# clean up history records where linked_acct has gone away
my @where;
- for my $fk ( grep /__/, __PACKAGE__->dbdef_table->columns ) {
+ for my $fk ( grep /__/, $dbdef_table->columns ) {
my ($table, $key) = split(/__/, $fk);
push @where, "
( $fk IS NOT NULL AND NOT EXISTS(SELECT 1 FROM $table WHERE $table.$key = $fk) )";