| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Yatra\Migration; |
| 6 |
|
| 7 |
use Yatra\Constants\ClassificationTypes; |
| 8 |
|
| 9 |
/** |
| 10 |
* Migrates trip type / tour category taxonomy terms into ClassificationsTable (type=category). |
| 11 |
* |
| 12 |
* Old sites may register either `trip_category` (Yatra 3.x) or `tour_category` (some 2.x builds). |
| 13 |
*/ |
| 14 |
class TripCategoryMigration extends BaseMigration |
| 15 |
{ |
| 16 |
public function run(): array |
| 17 |
{ |
| 18 |
// Include both slugs: legacy DB rows may exist even if `tour_category` is no longer registered. |
| 19 |
return $this->migrateTaxonomy( |
| 20 |
['trip_category', 'tour_category'], |
| 21 |
ClassificationTypes::CATEGORY, |
| 22 |
'trip_categories' |
| 23 |
); |
| 24 |
} |
| 25 |
} |
| 26 |
|