# yatra/3.0.5.1/app/Upgrades/Versions/Upgrade_3_0_3.php

Yatra – Travel Booking &amp; Tour Operator Software, version 3.0.5.1. 50 lines.

- Page: https://pluginprobe.com/plugins/yatra/3.0.5.1/code/app/Upgrades/Versions/Upgrade_3_0_3.php
- Raw: https://pluginprobe.com/plugins/yatra/3.0.5.1/raw/app/Upgrades/Versions/Upgrade_3_0_3.php
- Modified: 2026-05-04T10:23:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/yatra/3.0.5.1/code/app/Upgrades/Versions/Upgrade_3_0_3.php#L10-L20`.

```php
<?php

declare(strict_types=1);

namespace Yatra\Upgrades\Versions;

use Yatra\Services\InstallerService;
use Yatra\Upgrades\AbstractUpgradeStep;

/**
 * Free 3.0.3: drop legacy payment-token tables after Pro (or nothing) has migrated scheduled rows.
 *
 * Canonical table name matches Pro {@see \YatraPro\Upgrades\Versions\Upgrade_3_0_0_1} (`wp_*_yatra_payment_tokens`).
 * Some installs may still have a mistaken `yatra_new_payment_tokens` name from early builds; drop both if present.
 */
final class Upgrade_3_0_3 extends AbstractUpgradeStep
{
    public static function targetVersion(): string
    {
        return '3.0.3';
    }

    public static function runOnHooks(): array
    {
        return ['admin_init'];
    }

    public static function run(string $fromVersion, string $toVersion): void
    {
        unset($fromVersion, $toVersion);

        global $wpdb;

        $suffixes = [
            'yatra_payment_tokens',
            'yatra_new_payment_tokens',
        ];

        foreach ($suffixes as $suffix) {
            $table = $wpdb->prefix . $suffix;
            if (!InstallerService::databaseTableExists($table)) {
                continue;
            }

            // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- table name is escaped.
            $wpdb->query('DROP TABLE IF EXISTS `' . esc_sql($table) . '`');
        }
    }
}

```
