automatically create an index on the new radacct.FreesideStatus column
[freeside.git] / FS / FS / Upgrade.pm
index ae9c763..5c873bf 100644 (file)
@@ -132,6 +132,13 @@ sub upgrade_sqlradius {
       $sth_update->execute or die $sth_update->errstr;
     }
 
+    my $sth_index = $dbh->prepare(
+      "CREATE INDEX FreesideStatus ON radacct ( FreesideStatus )"
+    );
+    if ( $sth_index ) {
+      $sth_index->execute;
+    }
+
     my $sth = $dbh->prepare("SELECT UserName,
                                     Realm,
                                     $str2time max(AcctStartTime)),