<?php

namespace WPUltimateSecurity\UltimateSecurity\Bootstrap\Lifecycle\Migrations;

/**
 * Interface for version-specific database migrations.
 *
 * Each migration class represents a set of changes that need to be applied
 * when upgrading from a specific version. Migrations are tracked individually
 * and only run once.
 */
interface MigrationInterface
{
    /**
     * Get the version this migration applies to.
     *
     * Migration runs if current DB version < this version.
     * Format: semantic version string (e.g., '1.0.15')
     *
     * @return string Version string
     */
    public static function version(): string;

    /**
     * Get a human-readable description of what this migration does.
     *
     * @return string Description
     */
    public static function description(): string;

    /**
     * Execute the migration.
     *
     * This method should contain all the logic to upgrade the database/options
     * from the previous version. It should be idempotent where possible.
     *
     * @return bool True on success, false on failure
     */
    public static function up(): bool;

    /**
     * Rollback the migration (optional).
     *
     * This method can be used to undo the changes made by up().
     * Not all migrations need to be reversible.
     *
     * @return bool True on success, false on failure
     */
    public static function down(): bool;
}
