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

namespace AmbassadorHub\Donors;

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

use AmbassadorHub\Migrations\AbstractMigrationRunner;

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

	protected const VERSION_OPTION = 'ambh_donors_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\SimplifyColumns::class,
			3 => Migrations\AddIsAnonymous::class,
			4 => Migrations\AddAddressColumns::class,
		);
	}
}
