+ unless ( $args{'force'} ) {
+ print "\nIT'S VERY IMPORTANT TO BACK UP BEFORE THIS STEP\n\n";
+ _yesno() or exit(-2);
+ }
+
+ RT->ConnectToDatabase();
+ RT->InitSystemObjects();
+ $log_actions = 1;
+
+ RT->System->AddUpgradeHistory($package => {
+ type => 'full upgrade',
+ action => 'upgrade',
+ stage => 'before',
+ from => $upgrading_from,
+ to => $upgrading_to,
+ versions => [@versions],
+ full_id => $full_id,
+ individual_id => $full_id
+ });
+
+ # Ensure that the Attributes column is big enough to hold the
+ # upgrade steps we're going to add; this step exists in 4.0.6 for
+ # mysql, but that may be too late. Run it as soon as possible.
+ if (RT->Config->Get('DatabaseType') eq 'mysql'
+ and RT::Handle::cmp_version( $upgrading_from, '4.0.6') < 0) {
+ my $dbh = get_admin_dbh();
+ # Before the binary switch in 3.7.87, we want to alter text ->
+ # longtext, not blob -> longblob
+ if (RT::Handle::cmp_version( $upgrading_from, '3.7.87') < 0) {
+ $dbh->do("ALTER TABLE Attributes MODIFY Content LONGTEXT")
+ } else {
+ $dbh->do("ALTER TABLE Attributes MODIFY Content LONGBLOB")
+ }
+ }