get('SilverStripe\\ORM\\DatabaseAdmin', 'classname_value_remapping'); $updateQuery = "UPDATE \"Comment\" SET \"BaseClass\" = ? WHERE \"BaseClass\" = ?"; foreach ($remapping as $old => $new) { DB::prepared_query($updateQuery, [$new, $old]); } // Move these values to ParentClass (the 4.x column name) DB::query('UPDATE "Comment" SET "ParentClass" = "BaseClass"'); DB::alteration_message('Finished updating any applicable Comment class columns', 'notice'); } }