<?php
/**
 * Donations Migration Runner
 *
 * Runs sequential database migrations for the Donations module and hooks
 * into the platform-wide ambh_run_migrations action so the
 * Migrations\Manager coordinates all modules together.
 *
 * @package AmbassadorHub\Donations
 */

namespace AmbassadorHub\Donations;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

use AmbassadorHub\Migrations\AbstractMigrationRunner;

/**
 * Runs sequential Donations database migrations.
 *
 * Each integer version corresponds to a migration class. Versions are stored
 * in the `ambh_donations_db_version` option so they survive plugin updates.
 */
final class MigrationRunner extends AbstractMigrationRunner {

	protected const VERSION_OPTION = 'ambh_donations_db_version';

	/**
	 * Return the ordered map of version → migration class.
	 *
	 * @return array<int, class-string>
	 */
	protected static function get_migrations(): array {
		return array(
			1 => Migrations\CreateTables::class,
			2 => Migrations\AddDonorId::class,
			3 => Migrations\RemoveDonorPiiColumns::class,
		);
	}
}
